1 /* This file is part of the Calligra Suite project 2 Copyright (C) 2011 Matus Uzak <matus.uzak@ixonos.com> 3 4 This library is free software; you can redistribute it and/or 5 modify it under the terms of the Library GNU General Public 6 version 2 of the License, or (at your option) version 3 or, 7 at the discretion of KDE e.V (which shall act as a proxy as in 8 section 14 of the GPLv3), any later version.. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public License 16 along with this library; see the file COPYING.LIB. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef MSDOC_H 22 #define MSDOC_H 23 24 /** 25 * Standard sti codes - invariant identifiers for built-in styles, which MUST 26 * remain the same (i.e. don't renumber them, or old files will be messed up.) 27 * NOTE: sti and istd are the same for Normal and level styles 28 * 29 * If you want to define a new built-in style: 30 * 1) Decide if you really need one--it will exist in all future versions! 31 * 2) Add a new sti below. You can take the first available slot. 32 * 3) Change stiMax, and stiPapMax or stiChpMax 33 * 4) Add entry to _dnsti, and the two ids's in strman.pp 34 * 5) Add case in GetDefaultUpdForSti 35 * 6) Change cstiMaxBuiltinDependents if necessary 36 * 37 * If you want to change the definition of a built-in style 38 * 1) In order to make WinWord 2 documents that use the style look like they 39 * did in WinWord 2, add a case in GetDefaultUpdForSti to handle fOldDef. 40 * This definition will be used when converting WinWord 2 stylesheets. 41 * 2) If you change the name of a built-in style, increment nVerBuiltInNames 42 * 43 * SRC: wv2/src/generator/generator_wword8.htm 44 */ 45 46 #define stiNormal 0 // 0x0000 Default paragraph style 47 48 #define stiLev1 1 // 0x0001 49 #define stiLev2 2 // 0x0002 50 #define stiLev3 3 // 0x0003 51 #define stiLev4 4 // 0x0004 52 #define stiLev5 5 // 0x0005 53 #define stiLev6 6 // 0x0006 54 #define stiLev7 7 // 0x0007 55 #define stiLev8 8 // 0x0008 56 #define stiLev9 9 // 0x0009 57 #define stiLevFirst stiLev1 58 #define stiLevLast stiLev9 59 60 #define stiIndex1 10 // 0x000A 61 #define stiIndex2 11 // 0x000B 62 #define stiIndex3 12 // 0x000C 63 #define stiIndex4 13 // 0x000D 64 #define stiIndex5 14 // 0x000E 65 #define stiIndex6 15 // 0x000F 66 #define stiIndex7 16 // 0x0010 67 #define stiIndex8 17 // 0x0011 68 #define stiIndex9 18 // 0x0012 69 #define stiIndexFirst stiIndex1 70 #define stiIndexLast stiIndex9 71 72 #define stiToc1 19 // 0x0013 73 #define stiToc2 20 // 0x0014 74 #define stiToc3 21 // 0x0015 75 #define stiToc4 22 // 0x0016 76 #define stiToc5 23 // 0x0017 77 #define stiToc6 24 // 0x0018 78 #define stiToc7 25 // 0x0019 79 #define stiToc8 26 // 0x001A 80 #define stiToc9 27 // 0x001B 81 #define stiTocFirst stiToc1 82 #define stiTocLast stiToc9 83 84 #define stiNormIndent 28 // 0x001C 85 #define stiFtnText 29 // 0x001D 86 #define stiAtnText 30 // 0x001E 87 #define stiHeader 31 // 0x001F 88 #define stiFooter 32 // 0x0020 89 #define stiIndexHeading 33 // 0x0021 90 #define stiCaption 34 // 0x0022 91 #define stiToCaption 35 // 0x0023 92 #define stiEnvAddr 36 // 0x0024 93 #define stiEnvRet 37 // 0x0025 94 #define stiFtnRef 38 // 0x0026 char style 95 #define stiAtnRef 39 // 0x0027 char style 96 #define stiLnn 40 // 0x0028 char style 97 #define stiPgn 41 // 0x0029 char style 98 #define stiEdnRef 42 // 0x002A char style 99 #define stiEdnText 43 // 0x002B 100 #define stiToa 44 // 0x002C 101 #define stiMacro 45 // 0x002D 102 #define stiToaHeading 46 // 0x002E 103 #define stiList 47 // 0x002F 104 #define stiListBullet 48 // 0x0030 105 #define stiListNumber 49 // 0x0031 106 #define stiList2 50 // 0x0032 107 #define stiList3 51 // 0x0033 108 #define stiList4 52 // 0x0034 109 #define stiList5 53 // 0x0035 110 #define stiListBullet2 54 // 0x0036 111 #define stiListBullet3 55 // 0x0037 112 #define stiListBullet4 56 // 0x0038 113 #define stiListBullet5 57 // 0x0039 114 #define stiListNumber2 58 // 0x003A 115 #define stiListNumber3 59 // 0x003B 116 #define stiListNumber4 60 // 0x003C 117 #define stiListNumber5 61 // 0x003D 118 #define stiTitle 62 // 0x003E 119 #define stiClosing 63 // 0x003F 120 #define stiSignature 64 // 0x0040 121 #define stiNormalChar 65 // 0x0041 Default char style 122 #define stiBodyText 66 // 0x0042 123 #define stiBodyText2 67 // 0x0043 124 #define stiListCont 68 // 0x0044 125 #define stiListCont2 69 // 0x0045 126 #define stiListCont3 70 // 0x0046 127 #define stiListCont4 71 // 0x0047 128 #define stiListCont5 72 // 0x0048 129 #define stiMsgHeader 73 // 0x0049 130 #define stiSubtitle 74 // 0x004A 131 #define stiSalutation 75 // 0x004B 132 #define stiDate 76 // 0X004C 133 #define stiBodyText1I 77 // 0x004D 134 #define stiBodyText1I2 78 // 0x004E 135 #define stiNoteHeading 79 // 0x004F 136 /* #define stiBodyText2 80 // 0x0050 */ 137 #define stiBodyText3 81 // 0x0051 138 #define stiBodyTextInd2 82 // 0x0052 139 #define stiBodyTextInd3 83 // 0x0053 140 #define stiBlockQuote 84 // 0x0054 141 #define stiHyperlink 85 // 0x0055 char style 142 #define stiHyperlinkFollowed 86 // 0x0056 char style 143 #define stiStrong 87 // 0x0057 char style 144 #define stiEmphasis 88 // 0x0058 char style 145 #define stiNavPane 89 // 0x0059 char style 146 #define stiPlainText 90 // 0x005A 147 #define stiMax 91 // number of defined sti's 148 149 #define stiUser 0x0ffe // user styles are distinguished by name 150 #define stiNil 0x0fff // max for 12 bits 151 152 /** 153 * Specifies the version number of the file format used. Superseded by 154 * FibRgCswNew.nFibNew if it is present. 155 */ 156 enum nFib 157 { 158 Word2nFib = 0x0063, 159 Word6nFib = 0x0065, 160 Word7nFib = 0x0067, //also 0x0068 161 Word8nFib = 0x00c1, 162 Word8nFib0 = 0x00c0, 163 Word8nFib2 = 0x00c2, 164 Word2knFib = 0x00D9, 165 Word2k2nFib = 0x0101, 166 Word2k3nFib = 0x010c, //also 0x10b 167 Word2k7nFib = 0x0112 168 }; 169 170 /** 171 * Specifies the location from which the offset of a page border is measured. 172 * [MS-DOC] — v20101219 173 */ 174 enum PgbOffsetFrom 175 { 176 pgbFromText = 0x0, //offset measured from the text 177 pgbFromEdge //offset measured from the edge of the page 178 }; 179 180 /** 181 * An unsigned integer that specifies the type of border. Values that are 182 * larger than 0x1B are not valid unless they describe a page border, in which 183 * case they can be a value in the range of 0x40 to 0xE3, inclusive. 184 * [MS-DOC] — v20101219 185 */ 186 enum BrcType 187 { 188 BorderNone, // 0x00 No border. 189 BorderSingle, // 0x01 A single line. 190 BorderDouble = 0x03, // 0x03 A double line. 191 BorderThin = 0x05, // 0x05 A thin single solid line. 192 BorderDotted, // 0x06 A dotted border. 193 BorderDashed, // 0x07 A dashed border with large gaps between the dashes. 194 BorderDotDash, // 0x08 A border of alternating dots and dashes. 195 BorderDotDotDash, // 0x09 A border of alternating sets of two dots and one dash. 196 BorderTriple, // 0x0A A triple line border. 197 BorderThinThickSmallGap, // 0x0B A thin outer border and a thick inner border with a small gap between them. 198 BorderThickThinSmallGap, // 0x0C A thin outer border and thick inner border with a small gap between them. 199 BorderThinThickThinSmallGap, // 0x0D A thin outer border, a thick middle border, and a thin inner border with a small gap between them. 200 BorderThinThickMediumGap, // 0x0E A thin outer border and a thick inner border with a medium gap between them. 201 BorderThickThinMediumGap, // 0x0F A thin outer border and a thick inner border and a medium gap between them. 202 BorderThinThickThinMediumGap,// 0x10 A thin outer border, a thick middle border, and a thin inner border with a medium gaps between them. 203 BorderThinThickLargeGap, // 0x11 A thick outer border and a thin inner border with a large gap between them. 204 BorderThickThinLargeGap, // 0x12 A thin outer border and a thick inner border with a large gap between them. 205 BorderThinThickThinLargeGap, // 0x13 A thin outer border, a thick middle border, and a thin inner border with large gaps between them. 206 BorderWave, // 0x14 A single wavy line. 207 BorderDoubleWave, // 0x15 A double wavy line. 208 BorderDashSmallGap, // 0x16 A dashed border with small gaps between the dashes. 209 BorderDashDotStroked, // 0x17 A border consisting of alternating groups of 5 and 1 thin diagonal lines. 210 BorderThreeDEmboss, // 0x18 A thin light gray outer border, a thick medium gray middle border, and a thin black inner border with no gaps between them. 211 BorderThreeDEngrave, // 0x19 A thin black outer border, a thick medium gray middle border, and a thin light gray inner border with no gaps between them. 212 BorderOutset, // 0x1A A thin light gray outer border and a thin medium gray inner border with a large gap between them. 213 BorderInset, // 0x1B A thin medium gray outer border and a thin light gray inner border with a large gap between them. 214 // 0x40 - 0xE3 An image border. 215 BorderNil = 0xFF // 0xFF This MUST be ignored. 216 }; 217 218 /** 219 * Specifies the type of the section break that is being described. 220 * [MS-DOC] — v20101219 221 */ 222 enum SBkcOperand 223 { 224 bkcContinuous = 0x00, 225 bkcNewColumn, 226 bkcNewPage, 227 bkcEvenPage, 228 bkcOddPage 229 }; 230 231 /** 232 * The Ipat enumeration is an index to a shading pattern. [MS-DOC] — v20101219 233 */ 234 enum IPAT 235 { 236 ipatAuto, //0x0000 Clear, ST_Shd: clear 237 ipatSolid, //0x0001 Solid, ST_Shd: solid 238 ipatPct5, //0x0002 5%, ST_Shd: pct5 239 ipatPct10, //0x0003 10%, ST_Shd: pct10 240 ipatPct20, //0x0004 20%, ST_Shd: pct20 241 ipatPct25, //0x0005 25%, ST_Shd: pct25 242 ipatPct30, //0x0006 30%, ST_Shd: pct30 243 ipatPct40, //0x0007 40%, ST_Shd: pct40 244 ipatPct50, //0x0008 50%, ST_Shd: pct50 245 ipatPct60, //0x0009 60%, ST_Shd: pct60 246 ipatPct70, //0x000A 70%, ST_Shd: pct70 247 ipatPct75, //0x000B 75%, ST_Shd: pct75 248 ipatPct80, //0x000C 80%, ST_Shd: pct80 249 ipatPct90, //0x000D 90%, ST_Shd: pct90 250 ipatDkHorizontal, //0x000E Horizontal Stripe, ST_Shd: horzStripe 251 ipatDkVertical, //0x000F Vertical Stripe, ST_Shd: vertStripe 252 ipatDkForeDiag, //0x0010 Reverse Diagonal Stripe, ST_Shd: reverseDiagStripe 253 ipatDkBackDiag, //0x0011 Diagonal Stripe, ST_Shd: diagStripe 254 ipatDkCross, //0x0012 Horizontal Cross, ST_Shd: horzCross 255 ipatDkDiagCross, //0x0013 Diagonal Cross, ST_Shd: diagCross 256 ipatHorizontal, //0x0014 Thin Horizontal Stripe, ST_Shd: thinHorzStripe 257 ipatVertical, //0x0015 Thin Vertical Stripe, ST_Shd: thinVertStripe 258 ipatForeDiag, //0x0016 Thin Reverse Diagonal Stripe, ST_Shd: thinReverseDiagStripe 259 ipatBackDiag, //0x0017 Thin Diagonal Stripe, ST_Shd: thinDiagStripe 260 ipatCross, //0x0018 Thin Horizontal Cross, ST_Shd: thinHorzCross 261 ipatDiagCross, //0x0019 Thin Diagonal Cross, ST_Shd: thinDiagCross 262 ipatPctNew2 = 0x0023, //0x0023 2.5% fill pattern 263 ipatPctNew7, //0x0024 7.5% fill pattern 264 ipatPctNew12, //0x0025 12.5%, ST_Shd: pct12 265 ipatPctNew15, //0x0026 15%, ST_Shd: pct15 266 ipatPctNew17, //0x0027 17.5% fill pattern 267 ipatPctNew22, //0x0028 22.5% fill pattern 268 ipatPctNew27, //0x0029 27.5% fill pattern 269 ipatPctNew32, //0x002A 32.5% fill pattern 270 ipatPctNew35, //0x002B 35%, ST_Shd: pct35 271 ipatPctNew37, //0x002C 37.5%, ST_Shd: pct37 272 ipatPctNew42, //0x002D 42.5% fill pattern 273 ipatPctNew45, //0x002E 45%, ST_Shd: pct45 274 ipatPctNew47, //0x002F 47.5% fill pattern 275 ipatPctNew52, //0x0030 52.5% fill pattern 276 ipatPctNew55, //0x0031 55%, ST_Shd: pct55 277 ipatPctNew57, //0x0032 57.5% fill pattern 278 ipatPctNew62, //0x0033 62.5%, ST_Shd: pct62 279 ipatPctNew65, //0x0034 65%, ST_Shd: pct65 280 ipatPctNew67, //0x0035 67.5% fill pattern 281 ipatPctNew72, //0x0036 72.5% fill pattern 282 ipatPctNew77, //0x0037 77.5% fill pattern 283 ipatPctNew82, //0x0038 82.5% fill pattern 284 ipatPctNew85, //0x0039 85%, ST_Shd: pct85 285 ipatPctNew87, //0x003A 87.5%, ST_Shd: pct87 286 ipatPctNew92, //0x003B 92.5% fill pattern 287 ipatPctNew95, //0x003C 95%, ST_Shd: pct95 288 ipatPctNew97, //0x003D 97.5% fill pattern 289 ipatNil = 0xFFFF //0xFFFF Nil, ST_Shd: nil 290 }; 291 292 /** 293 * The Kul enumeration specifies the style of underlining for text. [MS-DOC] — 294 * v20101219 295 */ 296 enum KUL 297 { 298 kulNone, //0x00 No underlining. 299 kulSingle, //0x01 Normal single underline. 300 kulWords, //0x02 Underline words only. 301 kulDouble, //0x03 Double underline. 302 kulDotted, //0x04 Dotted underline. 303 kulThick = 0x06, //0x06 Heavy underline. 304 kulDash, //0x07 Dashed underline. 305 kulDotDash = 0x09, //0x09 Dot-dash underline. 306 kulDotDotDash, //0x0A Dot-dot-dash underline. 307 kulWavy, //0x0B Wavy underline. 308 kulDottedHeavy = 0x14, //0x14 Heavy dotted underline. 309 kulDashHeavy = 0x17, //0x17 Heavy dashed underline. 310 kulDotDashHeavy = 0x19, //0x19 Heavy dot-dash underline. 311 kulDotDotDashHeavy, //0x1A Heavy dot-dot-dash underline. 312 kulWavyHeavy, //0x1B Heavy wavy underline. 313 kulDashLong = 0x27, //0x27 Long-dash underline. 314 kulWavyDouble = 0x2B, //0x2B Wavy double underline. 315 kulDashLongHeavy = 0x37 //0x37 Heavy long-dash underline. 316 }; 317 318 /** 319 * Specifies the list of numbering formats that can be used for a group of 320 * automatically numbered objects. [MS-OSHARED] — v20101219 321 */ 322 enum MSONFC 323 { 324 msonfcArabic = 0x00, //decimal 325 msonfcUCRoman, //upperRoman 326 msonfcLCRoman, //lowerRoman 327 msonfcUCLetter, //upperLetter 328 msonfcLCLetter, //lowerLetter 329 msonfcOrdinal, //ordinal 330 msonfcCardtext, //cardinalText 331 msonfcOrdtext, //ordinalText 332 msonfcHex, //hex 333 msonfcChiManSty, //chicago 334 msonfcDbNum1, //ideographDigital 335 msonfcDbNum2, //japaneseCounting 336 msonfcAiueo, //Aiueo 337 msonfcIroha, //Iroha 338 msonfcDbChar, //decimalFullWidth 339 msonfcSbChar, //decimalHalfWidth 340 msonfcDbNum3 = 0x10, //japaneseLegal 341 msonfcDbNum4, //japaneseDigitalTenThousand 342 msonfcCirclenum, //decimalEnclosedCircle 343 msonfcDArabic, //decimalFullWidth2 344 msonfcDAiueo, //aiueoFullWidth 345 msonfcDIroha, //irohaFullWidth 346 msonfcArabicLZ, //decimalZero 347 msonfcBullet, //bullet 348 msonfcGanada, //ganada 349 msonfcChosung, //chosung 350 msonfcGB1, //decimalEnclosedFullstop 351 msonfcGB2, //decimalEnclosedParen 352 msonfcGB3, //decimalEnclosedCircleChinese 353 msonfcGB4, //ideographEnclosedCircle 354 msonfcZodiac1, //ideographTraditional 355 msonfcZodiac2, //ideographZodiac 356 msonfcZodiac3 = 0x20,//ideographZodiacTraditional 357 msonfcTpeDbNum1, //taiwaneseCounting 358 msonfcTpeDbNum2, //ideographLegalTraditional 359 msonfcTpeDbNum3, //taiwaneseCountingThousand 360 msonfcTpeDbNum4, //taiwaneseDigital 361 msonfcChnDbNum1, //chineseCounting 362 msonfcChnDbNum2, //chineseLegalSimplified 363 msonfcChnDbNum3, //chineseCountingThousand 364 msonfcChnDbNum4, //decimal 365 msonfcKorDbNum1, //koreanDigital 366 msonfcKorDbNum2, //koreanCounting 367 msonfcKorDbNum3, //koreanLegal 368 msonfcKorDbNum4, //koreanDigital2 369 msonfcHebrew1, //hebrew1 370 msonfcArabic1, //arabicAlpha 371 msonfcHebrew2, //hebrew2 372 msonfcArabic2 = 0x30,//arabicAbjad 373 msonfcHindi1, //hindiVowels 374 msonfcHindi2, //hindiConsonants 375 msonfcHindi3, //hindiNumbers 376 msonfcHindi4, //hindiCounting 377 msonfcThai1, //thaiLetters 378 msonfcThai2, //thaiNumbers 379 msonfcThai3, //thaiCounting 380 msonfcViet1, //vietnameseCounting 381 msonfcNumInDash, //numberInDash 382 msonfcLCRus, //russianLower 383 msonfcUCRus, //russianUpper 384 msonfcNone = 0xFF //Specifies that the sequence will not display any numbering 385 }; 386 387 /** 388 * Specifies the Style Type. 389 * [ECMA-376] 390 */ 391 enum ST_StyleType 392 { 393 sgcUnknown = 0, 394 sgcPara = 1, //Paragraph style 395 sgcChp = 2, //Character style 396 sgcTbl = 3, //Table style 397 sgcNmbr = 4 //Numbering style 398 }; 399 400 /** 401 * Specifies the type of alignment which is applied to the text that 402 * is entered at the tab stop. 403 */ 404 enum TabJC { 405 jcLeft, //Left justification. 406 jcCenter, //Center justification. 407 jcRight, //Right justification. 408 jcDecimal, //[1] 409 jcBar, //Specifies that the current tab is a bar tab. 410 jcList = 0x6 //Specifies that the current tab is a list tab. 411 }; 412 413 //specifies the characters that are used to fill in the space which is created 414 //by a tab that ends at a custom tab stop. 415 enum TabLC { 416 tlcNone, //No leader. 417 tlcDot, //Dot leader. 418 tlcHyphen, //Dashed leader. 419 tlcUnderscore, //Underscore leader. 420 tlcHeavy, //Same as tlcUnderscore. 421 tlcMiddleDot, //Centered dot leader. 422 tlcDefault = 0x7 //Same as tlcNone. 423 }; 424 425 /* 426 [1] - Specifies that the current tab stop results in a location in 427 the document at which all following text is aligned around the first 428 decimal separator in the following text runs. If there is no 429 decimal separator, text is aligned around the implicit decimal 430 separator after the last digit of the first numeric value that 431 appears in the following text. All text runs before the first 432 decimal character appear before the tab stop; all text runs after it 433 appear after the tab stop location. */ 434 435 /* 436 * --------------------------------------------------- 437 * Following enumeration are not defined in [MS-DOC] 438 * --------------------------------------------------- 439 */ 440 441 /** 442 * The HALIGN enumeration specifies horizontal alignment. 443 */ 444 enum HALIGN 445 { 446 hAlignLeft = 0x0, 447 hAlignCenter = 0x1, 448 hAlignRight = 0x2 449 }; 450 451 /** 452 * The VALIGN enumeration specifies vertical alignment. 453 */ 454 enum VALIGN 455 { 456 vAlignTop = 0x0, 457 vAlignMiddle = 0x1, 458 vAlignBottom = 0x2 459 }; 460 461 #endif 462