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