]> git.lyx.org Git - lyx.git/blob - src/mathed/math_defs.h
small cleanup, doxygen, formatting changes
[lyx.git] / src / mathed / math_defs.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_defs.h
4  *  Purpose:     Math editor definitions 
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     January 1996
7  *  Description: Math paragraph and objects for a WYSIWYG math editor.
8  *
9  *  Dependencies: Xlib
10  *
11  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
12  *
13  *   Version: 0.8beta, Mathed & Lyx project.
14  *
15  *   You are free to use and modify this code under the terms of
16  *   the GNU General Public Licence version 2 or later.
17  * 
18  */
19
20 #ifndef MATH_DEFS
21 #define MATH_DEFS
22
23 #ifdef __GNUG__
24 #pragma interface
25 #endif
26
27 #include <iosfwd>
28
29 #include "LString.h"
30
31 ///
32 enum math_align {
33         ///
34         MATH_ALIGN_LEFT = 1,
35         ///
36         MATH_ALIGN_RIGHT = 2,
37         ///
38         MATH_ALIGN_BOTTOM = 4,
39         ///
40         MATH_ALIGN_TOP = 8
41 };
42 ///
43 static int const MATH_COLSEP = 8;
44 ///
45 static int const MATH_ROWSEP = 8;
46
47
48 /// Standard Math Sizes (Math mode styles)
49 enum MathedStyles {
50         ///
51         LM_ST_DISPLAY = 0,
52         ///
53         LM_ST_TEXT,
54         ///
55         LM_ST_SCRIPT,
56         ///
57         LM_ST_SCRIPTSCRIPT
58 };
59
60
61 /** The restrictions of a standard LaTeX math paragraph
62   allows to get a small number of text codes (<30) */
63 enum MathedTextCodes  {
64         /// This must be >= 0
65         LM_TC_MIN = 0,
66         /// Open and Close group
67         LM_TC_OPEN,
68         ///
69         LM_TC_CLOSE,
70         /// Tabulator
71         LM_TC_TAB,
72         /// New line
73         LM_TC_CR,
74         /// Math Inset
75         LM_TC_INSET,
76         /// Super and sub scripts
77         LM_TC_UP,
78         ///
79         LM_TC_DOWN,
80         /// Editable Math Inset
81         LM_TC_ACTIVE_INSET,
82         /// Editable Text Inset
83         LM_TC_TEXT_INSET,
84         ///
85         LM_FONT_BEGIN,
86         /// Internal code for constants
87         LM_TC_CONST,
88         /// Internal code for variables
89         LM_TC_VAR,
90         ///
91         LM_TC_RM,
92         ///
93         LM_TC_CAL,
94         ///
95         LM_TC_BF,
96         ///
97         LM_TC_SF,
98         ///
99         LM_TC_TT,
100         ///
101         LM_TC_IT,
102         ///
103         LM_TC_TEXTRM,
104         /// Math mode TeX characters ",;:{}"
105         LM_TC_TEX,
106         /// Special characters "{}&#_%"
107         LM_TC_SPECIAL,
108         /// Internal code for operators
109         LM_TC_BOP,
110         /// Internal code for symbols
111         LM_TC_SYMB,
112         ///
113         LM_TC_BOPS,
114         ///
115         LM_TC_BSYM,
116         ///
117         LM_FONT_END,
118         
119         /// This must be < 32 
120         LM_TC_MAX
121 };
122
123 ///
124 std::ostream & operator<<(std::ostream &, MathedTextCodes mtc);
125
126
127 /// Types of lyx-math insets 
128 enum MathedInsetTypes  {
129         ///
130         LM_OT_MIN = 0,
131         /// A simple paragraph
132         LM_OT_PAR,
133         /// A simple numbered paragraph
134         LM_OT_PARN,
135         /// A multiline paragraph
136         LM_OT_MPAR,
137         /// A multiline numbered paragraph
138         LM_OT_MPARN,
139         ///
140         LM_OT_ALIGN,
141         ///
142         LM_OT_ALIGNN,
143         ///
144         LM_OT_ALIGNAT,
145         ///
146         LM_OT_ALIGNATN,
147         ///
148         LM_OT_MULTLINE,
149         ///
150         LM_OT_MULTLINEN,
151         /// An array
152         LM_OT_MATRIX,
153
154         /// A big operator
155         LM_OT_BIGOP,
156         /// A LaTeX macro
157         LM_OT_UNDEF,
158         ///
159         LM_OT_FUNC,
160         ///
161         LM_OT_FUNCLIM,
162         ///
163         LM_OT_SCRIPT,
164         ///
165         LM_OT_SPACE,
166         ///
167         LM_OT_DOTS,
168         /// A fraction
169         LM_OT_FRAC,
170         ///
171         LM_OT_ATOP,
172         ///
173         LM_OT_STACKREL,
174         /// A radical
175         LM_OT_SQRT,
176         /// A delimiter
177         LM_OT_DELIM,
178         /// A decoration
179         LM_OT_DECO,
180         /// An accent
181         LM_OT_ACCENT,
182         ///
183         LM_OT_MACRO,
184         ///
185         LM_OT_MACRO_ARG,
186         ///
187         LM_OT_MAX
188 };
189
190
191 ///
192 enum MathedBinaryTypes {
193         ///
194         LMB_NONE = 0,
195         ///
196         LMB_RELATION,
197         ///
198         LMB_OPERATOR,
199         ///
200         LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
201 };
202
203
204 /// Paragraph permissions
205 enum MathedParFlag {
206         LMPF_BASIC = 0,
207         /// If false can use a non-standard size
208         LMPF_FIXED_SIZE = 1,
209         /// If true can insert newlines 
210         LMPF_ALLOW_CR  = 2,
211         /// If true can use tabs
212         LMPF_ALLOW_TAB = 4,
213         /// If true can insert new columns
214         LMPF_ALLOW_NEW_COL = 8,
215         /// Smaller than current size (frac)
216         LMPF_SMALLER = 16,
217         /// Script size (subscript, stackrel)
218         LMPF_SCRIPT = 32
219 };
220
221 #endif