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