]> git.lyx.org Git - lyx.git/blob - src/bufferview_funcs.h
Hopefully temporary fix for the Tabular crash problem. Of course, this is not the...
[lyx.git] / src / bufferview_funcs.h
1 // -*- C++ -*-
2 /**
3  * \file bufferview_funcs.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef BUFFERVIEW_FUNCS_H
15 #define BUFFERVIEW_FUNCS_H
16
17 #include <string>
18 #include <vector>
19
20 class BufferView;
21 class DocIterator;
22 class InsetBase_code;
23 class LyXFont;
24
25 namespace lyx {
26 class Point;
27 }
28
29
30 namespace bv_funcs {
31
32 /// Set \param data using \param font and \param toggle. Return success.
33 bool font2string(LyXFont const & font, bool toggle, std::string & data);
34
35 /// Set \param font and \param toggle using \param data. Return success.
36 bool string2font(std::string const & data, LyXFont & font, bool & toggle);
37
38 /** Returns the current freefont, encoded as a std::string to be passed to the
39  *  frontends.
40  */
41 std::string const freefont2string();
42
43 lyx::Point getPos(BufferView & bv, DocIterator const & dit, bool boundary);
44
45 enum CurStatus {
46         CUR_INSIDE,
47         CUR_ABOVE,
48         CUR_BELOW
49 };
50
51
52 CurStatus status(BufferView const * bv, DocIterator const & dit);
53
54
55 lyx::Point coordOffset(BufferView const & bv, DocIterator const & dit, bool boundary);
56
57 /// Moves cursor to the next inset with one of the given codes.
58 void gotoInset(BufferView * bv, std::vector<InsetBase_code> const & codes,
59                bool same_content);
60
61 /// Moves cursor to the next inset with given code.
62 void gotoInset(BufferView * bv, InsetBase_code code, bool same_content);
63
64 /// Looks for next inset with one of the the given code
65 bool findInset(DocIterator & dit, std::vector<InsetBase_code> const & codes,
66                bool same_content);
67
68 /// Looks for next inset with the given code
69 void findInset(DocIterator & dit, InsetBase_code code, bool same_content);
70
71
72 } // namespace bv_funcs
73
74 #endif