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 #ifndef SW_TOX_HXX 28*cdf0e10cSrcweir #define SW_TOX_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <cppuhelper/weakref.hxx> 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include <i18npool/lang.h> 33*cdf0e10cSrcweir #include <tools/string.hxx> 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir #include <editeng/svxenum.hxx> 36*cdf0e10cSrcweir #include <svl/svarray.hxx> 37*cdf0e10cSrcweir #include <svl/poolitem.hxx> 38*cdf0e10cSrcweir #include "swdllapi.h" 39*cdf0e10cSrcweir #include <swtypes.hxx> 40*cdf0e10cSrcweir #include <toxe.hxx> 41*cdf0e10cSrcweir #include <calbck.hxx> 42*cdf0e10cSrcweir #include <errhdl.hxx> 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir #ifndef INCLUDED_VECTOR 45*cdf0e10cSrcweir #include <vector> // #i21237# 46*cdf0e10cSrcweir #define INCLUDED_VECTOR 47*cdf0e10cSrcweir #endif 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 51*cdf0e10cSrcweir namespace text { class XDocumentIndexMark; } 52*cdf0e10cSrcweir } } } 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir class SwTOXType; 55*cdf0e10cSrcweir class SwTOXMark; 56*cdf0e10cSrcweir class SwTxtTOXMark; 57*cdf0e10cSrcweir class SwDoc; 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0, 10) 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir /*-------------------------------------------------------------------- 62*cdf0e10cSrcweir Description: Entry of content index, alphabetical index or user defined index 63*cdf0e10cSrcweir --------------------------------------------------------------------*/ 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir #define IVER_TOXMARK_STRPOOL ((sal_uInt16)1) 66*cdf0e10cSrcweir #define IVER_TOXMARK_NEWTOX ((sal_uInt16)2) 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir class SW_DLLPUBLIC SwTOXMark 69*cdf0e10cSrcweir : public SfxPoolItem 70*cdf0e10cSrcweir , public SwModify 71*cdf0e10cSrcweir { 72*cdf0e10cSrcweir friend void _InitCore(); 73*cdf0e10cSrcweir friend class SwTxtTOXMark; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir String aAltText; // Der Text des Eintrages ist unterschiedlich 76*cdf0e10cSrcweir String aPrimaryKey, aSecondaryKey; 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir // three more strings for phonetic sorting 79*cdf0e10cSrcweir String aTextReading; 80*cdf0e10cSrcweir String aPrimaryKeyReading; 81*cdf0e10cSrcweir String aSecondaryKeyReading; 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir SwTxtTOXMark* pTxtAttr; 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir sal_uInt16 nLevel; 86*cdf0e10cSrcweir sal_Bool bAutoGenerated : 1; // generated using a concordance file 87*cdf0e10cSrcweir sal_Bool bMainEntry : 1; // main entry emphasized by character style 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir ::com::sun::star::uno::WeakReference< 90*cdf0e10cSrcweir ::com::sun::star::text::XDocumentIndexMark> m_wXDocumentIndexMark; 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir SwTOXMark(); // to create the dflt. atr. in _InitCore 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir protected: 95*cdf0e10cSrcweir // SwClient 96*cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ); 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir public: 99*cdf0e10cSrcweir TYPEINFO(); // rtti 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir // single argument ctors shall be explicit. 102*cdf0e10cSrcweir explicit SwTOXMark( const SwTOXType* pTyp ); 103*cdf0e10cSrcweir virtual ~SwTOXMark(); 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir SwTOXMark( const SwTOXMark& rCopy ); 106*cdf0e10cSrcweir SwTOXMark& operator=( const SwTOXMark& rCopy ); 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir // "pure virtual methods" of SfxPoolItem 109*cdf0e10cSrcweir virtual int operator==( const SfxPoolItem& ) const; 110*cdf0e10cSrcweir virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir void InvalidateTOXMark(); 113*cdf0e10cSrcweir 114*cdf0e10cSrcweir String GetText() const; 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir inline sal_Bool IsAlternativeText() const; 117*cdf0e10cSrcweir inline const String& GetAlternativeText() const; 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir inline void SetAlternativeText( const String& rAlt ); 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir // content or user defined index 122*cdf0e10cSrcweir inline void SetLevel(sal_uInt16 nLevel); 123*cdf0e10cSrcweir inline sal_uInt16 GetLevel() const; 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir // for alphabetical index only 126*cdf0e10cSrcweir inline void SetPrimaryKey(const String& rStr ); 127*cdf0e10cSrcweir inline void SetSecondaryKey(const String& rStr); 128*cdf0e10cSrcweir inline void SetTextReading(const String& rStr); 129*cdf0e10cSrcweir inline void SetPrimaryKeyReading(const String& rStr ); 130*cdf0e10cSrcweir inline void SetSecondaryKeyReading(const String& rStr); 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir inline const String& GetPrimaryKey() const; 133*cdf0e10cSrcweir inline const String& GetSecondaryKey() const; 134*cdf0e10cSrcweir inline const String& GetTextReading() const; 135*cdf0e10cSrcweir inline const String& GetPrimaryKeyReading() const; 136*cdf0e10cSrcweir inline const String& GetSecondaryKeyReading() const; 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir sal_Bool IsAutoGenerated() const {return bAutoGenerated;} 139*cdf0e10cSrcweir void SetAutoGenerated(sal_Bool bSet) {bAutoGenerated = bSet;} 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir sal_Bool IsMainEntry() const {return bMainEntry;} 142*cdf0e10cSrcweir void SetMainEntry(sal_Bool bSet) { bMainEntry = bSet;} 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir inline const SwTOXType* GetTOXType() const; 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; } 147*cdf0e10cSrcweir SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; } 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< 150*cdf0e10cSrcweir ::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const 151*cdf0e10cSrcweir { return m_wXDocumentIndexMark; } 152*cdf0e10cSrcweir SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference< 153*cdf0e10cSrcweir ::com::sun::star::text::XDocumentIndexMark> const& xMark) 154*cdf0e10cSrcweir { m_wXDocumentIndexMark = xMark; } 155*cdf0e10cSrcweir void DeRegister() { GetRegisteredInNonConst()->Remove( this ); } 156*cdf0e10cSrcweir void RegisterToTOXType( SwTOXType& rMark ); 157*cdf0e10cSrcweir static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType ); 158*cdf0e10cSrcweir }; 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir /*-------------------------------------------------------------------- 161*cdf0e10cSrcweir Description: index types 162*cdf0e10cSrcweir --------------------------------------------------------------------*/ 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir class SwTOXType : public SwModify 165*cdf0e10cSrcweir { 166*cdf0e10cSrcweir public: 167*cdf0e10cSrcweir SwTOXType(TOXTypes eTyp, const String& aName); 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir // @@@ public copy ctor, but no copy assignment? 170*cdf0e10cSrcweir SwTOXType(const SwTOXType& rCopy); 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir inline const String& GetTypeName() const; 173*cdf0e10cSrcweir inline TOXTypes GetType() const; 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir private: 176*cdf0e10cSrcweir String aName; 177*cdf0e10cSrcweir TOXTypes eType; 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir // @@@ public copy ctor, but no copy assignment? 180*cdf0e10cSrcweir SwTOXType & operator= (const SwTOXType &); 181*cdf0e10cSrcweir }; 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir /*-------------------------------------------------------------------- 184*cdf0e10cSrcweir Description: Structure of the index lines 185*cdf0e10cSrcweir --------------------------------------------------------------------*/ 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir #define FORM_TITLE 0 188*cdf0e10cSrcweir #define FORM_ALPHA_DELIMITTER 1 189*cdf0e10cSrcweir #define FORM_PRIMARY_KEY 2 190*cdf0e10cSrcweir #define FORM_SECONDARY_KEY 3 191*cdf0e10cSrcweir #define FORM_ENTRY 4 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir /* 194*cdf0e10cSrcweir Pattern structure 195*cdf0e10cSrcweir 196*cdf0e10cSrcweir <E#> - entry number <E# CharStyleName,PoolId> 197*cdf0e10cSrcweir <ET> - entry text <ET CharStyleName,PoolId> 198*cdf0e10cSrcweir <E> - entry text and number <E CharStyleName,PoolId> 199*cdf0e10cSrcweir <T> - tab stop <T,,Position,Adjust> 200*cdf0e10cSrcweir <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId> 201*cdf0e10cSrcweir <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER> 202*cdf0e10cSrcweir <#> - Page number <# CharStyleName,PoolId> 203*cdf0e10cSrcweir <LS> - Link start <LS> 204*cdf0e10cSrcweir <LE> - Link end <LE> 205*cdf0e10cSrcweir <A00> - Authority entry field <A02 CharStyleName, PoolId> 206*cdf0e10cSrcweir */ 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir // These enum values are stored and must not be changed! 209*cdf0e10cSrcweir enum FormTokenType 210*cdf0e10cSrcweir { 211*cdf0e10cSrcweir TOKEN_ENTRY_NO, 212*cdf0e10cSrcweir TOKEN_ENTRY_TEXT, 213*cdf0e10cSrcweir TOKEN_ENTRY, 214*cdf0e10cSrcweir TOKEN_TAB_STOP, 215*cdf0e10cSrcweir TOKEN_TEXT, 216*cdf0e10cSrcweir TOKEN_PAGE_NUMS, 217*cdf0e10cSrcweir TOKEN_CHAPTER_INFO, 218*cdf0e10cSrcweir TOKEN_LINK_START, 219*cdf0e10cSrcweir TOKEN_LINK_END, 220*cdf0e10cSrcweir TOKEN_AUTHORITY, 221*cdf0e10cSrcweir TOKEN_END 222*cdf0e10cSrcweir }; 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir struct SW_DLLPUBLIC SwFormToken 225*cdf0e10cSrcweir { 226*cdf0e10cSrcweir String sText; 227*cdf0e10cSrcweir String sCharStyleName; 228*cdf0e10cSrcweir SwTwips nTabStopPosition; 229*cdf0e10cSrcweir FormTokenType eTokenType; 230*cdf0e10cSrcweir sal_uInt16 nPoolId; 231*cdf0e10cSrcweir SvxTabAdjust eTabAlign; 232*cdf0e10cSrcweir sal_uInt16 nChapterFormat; //SwChapterFormat; 233*cdf0e10cSrcweir sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering 234*cdf0e10cSrcweir sal_uInt16 nAuthorityField; //enum ToxAuthorityField 235*cdf0e10cSrcweir sal_Unicode cTabFillChar; 236*cdf0e10cSrcweir sal_Bool bWithTab; // sal_True: do generate tab 237*cdf0e10cSrcweir // character only the tab stop 238*cdf0e10cSrcweir // #i21237# 239*cdf0e10cSrcweir 240*cdf0e10cSrcweir SwFormToken(FormTokenType eType ) : 241*cdf0e10cSrcweir nTabStopPosition(0), 242*cdf0e10cSrcweir eTokenType(eType), 243*cdf0e10cSrcweir nPoolId(USHRT_MAX), 244*cdf0e10cSrcweir eTabAlign( SVX_TAB_ADJUST_LEFT ), 245*cdf0e10cSrcweir nChapterFormat(0 /*CF_NUMBER*/), 246*cdf0e10cSrcweir nOutlineLevel(MAXLEVEL), //default to maximum outline level 247*cdf0e10cSrcweir nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/), 248*cdf0e10cSrcweir cTabFillChar(' '), 249*cdf0e10cSrcweir bWithTab(sal_True) // #i21237# 250*cdf0e10cSrcweir {} 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir String GetString() const; 253*cdf0e10cSrcweir }; 254*cdf0e10cSrcweir 255*cdf0e10cSrcweir // -> #i21237# 256*cdf0e10cSrcweir /** 257*cdf0e10cSrcweir Functor that is true when a given token has a certain token type. 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir @param _eType the type to check for 260*cdf0e10cSrcweir @param rToken the token to check 261*cdf0e10cSrcweir 262*cdf0e10cSrcweir @retval sal_True the token has the given type 263*cdf0e10cSrcweir @retval sal_False else 264*cdf0e10cSrcweir */ 265*cdf0e10cSrcweir struct SwFormTokenEqualToFormTokenType 266*cdf0e10cSrcweir { 267*cdf0e10cSrcweir FormTokenType eType; 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {} 270*cdf0e10cSrcweir bool operator()(const SwFormToken & rToken) 271*cdf0e10cSrcweir { 272*cdf0e10cSrcweir return rToken.eTokenType == eType; 273*cdf0e10cSrcweir } 274*cdf0e10cSrcweir }; 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir /** 277*cdf0e10cSrcweir Functor that appends the string representation of a given token to a string. 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir @param _rText string to append the string representation to 280*cdf0e10cSrcweir @param rToken token whose string representation is appended 281*cdf0e10cSrcweir */ 282*cdf0e10cSrcweir struct SwFormTokenToString 283*cdf0e10cSrcweir { 284*cdf0e10cSrcweir String & rText; 285*cdf0e10cSrcweir SwFormTokenToString(String & _rText) : rText(_rText) {} 286*cdf0e10cSrcweir void operator()(const SwFormToken & rToken) { rText += rToken.GetString(); } 287*cdf0e10cSrcweir }; 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir /// Vector of tokens. 290*cdf0e10cSrcweir typedef std::vector<SwFormToken> SwFormTokens; 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir /** 293*cdf0e10cSrcweir Helper class that converts vectors of tokens to strings and vice 294*cdf0e10cSrcweir versa. 295*cdf0e10cSrcweir */ 296*cdf0e10cSrcweir class SW_DLLPUBLIC SwFormTokensHelper 297*cdf0e10cSrcweir { 298*cdf0e10cSrcweir /// the tokens 299*cdf0e10cSrcweir SwFormTokens aTokens; 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir /** 302*cdf0e10cSrcweir Builds a token from its string representation. 303*cdf0e10cSrcweir 304*cdf0e10cSrcweir @sPattern the whole pattern 305*cdf0e10cSrcweir @nCurPatternPos starting position of the token 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir @return the token 308*cdf0e10cSrcweir */ 309*cdf0e10cSrcweir SW_DLLPRIVATE SwFormToken BuildToken( const String & sPattern, 310*cdf0e10cSrcweir xub_StrLen & nCurPatternPos ) const; 311*cdf0e10cSrcweir 312*cdf0e10cSrcweir /** 313*cdf0e10cSrcweir Returns the string of a token. 314*cdf0e10cSrcweir 315*cdf0e10cSrcweir @param sPattern the whole pattern 316*cdf0e10cSrcweir @param nStt starting position of the token 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir @return the string representation of the token 319*cdf0e10cSrcweir */ 320*cdf0e10cSrcweir SW_DLLPRIVATE String SearchNextToken( const String & sPattern, 321*cdf0e10cSrcweir xub_StrLen nStt ) const; 322*cdf0e10cSrcweir 323*cdf0e10cSrcweir /** 324*cdf0e10cSrcweir Returns the type of a token. 325*cdf0e10cSrcweir 326*cdf0e10cSrcweir @param sToken the string representation of the token 327*cdf0e10cSrcweir @param pTokenLen return parameter the length of the head of the token 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir If pTokenLen is non-NULL the length of the token's head is 330*cdf0e10cSrcweir written to *pTokenLen 331*cdf0e10cSrcweir 332*cdf0e10cSrcweir @return the type of the token 333*cdf0e10cSrcweir */ 334*cdf0e10cSrcweir SW_DLLPRIVATE FormTokenType GetTokenType(const String & sToken, 335*cdf0e10cSrcweir xub_StrLen * pTokenLen) const; 336*cdf0e10cSrcweir 337*cdf0e10cSrcweir public: 338*cdf0e10cSrcweir /** 339*cdf0e10cSrcweir contructor 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir @param rTokens vector of tokens 342*cdf0e10cSrcweir */ 343*cdf0e10cSrcweir SwFormTokensHelper(const SwFormTokens & rTokens) : aTokens(rTokens) {} 344*cdf0e10cSrcweir 345*cdf0e10cSrcweir /** 346*cdf0e10cSrcweir constructor 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir @param rStr string representation of the tokens 349*cdf0e10cSrcweir */ 350*cdf0e10cSrcweir SwFormTokensHelper(const String & rStr); 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir /** 353*cdf0e10cSrcweir Returns vector of tokens. 354*cdf0e10cSrcweir 355*cdf0e10cSrcweir @return vector of tokens 356*cdf0e10cSrcweir */ 357*cdf0e10cSrcweir const SwFormTokens & GetTokens() const { return aTokens; } 358*cdf0e10cSrcweir }; 359*cdf0e10cSrcweir // <- #i21237# 360*cdf0e10cSrcweir 361*cdf0e10cSrcweir class SW_DLLPUBLIC SwForm 362*cdf0e10cSrcweir { 363*cdf0e10cSrcweir SwFormTokens aPattern[ AUTH_TYPE_END + 1 ]; // #i21237# 364*cdf0e10cSrcweir String aTemplate[ AUTH_TYPE_END + 1 ]; 365*cdf0e10cSrcweir 366*cdf0e10cSrcweir TOXTypes eType; 367*cdf0e10cSrcweir sal_uInt16 nFormMaxLevel; 368*cdf0e10cSrcweir 369*cdf0e10cSrcweir //sal_uInt16 nFirstTabPos; -> Value in tab token 370*cdf0e10cSrcweir // sal_Bool bHasFirstTabPos : 1; 371*cdf0e10cSrcweir sal_Bool bGenerateTabPos : 1; 372*cdf0e10cSrcweir sal_Bool bIsRelTabPos : 1; 373*cdf0e10cSrcweir sal_Bool bCommaSeparated : 1; 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir public: 376*cdf0e10cSrcweir SwForm( TOXTypes eTOXType = TOX_CONTENT ); 377*cdf0e10cSrcweir SwForm( const SwForm& rForm ); 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir SwForm& operator=( const SwForm& rForm ); 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir inline void SetTemplate(sal_uInt16 nLevel, const String& rName); 382*cdf0e10cSrcweir inline const String& GetTemplate(sal_uInt16 nLevel) const; 383*cdf0e10cSrcweir 384*cdf0e10cSrcweir // #i21237# 385*cdf0e10cSrcweir void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName); 386*cdf0e10cSrcweir void SetPattern(sal_uInt16 nLevel, const String& rStr); 387*cdf0e10cSrcweir const SwFormTokens& GetPattern(sal_uInt16 nLevel) const; 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir // fill tab stop positions from template to pattern 390*cdf0e10cSrcweir // #i21237# 391*cdf0e10cSrcweir void AdjustTabStops(SwDoc& rDoc, 392*cdf0e10cSrcweir sal_Bool bInsertNewTabStops = sal_False); 393*cdf0e10cSrcweir 394*cdf0e10cSrcweir inline TOXTypes GetTOXType() const; 395*cdf0e10cSrcweir inline sal_uInt16 GetFormMax() const; 396*cdf0e10cSrcweir 397*cdf0e10cSrcweir sal_Bool IsRelTabPos() const { return bIsRelTabPos; } 398*cdf0e10cSrcweir void SetRelTabPos( sal_Bool b ) { bIsRelTabPos = b; } 399*cdf0e10cSrcweir 400*cdf0e10cSrcweir sal_Bool IsCommaSeparated() const { return bCommaSeparated;} 401*cdf0e10cSrcweir void SetCommaSeparated( sal_Bool b) { bCommaSeparated = b;} 402*cdf0e10cSrcweir 403*cdf0e10cSrcweir static sal_uInt16 GetFormMaxLevel( TOXTypes eType ); 404*cdf0e10cSrcweir 405*cdf0e10cSrcweir static const sal_Char* aFormEntry; // <E> 406*cdf0e10cSrcweir static sal_uInt8 nFormEntryLen; // 3 characters 407*cdf0e10cSrcweir static const sal_Char* aFormTab; // <T> 408*cdf0e10cSrcweir static sal_uInt8 nFormTabLen; // 3 characters 409*cdf0e10cSrcweir static const sal_Char* aFormPageNums; // <P> 410*cdf0e10cSrcweir static sal_uInt8 nFormPageNumsLen; // 3 characters 411*cdf0e10cSrcweir static const sal_Char* aFormLinkStt; // <LS> 412*cdf0e10cSrcweir static sal_uInt8 nFormLinkSttLen; // 4 characters 413*cdf0e10cSrcweir static const sal_Char* aFormLinkEnd; // <LE> 414*cdf0e10cSrcweir static sal_uInt8 nFormLinkEndLen; // 4 characters 415*cdf0e10cSrcweir static const sal_Char* aFormEntryNum; // <E#> 416*cdf0e10cSrcweir static sal_uInt8 nFormEntryNumLen; // 4 characters 417*cdf0e10cSrcweir static const sal_Char* aFormEntryTxt; // <ET> 418*cdf0e10cSrcweir static sal_uInt8 nFormEntryTxtLen; // 4 characters 419*cdf0e10cSrcweir static const sal_Char* aFormChapterMark; // <C> 420*cdf0e10cSrcweir static sal_uInt8 nFormChapterMarkLen; // 3 characters 421*cdf0e10cSrcweir static const sal_Char* aFormText; // <TX> 422*cdf0e10cSrcweir static sal_uInt8 nFormTextLen; // 4 characters 423*cdf0e10cSrcweir static const sal_Char* aFormAuth; // <Axx> xx - decimal enum value 424*cdf0e10cSrcweir static sal_uInt8 nFormAuthLen; // 3 characters 425*cdf0e10cSrcweir }; 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir /*-------------------------------------------------------------------- 428*cdf0e10cSrcweir Description: Content to create indexes of 429*cdf0e10cSrcweir --------------------------------------------------------------------*/ 430*cdf0e10cSrcweir 431*cdf0e10cSrcweir typedef sal_uInt16 SwTOXElement; 432*cdf0e10cSrcweir namespace nsSwTOXElement 433*cdf0e10cSrcweir { 434*cdf0e10cSrcweir const SwTOXElement TOX_MARK = 1; 435*cdf0e10cSrcweir const SwTOXElement TOX_OUTLINELEVEL = 2; 436*cdf0e10cSrcweir const SwTOXElement TOX_TEMPLATE = 4; 437*cdf0e10cSrcweir const SwTOXElement TOX_OLE = 8; 438*cdf0e10cSrcweir const SwTOXElement TOX_TABLE = 16; 439*cdf0e10cSrcweir const SwTOXElement TOX_GRAPHIC = 32; 440*cdf0e10cSrcweir const SwTOXElement TOX_FRAME = 64; 441*cdf0e10cSrcweir const SwTOXElement TOX_SEQUENCE = 128; 442*cdf0e10cSrcweir } 443*cdf0e10cSrcweir 444*cdf0e10cSrcweir typedef sal_uInt16 SwTOIOptions; 445*cdf0e10cSrcweir namespace nsSwTOIOptions 446*cdf0e10cSrcweir { 447*cdf0e10cSrcweir const SwTOIOptions TOI_SAME_ENTRY = 1; 448*cdf0e10cSrcweir const SwTOIOptions TOI_FF = 2; 449*cdf0e10cSrcweir const SwTOIOptions TOI_CASE_SENSITIVE = 4; 450*cdf0e10cSrcweir const SwTOIOptions TOI_KEY_AS_ENTRY = 8; 451*cdf0e10cSrcweir const SwTOIOptions TOI_ALPHA_DELIMITTER = 16; 452*cdf0e10cSrcweir const SwTOIOptions TOI_DASH = 32; 453*cdf0e10cSrcweir const SwTOIOptions TOI_INITIAL_CAPS = 64; 454*cdf0e10cSrcweir } 455*cdf0e10cSrcweir 456*cdf0e10cSrcweir //which part of the caption is to be displayed 457*cdf0e10cSrcweir enum SwCaptionDisplay 458*cdf0e10cSrcweir { 459*cdf0e10cSrcweir CAPTION_COMPLETE, 460*cdf0e10cSrcweir CAPTION_NUMBER, 461*cdf0e10cSrcweir CAPTION_TEXT 462*cdf0e10cSrcweir }; 463*cdf0e10cSrcweir 464*cdf0e10cSrcweir typedef sal_uInt16 SwTOOElements; 465*cdf0e10cSrcweir namespace nsSwTOOElements 466*cdf0e10cSrcweir { 467*cdf0e10cSrcweir const SwTOOElements TOO_MATH = 0x01; 468*cdf0e10cSrcweir const SwTOOElements TOO_CHART = 0x02; 469*cdf0e10cSrcweir const SwTOOElements TOO_CALC = 0x08; 470*cdf0e10cSrcweir const SwTOOElements TOO_DRAW_IMPRESS = 0x10; 471*cdf0e10cSrcweir // const SwTOOElements TOO_IMPRESS = 0x20; 472*cdf0e10cSrcweir const SwTOOElements TOO_OTHER = 0x80; 473*cdf0e10cSrcweir } 474*cdf0e10cSrcweir 475*cdf0e10cSrcweir #define TOX_STYLE_DELIMITER ((sal_Unicode)0x01) //JP 19.07.00: use a control char 476*cdf0e10cSrcweir 477*cdf0e10cSrcweir /*-------------------------------------------------------------------- 478*cdf0e10cSrcweir Description: Class for all indexes 479*cdf0e10cSrcweir --------------------------------------------------------------------*/ 480*cdf0e10cSrcweir 481*cdf0e10cSrcweir class SW_DLLPUBLIC SwTOXBase : public SwClient 482*cdf0e10cSrcweir { 483*cdf0e10cSrcweir SwForm aForm; // description of the lines 484*cdf0e10cSrcweir String aName; // unique name 485*cdf0e10cSrcweir String aTitle; // title 486*cdf0e10cSrcweir 487*cdf0e10cSrcweir String sMainEntryCharStyle; // name of the character style applied to main index entries 488*cdf0e10cSrcweir 489*cdf0e10cSrcweir String aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER 490*cdf0e10cSrcweir String sSequenceName; // FieldTypeName of a caption sequence 491*cdf0e10cSrcweir 492*cdf0e10cSrcweir LanguageType eLanguage; 493*cdf0e10cSrcweir String sSortAlgorithm; 494*cdf0e10cSrcweir 495*cdf0e10cSrcweir union { 496*cdf0e10cSrcweir sal_uInt16 nLevel; // consider outline levels 497*cdf0e10cSrcweir sal_uInt16 nOptions; // options of alphabetical index 498*cdf0e10cSrcweir } aData; 499*cdf0e10cSrcweir 500*cdf0e10cSrcweir sal_uInt16 nCreateType; // sources to create the index from 501*cdf0e10cSrcweir sal_uInt16 nOLEOptions; // OLE sources 502*cdf0e10cSrcweir SwCaptionDisplay eCaptionDisplay; // 503*cdf0e10cSrcweir sal_Bool bProtected : 1; // index protected ? 504*cdf0e10cSrcweir sal_Bool bFromChapter : 1; // create from chapter or document 505*cdf0e10cSrcweir sal_Bool bFromObjectNames : 1; // create a table or object index 506*cdf0e10cSrcweir // from the names rather than the caption 507*cdf0e10cSrcweir sal_Bool bLevelFromChapter : 1; // User index: get the level from the source chapter 508*cdf0e10cSrcweir public: 509*cdf0e10cSrcweir SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm, 510*cdf0e10cSrcweir sal_uInt16 nCreaType, const String& rTitle ); 511*cdf0e10cSrcweir SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 ); 512*cdf0e10cSrcweir virtual ~SwTOXBase(); 513*cdf0e10cSrcweir 514*cdf0e10cSrcweir virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc. 517*cdf0e10cSrcweir // If not, so create it an copy all other used things. The return is this 518*cdf0e10cSrcweir SwTOXBase& CopyTOXBase( SwDoc*, const SwTOXBase& ); 519*cdf0e10cSrcweir 520*cdf0e10cSrcweir const SwTOXType* GetTOXType() const; // 521*cdf0e10cSrcweir 522*cdf0e10cSrcweir sal_uInt16 GetCreateType() const; // creation types 523*cdf0e10cSrcweir 524*cdf0e10cSrcweir const String& GetTOXName() const {return aName;} 525*cdf0e10cSrcweir void SetTOXName(const String& rSet) {aName = rSet;} 526*cdf0e10cSrcweir 527*cdf0e10cSrcweir const String& GetTitle() const; // Title 528*cdf0e10cSrcweir const String& GetTypeName() const; // Name 529*cdf0e10cSrcweir const SwForm& GetTOXForm() const; // description of the lines 530*cdf0e10cSrcweir 531*cdf0e10cSrcweir void SetCreate(sal_uInt16); 532*cdf0e10cSrcweir void SetTitle(const String& rTitle); 533*cdf0e10cSrcweir void SetTOXForm(const SwForm& rForm); 534*cdf0e10cSrcweir 535*cdf0e10cSrcweir TOXTypes GetType() const; 536*cdf0e10cSrcweir 537*cdf0e10cSrcweir const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;} 538*cdf0e10cSrcweir void SetMainEntryCharStyle(const String& rSet) {sMainEntryCharStyle = rSet;} 539*cdf0e10cSrcweir 540*cdf0e10cSrcweir // content index only 541*cdf0e10cSrcweir inline void SetLevel(sal_uInt16); // consider outline level 542*cdf0e10cSrcweir inline sal_uInt16 GetLevel() const; 543*cdf0e10cSrcweir 544*cdf0e10cSrcweir // alphabetical index only 545*cdf0e10cSrcweir inline sal_uInt16 GetOptions() const; // alphabetical index options 546*cdf0e10cSrcweir inline void SetOptions(sal_uInt16 nOpt); 547*cdf0e10cSrcweir 548*cdf0e10cSrcweir // index of objects 549*cdf0e10cSrcweir sal_uInt16 GetOLEOptions() const {return nOLEOptions;} 550*cdf0e10cSrcweir void SetOLEOptions(sal_uInt16 nOpt) {nOLEOptions = nOpt;} 551*cdf0e10cSrcweir 552*cdf0e10cSrcweir // index of objects 553*cdf0e10cSrcweir 554*cdf0e10cSrcweir // user defined index only 555*cdf0e10cSrcweir inline void SetTemplateName(const String& rName); // Absatzlayout beachten 556*cdf0e10cSrcweir 557*cdf0e10cSrcweir const String& GetStyleNames(sal_uInt16 nLevel) const 558*cdf0e10cSrcweir { 559*cdf0e10cSrcweir DBG_ASSERT( nLevel < MAXLEVEL, "Which level?"); 560*cdf0e10cSrcweir return aStyleNames[nLevel]; 561*cdf0e10cSrcweir } 562*cdf0e10cSrcweir void SetStyleNames(const String& rSet, sal_uInt16 nLevel) 563*cdf0e10cSrcweir { 564*cdf0e10cSrcweir DBG_ASSERT( nLevel < MAXLEVEL, "Which level?"); 565*cdf0e10cSrcweir aStyleNames[nLevel] = rSet; 566*cdf0e10cSrcweir } 567*cdf0e10cSrcweir sal_Bool IsFromChapter() const { return bFromChapter;} 568*cdf0e10cSrcweir void SetFromChapter(sal_Bool bSet) { bFromChapter = bSet;} 569*cdf0e10cSrcweir 570*cdf0e10cSrcweir sal_Bool IsFromObjectNames() const {return bFromObjectNames;} 571*cdf0e10cSrcweir void SetFromObjectNames(sal_Bool bSet) {bFromObjectNames = bSet;} 572*cdf0e10cSrcweir 573*cdf0e10cSrcweir sal_Bool IsLevelFromChapter() const {return bLevelFromChapter;} 574*cdf0e10cSrcweir void SetLevelFromChapter(sal_Bool bSet) {bLevelFromChapter = bSet;} 575*cdf0e10cSrcweir 576*cdf0e10cSrcweir sal_Bool IsProtected() const { return bProtected; } 577*cdf0e10cSrcweir void SetProtected(sal_Bool bSet) { bProtected = bSet; } 578*cdf0e10cSrcweir 579*cdf0e10cSrcweir const String& GetSequenceName() const {return sSequenceName;} 580*cdf0e10cSrcweir void SetSequenceName(const String& rSet) {sSequenceName = rSet;} 581*cdf0e10cSrcweir 582*cdf0e10cSrcweir SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;} 583*cdf0e10cSrcweir void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;} 584*cdf0e10cSrcweir 585*cdf0e10cSrcweir sal_Bool IsTOXBaseInReadonly() const; 586*cdf0e10cSrcweir 587*cdf0e10cSrcweir const SfxItemSet* GetAttrSet() const; 588*cdf0e10cSrcweir void SetAttrSet( const SfxItemSet& ); 589*cdf0e10cSrcweir 590*cdf0e10cSrcweir LanguageType GetLanguage() const {return eLanguage;} 591*cdf0e10cSrcweir void SetLanguage(LanguageType nLang) {eLanguage = nLang;} 592*cdf0e10cSrcweir 593*cdf0e10cSrcweir const String& GetSortAlgorithm()const {return sSortAlgorithm;} 594*cdf0e10cSrcweir void SetSortAlgorithm(const String& rSet) {sSortAlgorithm = rSet;} 595*cdf0e10cSrcweir // #i21237# 596*cdf0e10cSrcweir void AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop); 597*cdf0e10cSrcweir SwTOXBase& operator=(const SwTOXBase& rSource); 598*cdf0e10cSrcweir void RegisterToTOXType( SwTOXType& rMark ); 599*cdf0e10cSrcweir }; 600*cdf0e10cSrcweir 601*cdf0e10cSrcweir 602*cdf0e10cSrcweir /*-------------------------------------------------------------------- 603*cdf0e10cSrcweir Description: Inlines 604*cdf0e10cSrcweir --------------------------------------------------------------------*/ 605*cdf0e10cSrcweir 606*cdf0e10cSrcweir // 607*cdf0e10cSrcweir //SwTOXMark 608*cdf0e10cSrcweir // 609*cdf0e10cSrcweir inline const String& SwTOXMark::GetAlternativeText() const 610*cdf0e10cSrcweir { return aAltText; } 611*cdf0e10cSrcweir 612*cdf0e10cSrcweir inline const SwTOXType* SwTOXMark::GetTOXType() const 613*cdf0e10cSrcweir { return (SwTOXType*)GetRegisteredIn(); } 614*cdf0e10cSrcweir 615*cdf0e10cSrcweir inline sal_Bool SwTOXMark::IsAlternativeText() const 616*cdf0e10cSrcweir { return aAltText.Len() > 0; } 617*cdf0e10cSrcweir 618*cdf0e10cSrcweir inline void SwTOXMark::SetAlternativeText(const String& rAlt) 619*cdf0e10cSrcweir { 620*cdf0e10cSrcweir aAltText = rAlt; 621*cdf0e10cSrcweir } 622*cdf0e10cSrcweir 623*cdf0e10cSrcweir inline void SwTOXMark::SetLevel( sal_uInt16 nLvl ) 624*cdf0e10cSrcweir { 625*cdf0e10cSrcweir ASSERT( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); 626*cdf0e10cSrcweir nLevel = nLvl; 627*cdf0e10cSrcweir } 628*cdf0e10cSrcweir 629*cdf0e10cSrcweir inline void SwTOXMark::SetPrimaryKey( const String& rKey ) 630*cdf0e10cSrcweir { 631*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 632*cdf0e10cSrcweir aPrimaryKey = rKey; 633*cdf0e10cSrcweir } 634*cdf0e10cSrcweir 635*cdf0e10cSrcweir inline void SwTOXMark::SetSecondaryKey( const String& rKey ) 636*cdf0e10cSrcweir { 637*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 638*cdf0e10cSrcweir aSecondaryKey = rKey; 639*cdf0e10cSrcweir } 640*cdf0e10cSrcweir 641*cdf0e10cSrcweir inline void SwTOXMark::SetTextReading( const String& rTxt ) 642*cdf0e10cSrcweir { 643*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 644*cdf0e10cSrcweir aTextReading = rTxt; 645*cdf0e10cSrcweir } 646*cdf0e10cSrcweir 647*cdf0e10cSrcweir inline void SwTOXMark::SetPrimaryKeyReading( const String& rKey ) 648*cdf0e10cSrcweir { 649*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 650*cdf0e10cSrcweir aPrimaryKeyReading = rKey; 651*cdf0e10cSrcweir } 652*cdf0e10cSrcweir 653*cdf0e10cSrcweir inline void SwTOXMark::SetSecondaryKeyReading( const String& rKey ) 654*cdf0e10cSrcweir { 655*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 656*cdf0e10cSrcweir aSecondaryKeyReading = rKey; 657*cdf0e10cSrcweir } 658*cdf0e10cSrcweir 659*cdf0e10cSrcweir inline sal_uInt16 SwTOXMark::GetLevel() const 660*cdf0e10cSrcweir { 661*cdf0e10cSrcweir ASSERT( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); 662*cdf0e10cSrcweir return nLevel; 663*cdf0e10cSrcweir } 664*cdf0e10cSrcweir 665*cdf0e10cSrcweir inline const String& SwTOXMark::GetPrimaryKey() const 666*cdf0e10cSrcweir { 667*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 668*cdf0e10cSrcweir return aPrimaryKey; 669*cdf0e10cSrcweir } 670*cdf0e10cSrcweir 671*cdf0e10cSrcweir inline const String& SwTOXMark::GetSecondaryKey() const 672*cdf0e10cSrcweir { 673*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 674*cdf0e10cSrcweir return aSecondaryKey; 675*cdf0e10cSrcweir } 676*cdf0e10cSrcweir 677*cdf0e10cSrcweir inline const String& SwTOXMark::GetTextReading() const 678*cdf0e10cSrcweir { 679*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 680*cdf0e10cSrcweir return aTextReading; 681*cdf0e10cSrcweir } 682*cdf0e10cSrcweir 683*cdf0e10cSrcweir inline const String& SwTOXMark::GetPrimaryKeyReading() const 684*cdf0e10cSrcweir { 685*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 686*cdf0e10cSrcweir return aPrimaryKeyReading; 687*cdf0e10cSrcweir } 688*cdf0e10cSrcweir 689*cdf0e10cSrcweir inline const String& SwTOXMark::GetSecondaryKeyReading() const 690*cdf0e10cSrcweir { 691*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 692*cdf0e10cSrcweir return aSecondaryKeyReading; 693*cdf0e10cSrcweir } 694*cdf0e10cSrcweir 695*cdf0e10cSrcweir // 696*cdf0e10cSrcweir //SwForm 697*cdf0e10cSrcweir // 698*cdf0e10cSrcweir inline void SwForm::SetTemplate(sal_uInt16 nLevel, const String& rTemplate) 699*cdf0e10cSrcweir { 700*cdf0e10cSrcweir ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX"); 701*cdf0e10cSrcweir aTemplate[nLevel] = rTemplate; 702*cdf0e10cSrcweir } 703*cdf0e10cSrcweir 704*cdf0e10cSrcweir inline const String& SwForm::GetTemplate(sal_uInt16 nLevel) const 705*cdf0e10cSrcweir { 706*cdf0e10cSrcweir ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX"); 707*cdf0e10cSrcweir return aTemplate[nLevel]; 708*cdf0e10cSrcweir } 709*cdf0e10cSrcweir 710*cdf0e10cSrcweir inline TOXTypes SwForm::GetTOXType() const 711*cdf0e10cSrcweir { 712*cdf0e10cSrcweir return eType; 713*cdf0e10cSrcweir } 714*cdf0e10cSrcweir 715*cdf0e10cSrcweir inline sal_uInt16 SwForm::GetFormMax() const 716*cdf0e10cSrcweir { 717*cdf0e10cSrcweir return nFormMaxLevel; 718*cdf0e10cSrcweir } 719*cdf0e10cSrcweir 720*cdf0e10cSrcweir 721*cdf0e10cSrcweir // 722*cdf0e10cSrcweir //SwTOXType 723*cdf0e10cSrcweir // 724*cdf0e10cSrcweir inline const String& SwTOXType::GetTypeName() const 725*cdf0e10cSrcweir { return aName; } 726*cdf0e10cSrcweir 727*cdf0e10cSrcweir inline TOXTypes SwTOXType::GetType() const 728*cdf0e10cSrcweir { return eType; } 729*cdf0e10cSrcweir 730*cdf0e10cSrcweir // 731*cdf0e10cSrcweir // SwTOXBase 732*cdf0e10cSrcweir // 733*cdf0e10cSrcweir inline const SwTOXType* SwTOXBase::GetTOXType() const 734*cdf0e10cSrcweir { return (SwTOXType*)GetRegisteredIn(); } 735*cdf0e10cSrcweir 736*cdf0e10cSrcweir inline sal_uInt16 SwTOXBase::GetCreateType() const 737*cdf0e10cSrcweir { return nCreateType; } 738*cdf0e10cSrcweir 739*cdf0e10cSrcweir inline const String& SwTOXBase::GetTitle() const 740*cdf0e10cSrcweir { return aTitle; } 741*cdf0e10cSrcweir 742*cdf0e10cSrcweir inline const String& SwTOXBase::GetTypeName() const 743*cdf0e10cSrcweir { return GetTOXType()->GetTypeName(); } 744*cdf0e10cSrcweir 745*cdf0e10cSrcweir inline const SwForm& SwTOXBase::GetTOXForm() const 746*cdf0e10cSrcweir { return aForm; } 747*cdf0e10cSrcweir 748*cdf0e10cSrcweir inline void SwTOXBase::AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop) 749*cdf0e10cSrcweir { 750*cdf0e10cSrcweir aForm.AdjustTabStops(rDoc, bDefaultRightTabStop); 751*cdf0e10cSrcweir } 752*cdf0e10cSrcweir 753*cdf0e10cSrcweir inline void SwTOXBase::SetCreate(sal_uInt16 nCreate) 754*cdf0e10cSrcweir { nCreateType = nCreate; } 755*cdf0e10cSrcweir 756*cdf0e10cSrcweir inline void SwTOXBase::SetTOXForm(const SwForm& rForm) 757*cdf0e10cSrcweir { aForm = rForm; } 758*cdf0e10cSrcweir 759*cdf0e10cSrcweir inline TOXTypes SwTOXBase::GetType() const 760*cdf0e10cSrcweir { return GetTOXType()->GetType(); } 761*cdf0e10cSrcweir 762*cdf0e10cSrcweir inline void SwTOXBase::SetLevel(sal_uInt16 nLev) 763*cdf0e10cSrcweir { 764*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); 765*cdf0e10cSrcweir aData.nLevel = nLev; 766*cdf0e10cSrcweir } 767*cdf0e10cSrcweir 768*cdf0e10cSrcweir inline sal_uInt16 SwTOXBase::GetLevel() const 769*cdf0e10cSrcweir { 770*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp"); 771*cdf0e10cSrcweir return aData.nLevel; 772*cdf0e10cSrcweir } 773*cdf0e10cSrcweir 774*cdf0e10cSrcweir inline void SwTOXBase::SetTemplateName(const String& rName) 775*cdf0e10cSrcweir { 776*cdf0e10cSrcweir // ASSERT(GetTOXType()->GetType() == TOX_USER, "Falscher Feldtyp"); 777*cdf0e10cSrcweir // ASSERT(aData.pTemplateName, "pTemplateName == 0"); 778*cdf0e10cSrcweir // (*aData.pTemplateName) = rName; 779*cdf0e10cSrcweir DBG_WARNING("SwTOXBase::SetTemplateName obsolete"); 780*cdf0e10cSrcweir aStyleNames[0] = rName; 781*cdf0e10cSrcweir 782*cdf0e10cSrcweir } 783*cdf0e10cSrcweir 784*cdf0e10cSrcweir inline sal_uInt16 SwTOXBase::GetOptions() const 785*cdf0e10cSrcweir { 786*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 787*cdf0e10cSrcweir return aData.nOptions; 788*cdf0e10cSrcweir } 789*cdf0e10cSrcweir 790*cdf0e10cSrcweir inline void SwTOXBase::SetOptions(sal_uInt16 nOpt) 791*cdf0e10cSrcweir { 792*cdf0e10cSrcweir ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp"); 793*cdf0e10cSrcweir aData.nOptions = nOpt; 794*cdf0e10cSrcweir } 795*cdf0e10cSrcweir 796*cdf0e10cSrcweir 797*cdf0e10cSrcweir #endif // SW_TOX_HXX 798