]> git.lyx.org Git - lyx.git/blob - src/Bullet.h
Disable CheckTeX while buffer is processed
[lyx.git] / src / Bullet.h
1 // -*- C++ -*-
2 /**
3  * \file Bullet.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 Allan Rae
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef BULLET_H
14 #define BULLET_H
15
16 #include "support/docstring.h"
17
18
19 namespace lyx {
20
21 ///
22 class Bullet {
23 public:
24         ///
25         Bullet(int f = -1, int c = -1, int s = -1);
26
27         ///
28         explicit Bullet(docstring const &);
29
30         ///
31         void setCharacter(int);
32         ///
33         void setFont(int);
34         ///
35         void setSize(int);
36         ///
37         void setText(docstring const &);
38         ///
39         int getCharacter() const;
40         ///
41         int getFont() const;
42         ///
43         int getSize() const;
44         ///
45         docstring const & getText() const;
46         ///
47         Bullet & operator=(Bullet const &);
48         ///
49         friend bool operator==(Bullet const &, Bullet const &);
50 protected:
51         ///
52         void testInvariant() const;
53 private:
54         /**
55            This enum makes adding additional panels or changing panel sizes
56            easier. Since you only need change these values for all tests to
57            be correct for the new values.
58
59            Note: MAX means the size of the array so to test you need:
60            (x < MAX)  *not* (x <= MAX)
61         */
62         enum {
63                 ///
64                 MIN = -1,
65                 ///
66                 FONTMAX = 6,
67                 ///
68                 CHARMAX = 36,
69                 ///
70                 SIZEMAX = 10
71         };
72
73         ///
74         void generateText() const;
75         ///
76         static docstring const bulletSize(int);
77         ///
78         static docstring const bulletEntry(int, int);
79
80         ///
81         int font;
82         ///
83         int character;
84         ///
85         int size;
86
87         // size, character and font are array indices to access
88         // the predefined arrays of LaTeX equivalent strings.
89
90         /** flag indicates if user has control of text (1)
91             or if I can use it to generate strings (0)
92             or have already (-1)
93         */
94         mutable short user_text;
95
96         //NOTE: Arranging these four shorts above to be together
97         //      like this should ensure they are in a single cache line
98
99         /** text may contain a user-defined LaTeX symbol command
100             or one generated internally from the font, character
101             and size settings.
102         */
103         mutable docstring text;
104 };
105
106
107 inline
108 bool operator!=(Bullet const & b1, Bullet const & b2)
109 {
110         return !(b1 == b2);
111 }
112
113 ///
114 extern
115 Bullet const ITEMIZE_DEFAULTS[];
116
117
118 } // namespace lyx
119
120 #endif /* BULLET_H_ */