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