]> git.lyx.org Git - lyx.git/blob - src/mathed/math_defs.h
fix pullArg when pressing <Delete> at the end of an cell
[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 constants  4
59         LM_TC_CONST,
60         /// Internal code for variables
61         LM_TC_VAR,
62         ///
63         LM_TC_RM,
64         ///
65         LM_TC_CAL,
66         ///
67         LM_TC_BF,
68         ///
69         LM_TC_SF,
70         ///
71         LM_TC_TT,
72         ///
73         LM_TC_IT,
74         ///
75         LM_TC_TEXTRM,
76         /// Math mode TeX characters ",;:{}"  20
77         LM_TC_TEX,
78         /// Special characters "{}&#_%"
79         LM_TC_SPECIAL,
80         /// Internal code for operators  22
81         LM_TC_BOP,
82         /// Internal code for symbols
83         LM_TC_SYMB,
84         ///
85         LM_TC_BOPS,
86         ///
87         LM_TC_BSYM,
88         ///
89         LM_FONT_END,
90         
91         /// This must be < 32 
92         LM_TC_MAX
93 };
94
95
96 /// Types of lyx-math insets 
97 enum MathInsetTypes  {
98         ///
99         LM_OT_SIMPLE = 0,
100         ///
101         LM_OT_EQUATION,
102         /// 
103         LM_OT_EQNARRAY,
104         ///
105         LM_OT_ALIGN,
106         ///
107         LM_OT_ALIGNAT,
108         ///
109         LM_OT_XALIGN,
110         ///
111         LM_OT_XXALIGN,
112         ///
113         LM_OT_MULTLINE,
114         /// An array
115         LM_OT_MATRIX,
116
117         /// A LaTeX macro
118         LM_OT_UNDEF,
119         ///
120         LM_OT_FUNC,
121         ///
122         LM_OT_FUNCLIM,
123         ///
124         LM_OT_MACRO,
125         ///
126         LM_OT_MAX
127 };
128
129
130 ///
131 enum MathBinaryTypes {
132         ///
133         LMB_NONE = 0,
134         ///
135         LMB_RELATION,
136         ///
137         LMB_OPERATOR,
138         ///
139         LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
140 };
141
142
143 /// Paragraph permissions
144 enum MathParFlag {
145         LMPF_BASIC = 0,
146         /// If false can use a non-standard size
147         LMPF_FIXED_SIZE = 1,
148         /// If true can insert newlines 
149         LMPF_ALLOW_CR  = 2,
150         /// If true can use tabs
151         LMPF_ALLOW_TAB = 4,
152         /// If true can insert new columns
153         LMPF_ALLOW_NEW_COL = 8,
154         /// Smaller than current size (frac)
155         LMPF_SMALLER = 16,
156         /// Script size (subscript, stackrel)
157         LMPF_SCRIPT = 32
158 };
159
160 #endif