xref: /trunk/main/starmath/inc/types.hxx (revision f6a9d5ca)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef TYPES_HXX
24 #define TYPES_HXX
25 
26 #include <sal/types.h>
27 #include <tools/debug.hxx>
28 
29 #define FONTNAME_MATH   "OpenSymbol"
30 
31 /////////////////////////////////////////////////////////////////
32 
33 enum SmPrintSize { PRINT_SIZE_NORMAL, PRINT_SIZE_SCALED, PRINT_SIZE_ZOOMED };
34 
35 /////////////////////////////////////////////////////////////////
36 
37 #define FONT_ARIAL          "Arial"
38 #define FONT_SYMBOL         "Symbol"
39 #define FONT_MS_PMINCHO     "MS PMincho"
40 #define FONT_MS_PGOTHIC     "MS PGothic"
41 #define FONT_SUN_BATANG     "SunBatang"
42 
43 
IsInPrivateUseArea(sal_Unicode cChar)44 inline sal_Bool IsInPrivateUseArea( sal_Unicode cChar ) { return 0xE000 <= cChar  &&  cChar <= 0xF8FF; }
45 
46 // Greek char range as seen in svx/.../charmap.cxx RID_SUBSETSTR_BASIC_GREEK
IsGreekChar(sal_Unicode cChar)47 inline sal_Bool IsGreekChar( sal_Unicode cChar ) { return 0x0370 <= cChar  &&  cChar <= 0x03FF; }
48 
49 sal_Unicode ConvertMathPrivateUseAreaToUnicode( sal_Unicode cChar );
50 
51 sal_Unicode ConvertMathToMathML( sal_Unicode cChar );
52 
53 /////////////////////////////////////////////////////////////////
54 // enum definitions for characters from the 'StarSymbol' font
55 // (some chars have more than one alias!)
56 //! Note: not listed here does not(!) mean "not used"
57 //!		(see %alpha ... %gamma for example)
58 //
59 enum MathSymbol
60 {
61     MS_FACT         = (sal_Unicode) 0x0021,
62     MS_INFINITY     = (sal_Unicode) 0x221E,
63     MS_SLASH        = (sal_Unicode) 0x002F,
64 
65     MS_NDIVIDES     = (sal_Unicode) 0x2224,
66     MS_DRARROW      = (sal_Unicode) 0x21D2,
67     MS_DLARROW      = (sal_Unicode) 0x21D0,
68     MS_DLRARROW     = (sal_Unicode) 0x21D4,
69     MS_OVERBRACE    = (sal_Unicode) 0x23DE,
70     MS_UNDERBRACE   = (sal_Unicode) 0x23DF,
71     MS_CIRC         = (sal_Unicode) 0x2218,
72     MS_ASSIGN       = (sal_Unicode) 0x003D,
73     MS_ERROR        = (sal_Unicode) 0x00BF,
74 
75     MS_NEQ          = (sal_Unicode) 0x2260,
76     MS_PLUS         = (sal_Unicode) 0x002B,
77     MS_MINUS        = (sal_Unicode) 0x2212,
78     MS_MULTIPLY     = (sal_Unicode) 0x2217,
79     MS_TIMES        = (sal_Unicode) 0x00D7,
80     MS_CDOT         = (sal_Unicode) 0x22C5,
81     MS_DIV          = (sal_Unicode) 0x00F7,
82     MS_PLUSMINUS    = (sal_Unicode) 0x00B1,
83     MS_MINUSPLUS    = (sal_Unicode) 0x2213,
84     MS_OPLUS        = (sal_Unicode) 0x2295,
85     MS_OMINUS       = (sal_Unicode) 0x2296,
86     MS_OTIMES       = (sal_Unicode) 0x2297,
87     MS_ODIVIDE      = (sal_Unicode) 0x2298,
88     MS_ODOT         = (sal_Unicode) 0x2299,
89     MS_UNION        = (sal_Unicode) 0x222A,
90     MS_INTERSECT    = (sal_Unicode) 0x2229,
91 
92     MS_LT           = (sal_Unicode) 0x003C,
93     MS_GT           = (sal_Unicode) 0x003E,
94     MS_LE           = (sal_Unicode) 0x2264,
95     MS_GE           = (sal_Unicode) 0x2265,
96     MS_LESLANT      = (sal_Unicode) 0x2A7D,
97     MS_GESLANT      = (sal_Unicode) 0x2A7E,
98     MS_LL           = (sal_Unicode) 0x226A,
99     MS_GG           = (sal_Unicode) 0x226B,
100     MS_SIM          = (sal_Unicode) 0x223C,
101     MS_SIMEQ        = (sal_Unicode) 0x2243,
102     MS_APPROX       = (sal_Unicode) 0x2248,
103     MS_DEF          = (sal_Unicode) 0x225D,
104     MS_EQUIV        = (sal_Unicode) 0x2261,
105     MS_PROP         = (sal_Unicode) 0x221D,
106     MS_PARTIAL      = (sal_Unicode) 0x2202,
107 
108     MS_SUBSET       = (sal_Unicode) 0x2282,
109     MS_SUPSET       = (sal_Unicode) 0x2283,
110     MS_SUBSETEQ     = (sal_Unicode) 0x2286,
111     MS_SUPSETEQ     = (sal_Unicode) 0x2287,
112     MS_NSUBSET      = (sal_Unicode) 0x2284,
113     MS_NSUPSET      = (sal_Unicode) 0x2285,
114     MS_NSUBSETEQ    = (sal_Unicode) 0x2288,
115     MS_NSUPSETEQ    = (sal_Unicode) 0x2289,
116     MS_IN           = (sal_Unicode) 0x2208,
117     MS_NOTIN        = (sal_Unicode) 0x2209,
118     MS_EXISTS       = (sal_Unicode) 0x2203,
119     MS_BACKEPSILON  = (sal_Unicode) 0x220D,
120     MS_ALEPH        = (sal_Unicode) 0x2135,
121     MS_IM           = (sal_Unicode) 0x2111,
122     MS_RE           = (sal_Unicode) 0x211C,
123     MS_WP           = (sal_Unicode) 0x2118,
124 
125     MS_LINE         = (sal_Unicode) 0x2223,
126     MS_DLINE        = (sal_Unicode) 0x2225,
127     MS_ORTHO        = (sal_Unicode) 0x22A5,
128     MS_DOTSLOW      = (sal_Unicode) 0x2026,
129     MS_DOTSAXIS     = (sal_Unicode) 0x22EF,
130     MS_DOTSVERT     = (sal_Unicode) 0x22EE,
131     MS_DOTSUP       = (sal_Unicode) 0x22F0,
132     MS_DOTSDOWN     = (sal_Unicode) 0x22F1,
133     MS_TRANSR       = (sal_Unicode) 0x22B6,
134     MS_TRANSL       = (sal_Unicode) 0x22B7,
135     MS_BACKSLASH    = (sal_Unicode) 0x2216,
136     MS_NEG          = (sal_Unicode) 0x00AC,
137 
138     MS_FORALL       = (sal_Unicode) 0x2200,
139     MS_NABLA        = (sal_Unicode) 0x2207,
140     MS_PROD         = (sal_Unicode) 0x220F,
141     MS_COPROD       = (sal_Unicode) 0x2210,
142     MS_SUM          = (sal_Unicode) 0x2211,
143     MS_SQRT         = (sal_Unicode) 0x221A,
144     MS_INT          = (sal_Unicode) 0x222B,
145     MS_IINT         = (sal_Unicode) 0x222C,
146     MS_IIINT        = (sal_Unicode) 0x222D,
147     MS_LINT         = (sal_Unicode) 0x222E,
148     MS_LLINT        = (sal_Unicode) 0x222F,
149     MS_LLLINT       = (sal_Unicode) 0x2230,
150 
151     MS_GRAVE        = (sal_Unicode) 0x0300,
152     MS_ACUTE        = (sal_Unicode) 0x0301,
153     MS_HAT          = (sal_Unicode) 0x0302,
154     MS_TILDE        = (sal_Unicode) 0x0303,
155     MS_BAR          = (sal_Unicode) 0x0304,
156     MS_BREVE        = (sal_Unicode) 0x0306,
157     MS_CIRCLE       = (sal_Unicode) 0x030A,
158     MS_CHECK        = (sal_Unicode) 0x030C,
159     MS_VEC          = (sal_Unicode) 0x20D7,
160     MS_DOT          = (sal_Unicode) 0x02D9,
161     MS_DDOT         = (sal_Unicode) 0x00A8,
162     MS_DDDOT        = (sal_Unicode) 0x20DB,
163     MS_AND          = (sal_Unicode) 0x2227,
164     MS_OR           = (sal_Unicode) 0x2228,
165     MS_NI           = (sal_Unicode) 0x220B,
166     MS_EMPTYSET     = (sal_Unicode) 0x2205,
167 
168     MS_LPARENT      = (sal_Unicode) 0x0028,
169     MS_RPARENT      = (sal_Unicode) 0x0029,
170     MS_LBRACKET     = (sal_Unicode) 0x005B,
171     MS_RBRACKET     = (sal_Unicode) 0x005D,
172     MS_LBRACE       = (sal_Unicode) 0x007B,
173     MS_RBRACE       = (sal_Unicode) 0x007D,
174     MS_LCEIL        = (sal_Unicode) 0x2308,
175     MS_RCEIL        = (sal_Unicode) 0x2309,
176     MS_LFLOOR       = (sal_Unicode) 0x230A,
177     MS_RFLOOR       = (sal_Unicode) 0x230B,
178     MS_LANGLE       = (sal_Unicode) 0x2329,
179     MS_RANGLE       = (sal_Unicode) 0x232A,
180     MS_LDBRACKET    = (sal_Unicode) 0x27E6,
181     MS_RDBRACKET    = (sal_Unicode) 0x27E7,
182 
183     MS_PLACE        = (sal_Unicode) 0x2751,
184 
185     MS_LAMBDABAR    = (sal_Unicode) 0x019B,
186     MS_HBAR         = (sal_Unicode) 0x210F,
187     MS_LEFTARROW    = (sal_Unicode) 0x2190,
188     MS_UPARROW      = (sal_Unicode) 0x2191,
189     MS_RIGHTARROW   = (sal_Unicode) 0x2192,
190     MS_DOWNARROW    = (sal_Unicode) 0x2193,
191     MS_SETN         = (sal_Unicode) 0x2115,
192     MS_SETZ         = (sal_Unicode) 0x2124,
193     MS_SETQ         = (sal_Unicode) 0x211A,
194     MS_SETR         = (sal_Unicode) 0x211D,
195     MS_SETC         = (sal_Unicode) 0x2102
196 };
197 
198 
199 #endif
200 
201