]> git.lyx.org Git - lyx.git/blob - src/bufferview_funcs.h
do not define boost::throw_exceptions if we are compiling with exceptions
[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 class Point;
25
26
27 namespace bv_funcs {
28
29 /// Set \param data using \param font and \param toggle. Return success.
30 bool font2string(LyXFont const & font, bool toggle, std::string & data);
31
32 /// Set \param font and \param toggle using \param data. Return success.
33 bool string2font(std::string const & data, LyXFont & font, bool & toggle);
34
35 /** Returns the current freefont, encoded as a std::string to be passed to the
36  *  frontends.
37  */
38 std::string const freefont2string();
39
40 Point getPos(DocIterator const & dit, bool boundary);
41
42 enum CurStatus {
43         CUR_INSIDE,
44         CUR_ABOVE,
45         CUR_BELOW
46 };
47
48
49 CurStatus status(BufferView const * bv, DocIterator const & dit);
50
51
52 Point coordOffset(DocIterator const & dit, bool boundary);
53
54 /// Moves cursor to the next inset with one of the given codes.
55 void gotoInset(BufferView * bv, std::vector<InsetBase_code> const & codes,
56                bool same_content);
57
58 /// Moves cursor to the next inset with given code.
59 void gotoInset(BufferView * bv, InsetBase_code code, bool same_content);
60
61 /// Looks for next inset with one of the the given code
62 bool findInset(DocIterator & dit, std::vector<InsetBase_code> const & codes,
63                bool same_content);
64
65 /// Looks for next inset with the given code
66 void findInset(DocIterator & dit, InsetBase_code code, bool same_content);
67
68
69 } // namespace bv_funcs
70
71 #endif