]> git.lyx.org Git - lyx.git/blob - src/bufferview_funcs.h
Add a Buffer::fully_loaded member function, returning true only when
[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
19
20 class BufferView;
21 class LyXFont;
22 class LyXText;
23
24
25 namespace bv_funcs {
26
27 /** Set \param data using \param font and \param toggle.
28  *  If successful, returns true.
29  */
30 bool font2string(LyXFont const & font, bool toggle, std::string & data);
31 /** Set \param font and \param toggle using \param data.
32  *  If successful, returns true.
33  */
34 bool string2font(std::string const & data, LyXFont & font, bool & toggle);
35 /** Returns the current freefont, encoded as a std::string to be passed to the
36  *  frontends.
37  */
38 std::string const freefont2string();
39 /** Set the freefont using the contents of \param data dispatched from
40  *  the frontends and apply it at the current cursor location.
41  */
42 void update_and_apply_freefont(BufferView * bv, std::string const & data);
43 /** Apply the contents of freefont at the current cursor location.
44  */
45 void apply_freefont(BufferView * bv);
46
47 /// what type of depth change to make
48 enum DEPTH_CHANGE {
49         INC_DEPTH,
50         DEC_DEPTH
51 };
52
53 /**
54  * Increase or decrease the nesting depth of the selected paragraph(s)
55  * if test_only, don't change any depths. Returns whether something
56  * (would have) changed
57  */
58 extern bool changeDepth(BufferView *, LyXText *, DEPTH_CHANGE, bool test_only);
59
60 ///
61 extern void emph(BufferView *);
62 ///
63 extern void bold(BufferView *);
64 ///
65 extern void noun(BufferView *);
66 ///
67 extern void lang(BufferView *, std::string const &);
68 ///
69 extern void number(BufferView *);
70 ///
71 extern void tex(BufferView *);
72 ///
73 extern void code(BufferView *);
74 ///
75 extern void sans(BufferView *);
76 ///
77 extern void roman(BufferView *);
78 ///
79 extern void styleReset(BufferView *);
80 ///
81 extern void underline(BufferView *);
82 ///
83 extern void fontSize(BufferView *, std::string const &);
84 /// Returns the current font and depth as a message.
85 extern std::string const currentState(BufferView *);
86 ///
87 extern void toggleAndShow(BufferView *, LyXFont const &,
88                           bool toggleall = true);
89 /// replace selection with insertion
90 extern void replaceSelection(LyXText * lt);
91 }; // namespace bv_funcs
92
93 #endif