4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
28 /// Common base class to all insets
32 typedef int difference_type;
33 /// short of anything else reasonable
34 typedef size_t size_type;
35 /// type for cell indices
36 typedef size_t idx_type;
37 /// type for cursor positions
38 typedef size_t pos_type;
39 /// type for row numbers
40 typedef size_t row_type;
41 /// type for column numbers
42 typedef size_t col_type;
44 /// virtual base class destructor
45 virtual ~InsetBase() {}
46 /// replicate ourselves
47 virtual std::auto_ptr<InsetBase> clone() const = 0;
49 // the real dispatcher
51 dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
52 // the real dispatcher
54 dispatch(FuncRequest const & cmd);
56 /// compute the size of the object returned in dim
57 virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
58 /// draw inset and update (xo, yo)-cache
59 virtual void draw(PainterInfo & pi, int x, int y) const = 0;
61 /// request "external features"
62 virtual void validate(LaTeXFeatures &) const {}
63 /// Appends \c list with all labels found within this inset.
64 virtual void getLabelList(Buffer const &,
65 std::vector<std::string> & /* list */) const {}
67 // the real dispatcher
70 priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);