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