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