]> git.lyx.org Git - lyx.git/blob - src/insets/updatableinset.h
remove Inset::getParagraphs()
[lyx.git] / src / insets / updatableinset.h
1 // -*- C++ -*-
2 /**
3  * \file updatableinset.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author Jürgen Vigna
9  * \author Lars Gullik Bjønnes
10  * \author Matthias Ettrich
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef UPDATABLEINSET_H
16 #define UPDATABLEINSET_H
17
18 //  Updatable Insets. These insets can receive directly user interaction.
19 //  Note that all pure methods from Inset class are pure here too.
20 //  [Alejandro 080596]
21
22 #include "inset.h"
23
24 class UpdatableInset : public InsetOld {
25 public:
26         /// check if the font of the char we want inserting is correct
27         /// and modify it if it is not.
28         virtual bool checkInsertChar(LyXFont &) { return true; }
29         ///
30         virtual EDITABLE editable() const;
31
32         /// return the cursor pos, relative to the inset pos
33         virtual void getCursorPos(int &, int &) const {}
34         /// return the cursor dim
35         virtual void getCursorDim(int &, int &) const;
36         ///
37         virtual bool insertInset(BufferView *, InsetOld *) { return false; }
38         // We need this method to not clobber the real method in Inset
39         int scroll(bool recursive = true) const
40                 { return InsetOld::scroll(recursive); }
41         ///
42         virtual bool showInsetDialog(BufferView *) const { return false; }
43         ///
44         virtual void toggleSelection(BufferView *, bool /*kill_selection*/) {}
45
46 protected:
47         ///  An updatable inset could handle lyx editing commands
48         virtual
49         DispatchResult
50         priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
51         /// scrolls to absolute position in bufferview-workwidth * sx units
52         void scroll(BufferView *, float sx) const;
53         /// scrolls offset pixels
54         void scroll(BufferView *, int offset) const;
55 };
56
57 #endif