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
53 DispatchResult dispatch(FuncRequest const & cmd);
56 virtual void edit(BufferView * bv, bool left);
58 virtual void edit(BufferView * bv, int x, int y);
60 /// compute the size of the object returned in dim
61 virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
62 /// draw inset and update (xo, yo)-cache
63 virtual void draw(PainterInfo & pi, int x, int y) const = 0;
65 /// request "external features"
66 virtual void validate(LaTeXFeatures &) const {}
67 /// Appends \c list with all labels found within this inset.
68 virtual void getLabelList(Buffer const &,
69 std::vector<std::string> & /* list */) const {}
71 // the real dispatcher
74 priv_dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);