xref: /AOO42X/main/sw/source/filter/inc/wwstyles.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
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 
24 /// @HTML
25 #ifndef WW_WWSTYLES_HXX
26 #define WW_WWSTYLES_HXX
27 
28 class String;       //yuck...
29 
30 #include <sal/types.h>
31 
32 namespace ww
33 {
34     enum sti
35     {
36         stiNormal = 0,                  // 0x0000
37         stiLev1 = 1,                    // 0x0001
38         stiLev2 = 2,                    // 0x0002
39         stiLev3 = 3,                    // 0x0003
40         stiLev4 = 4,                    // 0x0004
41         stiLev5 = 5,                    // 0x0005
42         stiLev6 = 6,                    // 0x0006
43         stiLev7 = 7,                    // 0x0007
44         stiLev8 = 8,                    // 0x0008
45         stiLev9 = 9,                    // 0x0009
46         stiLevFirst = stiLev1,
47         stiLevLast = stiLev9,
48         stiIndex1 = 10,                 // 0x000A
49         stiIndex2 = 11,                 // 0x000B
50         stiIndex3 = 12,                 // 0x000C
51         stiIndex4 = 13,                 // 0x000D
52         stiIndex5 = 14,                 // 0x000E
53         stiIndex6 = 15,                 // 0x000F
54         stiIndex7 = 16,                 // 0x0010
55         stiIndex8 = 17,                 // 0x0011
56         stiIndex9 = 18,                 // 0x0012
57         stiIndexFirst = stiIndex1,
58         stiIndexLast = stiIndex9,
59         stiToc1 = 19,                   // 0x0013
60         stiToc2 = 20,                   // 0x0014
61         stiToc3 = 21,                   // 0x0015
62         stiToc4 = 22,                   // 0x0016
63         stiToc5 = 23,                   // 0x0017
64         stiToc6 = 24,                   // 0x0018
65         stiToc7 = 25,                   // 0x0019
66         stiToc8 = 26,                   // 0x001A
67         stiToc9 = 27,                   // 0x001B
68         stiTocFirst = stiToc1,
69         stiTocLast = stiToc9,
70         stiNormIndent = 28,             // 0x001C
71         stiFtnText = 29,                // 0x001D
72         stiAtnText = 30,                // 0x001E
73         stiHeader = 31,                 // 0x001F
74         stiFooter = 32,                 // 0x0020
75         stiIndexHeading = 33,           // 0x0021
76         stiCaption = 34,                // 0x0022
77         stiToCaption = 35,              // 0x0023
78         stiEnvAddr = 36,                // 0x0024
79         stiEnvRet = 37,                 // 0x0025
80         stiFtnRef = 38,                 // 0x0026  char style
81         stiAtnRef = 39,                 // 0x0027  char style
82         stiLnn = 40,                    // 0x0028  char style
83         stiPgn = 41,                    // 0x0029  char style
84         stiEdnRef = 42,                 // 0x002A  char style
85         stiEdnText = 43,                // 0x002B
86         stiToa = 44,                    // 0x002C
87         stiMacro = 45,                  // 0x002D
88         stiToaHeading = 46,             // 0x002E
89         stiList = 47,                   // 0x002F
90         stiListBullet = 48,             // 0x0030
91         stiListNumber = 49,             // 0x0031
92         stiList2 = 50,                  // 0x0032
93         stiList3 = 51,                  // 0x0033
94         stiList4 = 52,                  // 0x0034
95         stiList5 = 53,                  // 0x0035
96         stiListBullet2 = 54,            // 0x0036
97         stiListBullet3 = 55,            // 0x0037
98         stiListBullet4 = 56,            // 0x0038
99         stiListBullet5 = 57,            // 0x0039
100         stiListNumber2 = 58,            // 0x003A
101         stiListNumber3 = 59,            // 0x003B
102         stiListNumber4 = 60,            // 0x003C
103         stiListNumber5 = 61,            // 0x003D
104         stiTitle = 62,                  // 0x003E
105         stiClosing = 63,                // 0x003F
106         stiSignature = 64,              // 0x0040
107         stiNormalChar = 65,             // 0x0041  char style
108         stiBodyText = 66,               // 0x0042
109         /*
110          stiBodyTextInd1 was orig stiBodyText2 in documentation, but that
111          collides with the other stiBodyText2 and this seems more reasonable.
112          cmc@openoffice.org
113         */
114         stiBodyTextInd1 = 67,           // 0x0043
115         stiListCont = 68,               // 0x0044
116         stiListCont2 = 69,              // 0x0045
117         stiListCont3 = 70,              // 0x0046
118         stiListCont4 = 71,              // 0x0047
119         stiListCont5 = 72,              // 0x0048
120         stiMsgHeader = 73,              // 0x0049
121         stiSubtitle = 74,               // 0x004A
122         stiSalutation = 75,             // 0x004B
123         stiDate = 76,                   // 0X004C
124         stiBodyText1I = 77,             // 0x004D
125         stiBodyText1I2 = 78,            // 0x004E
126         stiNoteHeading = 79,            // 0x004F
127         stiBodyText2 = 80,              // 0x0050
128         stiBodyText3 = 81,              // 0x0051
129         stiBodyTextInd2 = 82,           // 0x0052
130         stiBodyTextInd3 = 83,           // 0x0053
131         stiBlockQuote = 84,             // 0x0054
132         stiHyperlink = 85,              // 0x0055  char style
133         stiHyperlinkFollowed = 86,      // 0x0056  char style
134         stiStrong = 87,                 // 0x0057  char style
135         stiEmphasis = 88,               // 0x0058  char style
136         stiNavPane = 89,                // 0x0059  char style
137         stiPlainText = 90,              // 0x005A
138         stiMax = 91,                    // number of defined sti's
139         stiUser = 0x0ffe,               // user styles are distinguished by name
140         stiNil = 0x0fff                 // max for 12 bits
141     };
142 
143     /** Find the WinWord sti index of an english style name.
144 
145         When importing a RTF document we would like to treat styles as similar
146         to how word does as possible, to this end word will treat some styles
147         with special names as inbuilt styles, and some as user defined styles.
148 
149         See OpenOffice.org issue 21881
150         (http://www.openoffice.org/issues/show_bug.cgi?id=21881)
151         and OpenOffice.org issue 17503
152         (http://www.openoffice.org/issues/show_bug.cgi?id=17503)
153 
154         @param
155         rSting the Style name to test to see what winword sti word would give
156         such a name if it has no other information to work with (e.g. importing
157         a RTF document)
158 
159         @return the sti that word would give it. stiUser if word would treat
160         it as a user defined style.
161 
162         @author
163         <a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
164         <a href="mailto:tono@openoffice.org">Takashi Ono</a>
165     */
166     sti GetCanonicalStiFromEnglishName(const String &rString) throw();
167 
168     /** Find the WinWord sti index of an old <= Word2 stc (style code)
169 
170         When importing a Word 2 document we would like to treat styles as
171         similar to how word 8 does as possible, to this end word will treat
172         some styles with special codes as inbuilt styles, and some as user
173         defined styles.
174 
175         @param
176         stc the Style code to test to see what winword sti word would give
177         such a code
178 
179         @return the sti that word would give it. stiUser if word would treat
180         it as a user defined style.
181 
182         @author
183         <a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
184     */
185     sti GetCanonicalStiFromStc(sal_uInt8 stc) throw();
186 
187     /** Find the WinWord english name from a sti index
188 
189         Map the word style index to it's english name
190 
191         @param
192         sti the Style index
193 
194         @return the name word would give it if it's an inbuilt name, otherwise
195         NULL
196 
197         @author
198         <a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
199     */
200     const sal_Char* GetEnglishNameFromSti(sti eSti) throw();
201 
202     /** Determine if the WinWord sti is standard Character Style
203 
204         @param
205         sti the Style index
206 
207         @return true if a known inbuild character style
208 
209         @author
210         <a href="mailto:cmc@openoffice.org">Caol&aacute;n McNamara</a>
211     */
212     bool StandardStiIsCharStyle(sti eSti) throw();
213 } // namespace ww
214 
215 #endif
216 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
217