]> git.lyx.org Git - lyx.git/blob - src/mathed/math_defs.h
use anon namespace, somewhat better comp. handling of minipages, not quite there yet
[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 namespace {
44
45 ///
46 int const MATH_COLSEP = 8;
47 ///
48 int const MATH_ROWSEP = 8;
49
50 } // namespace anon
51
52
53 /// Standard Math Sizes (Math mode styles)
54 enum MathedStyles {
55         ///
56         LM_ST_DISPLAY = 0,
57         ///
58         LM_ST_TEXT,
59         ///
60         LM_ST_SCRIPT,
61         ///
62         LM_ST_SCRIPTSCRIPT
63 };
64
65
66 /** The restrictions of a standard LaTeX math paragraph
67   allows to get a small number of text codes (<30) */
68 enum MathedTextCodes  {
69         /// This must be >= 0
70         LM_TC_MIN = 0,
71         /// Open and Close group
72         LM_TC_OPEN,
73         ///
74         LM_TC_CLOSE,
75         /// Tabulator
76         LM_TC_TAB,
77         /// New line
78         LM_TC_CR,
79         /// Math Inset
80         LM_TC_INSET,
81         /// Super and sub scripts
82         LM_TC_UP,
83         ///
84         LM_TC_DOWN,
85         /// Editable Math Inset
86         LM_TC_ACTIVE_INSET,
87         /// Editable Text Inset
88         LM_TC_TEXT_INSET,
89         ///
90         LM_FONT_BEGIN,
91         /// Internal code for constants
92         LM_TC_CONST,
93         /// Internal code for variables
94         LM_TC_VAR,
95         ///
96         LM_TC_RM,
97         ///
98         LM_TC_CAL,
99         ///
100         LM_TC_BF,
101         ///
102         LM_TC_SF,
103         ///
104         LM_TC_TT,
105         ///
106         LM_TC_IT,
107         ///
108         LM_TC_TEXTRM,
109         /// Math mode TeX characters ",;:{}"
110         LM_TC_TEX,
111         /// Special characters "{}&#_%"
112         LM_TC_SPECIAL,
113         /// Internal code for operators
114         LM_TC_BOP,
115         /// Internal code for symbols
116         LM_TC_SYMB,
117         ///
118         LM_TC_BOPS,
119         ///
120         LM_TC_BSYM,
121         ///
122         LM_FONT_END,
123         
124         /// This must be < 32 
125         LM_TC_MAX
126 };
127
128 /// Defined in math_macro.C
129 std::ostream & operator<<(std::ostream &, MathedTextCodes mtc);
130
131
132 /// Types of lyx-math insets 
133 enum MathedInsetTypes  {
134         ///
135         LM_OT_MIN = 0,
136         /// A simple paragraph
137         LM_OT_PAR,
138         /// A simple numbered paragraph
139         LM_OT_PARN,
140         /// A multiline paragraph
141         LM_OT_MPAR,
142         /// A multiline numbered paragraph
143         LM_OT_MPARN,
144         ///
145         LM_OT_ALIGN,
146         ///
147         LM_OT_ALIGNN,
148         ///
149         LM_OT_ALIGNAT,
150         ///
151         LM_OT_ALIGNATN,
152         ///
153         LM_OT_MULTLINE,
154         ///
155         LM_OT_MULTLINEN,
156         /// An array
157         LM_OT_MATRIX,
158
159         /// A big operator
160         LM_OT_BIGOP,
161         /// A LaTeX macro
162         LM_OT_UNDEF,
163         ///
164         LM_OT_FUNC,
165         ///
166         LM_OT_FUNCLIM,
167         ///
168         LM_OT_SCRIPT,
169         ///
170         LM_OT_SPACE,
171         ///
172         LM_OT_DOTS,
173         /// A fraction
174         LM_OT_FRAC,
175         ///
176         LM_OT_ATOP,
177         ///
178         LM_OT_STACKREL,
179         /// A radical
180         LM_OT_SQRT,
181         /// A delimiter
182         LM_OT_DELIM,
183         /// A decoration
184         LM_OT_DECO,
185         /// An accent
186         LM_OT_ACCENT,
187         ///
188         LM_OT_MACRO,
189         ///
190         LM_OT_MACRO_ARG,
191         ///
192         LM_OT_MAX
193 };
194
195
196 ///
197 enum MathedBinaryTypes {
198         ///
199         LMB_NONE = 0,
200         ///
201         LMB_RELATION,
202         ///
203         LMB_OPERATOR,
204         ///
205         LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
206 };
207
208
209 /// Paragraph permissions
210 enum MathedParFlag {
211         LMPF_BASIC = 0,
212         /// If false can use a non-standard size
213         LMPF_FIXED_SIZE = 1,
214         /// If true can insert newlines 
215         LMPF_ALLOW_CR  = 2,
216         /// If true can use tabs
217         LMPF_ALLOW_TAB = 4,
218         /// If true can insert new columns
219         LMPF_ALLOW_NEW_COL = 8,
220         /// Smaller than current size (frac)
221         LMPF_SMALLER = 16,
222         /// Script size (subscript, stackrel)
223         LMPF_SCRIPT = 32
224 };
225
226 #endif