]> git.lyx.org Git - lyx.git/blob - src/mathed/math_defs.h
use stream-like syntax for LaTeX output
[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, Math & 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
28 /// Standard Math Sizes (Math mode styles)
29 enum MathStyles {
30         ///
31         LM_ST_DISPLAY = 0,
32         ///
33         LM_ST_TEXT,
34         ///
35         LM_ST_SCRIPT,
36         ///
37         LM_ST_SCRIPTSCRIPT
38 };
39
40 // decrease math size for super- and subscripts
41 MathStyles smallerStyleScript(MathStyles);
42
43 // decrease math size for fractions
44 MathStyles smallerStyleFrac(MathStyles st);
45
46
47
48 /** The restrictions of a standard LaTeX math paragraph
49   allows to get a small number of text codes (<30) */
50 enum MathTextCodes  {
51         /// This must be >= 0
52         LM_TC_MIN = 0,
53         /// Math Inset
54         LM_TC_INSET,
55
56         ///
57         LM_FONT_BEGIN,
58         /// Internal code for variables
59         LM_TC_VAR,
60         ///
61         LM_TC_CONST,
62         ///
63         LM_TC_RM,
64         ///
65         LM_TC_CAL,
66         ///
67         LM_TC_BF,
68         //
69         LM_TC_BB,
70         ///
71         LM_TC_SF,
72         ///
73         LM_TC_TT,
74         ///
75         LM_TC_IT,
76         ///
77         LM_TC_TEXTRM,
78         /// Math mode TeX characters ",;:{}"  
79         LM_TC_TEX,
80         /// Internal code when typing greek
81         LM_TC_GREEK,
82         /// Internal code when typing a single greek character
83         LM_TC_GREEK1,
84         /// Internal code for symbols
85         LM_TC_SYMB,
86         /// internal code for symbols that get bigger in displayed math
87         LM_TC_BOLDSYMB,
88         ///
89         LM_TC_CMR,
90         ///
91         LM_TC_CMSY,
92         ///
93         LM_TC_CMM,
94         ///
95         LM_TC_CMEX,
96         ///
97         LM_TC_MSA,
98         ///
99         LM_TC_MSB,
100         ///
101         LM_FONT_END,
102         
103         /// This must be < 32 
104         LM_TC_MAX
105 };
106
107
108 /// Types of lyx-math insets 
109 enum MathInsetTypes  {
110         ///
111         LM_OT_SIMPLE = 0,
112         ///
113         LM_OT_EQUATION,
114         /// 
115         LM_OT_EQNARRAY,
116         ///
117         LM_OT_ALIGN,
118         ///
119         LM_OT_ALIGNAT,
120         ///
121         LM_OT_XALIGNAT,
122         ///
123         LM_OT_XXALIGNAT,
124         ///
125         LM_OT_MULTLINE,
126         ///
127         LM_OT_GATHER,
128         /// An array
129         LM_OT_MATRIX,
130
131         /// A LaTeX macro
132         LM_OT_UNDEF,
133         ///
134         LM_OT_FUNCLIM,
135         ///
136         LM_OT_MACRO,
137         ///
138         LM_OT_MAX
139 };
140
141
142 ///
143 enum MathSymbolTypes {
144         ///
145         LMB_NONE = 0,
146         ///
147         LMB_RELATION,
148         ///
149         LMB_OPERATOR,
150         ///
151         LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
152 };
153
154
155 /// Paragraph permissions
156 enum MathParFlag {
157         LMPF_BASIC = 0,
158         /// If false can use a non-standard size
159         LMPF_FIXED_SIZE = 1,
160         /// If true can insert newlines 
161         LMPF_ALLOW_CR  = 2,
162         /// If true can use tabs
163         LMPF_ALLOW_TAB = 4,
164         /// If true can insert new columns
165         LMPF_ALLOW_NEW_COL = 8,
166         /// Smaller than current size (frac)
167         LMPF_SMALLER = 16,
168         /// Script size (subscript, stackrel)
169         LMPF_SCRIPT = 32
170 };
171
172 #endif