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