LCOV - code coverage report
Current view: top level - sw/inc - tox.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 107 156 68.6 %
Date: 2014-04-11 Functions: 74 98 75.5 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10