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
22 /** Dispatch result codes
23 DISPATCHED = the inset catched the action
24 DISPATCHED_NOUPDATE = the inset catched the action and no update
25 is needed here to redraw the inset
26 FINISHED = the inset must be unlocked as a result
28 FINISHED_RIGHT = FINISHED, but put the cursor to the RIGHT of
30 FINISHED_UP = FINISHED, but put the cursor UP of
32 FINISHED_DOWN = FINISHED, but put the cursor DOWN of
34 UNDISPATCHED = the action was not catched, it should be
35 dispatched by lower level insets
37 enum dispatch_result {
49 /// Common base class to all insets
52 /// type for cell indices
53 typedef size_t idx_type;
54 /// type for cursor positions
55 typedef size_t pos_type;
56 /// type for row numbers
57 typedef size_t row_type;
58 /// type for column numbers
59 typedef size_t col_type;
61 // the real dispatcher
62 virtual dispatch_result dispatch
63 (FuncRequest const & cmd, idx_type & idx, pos_type & pos);
65 /// small wrapper for the time being
66 virtual dispatch_result localDispatch(FuncRequest const & cmd);
68 virtual void draw(PainterInfo & pi, int x, int y) const = 0;
71 virtual ~InsetBase() {}
73 /// Methods to cache and retrieve a cached BufferView.
74 virtual void cache(BufferView *) const {}
76 virtual BufferView * view() const { return 0; }