1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_TOX_HXX
20 #define INCLUDED_SW_INC_TOX_HXX
25 #include <cppuhelper/weakref.hxx>
26 #include <editeng/svxenum.hxx>
27 #include <i18nlangtag/lang.h>
28 #include <o3tl/typed_flags_set.hxx>
29 #include <sal/log.hxx>
30 #include <svl/listener.hxx>
31 #include <svl/poolitem.hxx>
32 #include <unotools/weakref.hxx>
33 #include <com/sun/star/text/XDocumentIndexMark.hpp>
37 #include "swtypes.hxx"
46 class SwXDocumentIndexMark
;
48 typedef std::vector
<SwTOXMark
*> SwTOXMarks
;
51 struct CollectTextMarksHint final
: SfxHint
{
53 CollectTextMarksHint(SwTOXMarks
& rMarks
) : SfxHint(SfxHintId::SwCollectTextMarks
), m_rMarks(rMarks
) {}
55 struct FindContentFrameHint final
: SfxHint
{
56 SwContentFrame
*& m_rpContentFrame
;
58 const SwRootFrame
& m_rLayout
;
59 FindContentFrameHint(SwContentFrame
*& rpContentFrame
, const SwDoc
& rDoc
, const SwRootFrame
& rLayout
)
60 : m_rpContentFrame(rpContentFrame
)
65 struct CollectTextTOXMarksForLayoutHint final
: SfxHint
{
66 std::vector
<std::reference_wrapper
<SwTextTOXMark
>>& m_rMarks
;
67 const SwRootFrame
* m_pLayout
;
68 CollectTextTOXMarksForLayoutHint(std::vector
<std::reference_wrapper
<SwTextTOXMark
>>& rMarks
, const SwRootFrame
* pLayout
)
69 : SfxHint(SfxHintId::SwCollectTextTOXMarksForLayout
), m_rMarks(rMarks
), m_pLayout(pLayout
) {}
71 SW_DLLPUBLIC
auto PrepareJumpToTOXMark(SwDoc
const& rDoc
, std::u16string_view aName
)
72 -> std::optional
<std::pair
<SwTOXMark
, sal_Int32
>>;
75 // Entry of content index, alphabetical index or user defined index
77 extern const sal_Unicode C_NUM_REPL
;
78 extern const sal_Unicode C_END_PAGE_NUM
;
80 class SW_DLLPUBLIC SwTOXMark final
82 , public sw::BroadcastingModify
85 friend void InitCore();
86 friend class SwTextTOXMark
;
88 const SwTOXType
* m_pType
;
89 OUString m_aAltText
; // Text of caption is different.
90 OUString m_aPrimaryKey
;
91 OUString m_aSecondaryKey
;
93 // three more strings for phonetic sorting
94 OUString m_aTextReading
;
95 OUString m_aPrimaryKeyReading
;
96 OUString m_aSecondaryKeyReading
;
98 SwTextTOXMark
* m_pTextAttr
;
101 OUString m_aBookmarkName
;
102 bool m_bAutoGenerated
; // generated using a concordance file
103 bool m_bMainEntry
; // main entry emphasized by character style
105 unotools::WeakReference
<SwXDocumentIndexMark
> m_wXDocumentIndexMark
;
107 SwTOXMark(); // to create the default attribute in InitCore
109 virtual void Notify(const SfxHint
& rHint
) override
;
113 // single argument ctors shall be explicit.
114 explicit SwTOXMark( const SwTOXType
* pTyp
);
115 virtual ~SwTOXMark() override
;
117 SwTOXMark( const SwTOXMark
& rCopy
);
118 SwTOXMark
& operator=( const SwTOXMark
& rCopy
);
120 // "pure virtual methods" of SfxPoolItem
121 virtual bool operator==( const SfxPoolItem
& ) const override
;
122 virtual SwTOXMark
* Clone( SfxItemPool
* pPool
= nullptr ) const override
;
124 void InvalidateTOXMark();
126 OUString
GetText(SwRootFrame
const* pLayout
) const;
128 inline bool IsAlternativeText() const;
129 inline const OUString
& GetAlternativeText() const;
131 inline void SetAlternativeText( const OUString
& rAlt
);
133 // content or user defined index
134 inline void SetLevel(sal_uInt16 nLevel
);
135 inline sal_uInt16
GetLevel() const;
136 inline void SetBookmarkName( const OUString
& bName
);
137 inline const OUString
& GetBookmarkName() const;
139 // for alphabetical index only
140 inline void SetPrimaryKey(const OUString
& rStr
);
141 inline void SetSecondaryKey(const OUString
& rStr
);
142 inline void SetTextReading(const OUString
& rStr
);
143 inline void SetPrimaryKeyReading(const OUString
& rStr
);
144 inline void SetSecondaryKeyReading(const OUString
& rStr
);
146 inline OUString
const & GetPrimaryKey() const;
147 inline OUString
const & GetSecondaryKey() const;
148 inline OUString
const & GetTextReading() const;
149 inline OUString
const & GetPrimaryKeyReading() const;
150 inline OUString
const & GetSecondaryKeyReading() const;
152 bool IsAutoGenerated() const {return m_bAutoGenerated
;}
153 void SetAutoGenerated(bool bSet
) {m_bAutoGenerated
= bSet
;}
155 bool IsMainEntry() const {return m_bMainEntry
;}
156 void SetMainEntry(bool bSet
) { m_bMainEntry
= bSet
;}
158 inline const SwTOXType
* GetTOXType() const;
160 const SwTextTOXMark
* GetTextTOXMark() const { return m_pTextAttr
; }
161 SwTextTOXMark
* GetTextTOXMark() { return m_pTextAttr
; }
163 SAL_DLLPRIVATE
unotools::WeakReference
<SwXDocumentIndexMark
> const& GetXTOXMark() const
164 { return m_wXDocumentIndexMark
; }
165 SAL_DLLPRIVATE
void SetXTOXMark(rtl::Reference
<SwXDocumentIndexMark
> const& xMark
);
167 void RegisterToTOXType( SwTOXType
& rMark
);
169 static constexpr OUStringLiteral S_PAGE_DELI
= u
", ";
173 class SwTOXType final
: public sw::BroadcastingModify
176 SwTOXType(SwDoc
& rDoc
, TOXTypes eTyp
, OUString aName
);
178 // @@@ public copy ctor, but no copy assignment?
179 SwTOXType(const SwTOXType
& rCopy
);
181 inline const OUString
& GetTypeName() const;
182 inline TOXTypes
GetType() const;
183 SwDoc
& GetDoc() const { return m_rDoc
; }
184 void CollectTextMarks(SwTOXMarks
& rMarks
) const
185 { const_cast<SwTOXType
*>(this)->GetNotifier().Broadcast(sw::CollectTextMarksHint(rMarks
)); }
186 SwContentFrame
* FindContentFrame(const SwDoc
& rDoc
, const SwRootFrame
& rLayout
) const
188 SwContentFrame
* pContentFrame
= nullptr;
189 const_cast<SwTOXType
*>(this)->GetNotifier().Broadcast(sw::FindContentFrameHint(pContentFrame
, rDoc
, rLayout
));
190 return pContentFrame
;
192 void CollectTextTOXMarksForLayout(std::vector
<std::reference_wrapper
<SwTextTOXMark
>>& rMarks
, const SwRootFrame
* pLayout
) const
193 { const_cast<SwTOXType
*>(this)->GetNotifier().Broadcast(sw::CollectTextTOXMarksForLayoutHint(rMarks
, pLayout
)); }
201 // @@@ public copy ctor, but no copy assignment?
202 SwTOXType
& operator= (const SwTOXType
&) = delete;
205 // Structure of the index lines
207 #define FORM_ALPHA_DELIMITER 1
208 #define FORM_PRIMARY_KEY 2
209 #define FORM_SECONDARY_KEY 3
215 <E#> - entry number <E# CharStyleName,PoolId>
216 <ET> - entry text <ET CharStyleName,PoolId>
217 <E> - entry text and number <E CharStyleName,PoolId>
218 <T> - tab stop <T,,Position,Adjust>
219 <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
220 <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
221 <#> - Page number <# CharStyleName,PoolId>
222 <LS> - Link start <LS>
224 <A00> - Authority entry field <A02 CharStyleName, PoolId>
227 // These enum values are stored and must not be changed!
243 struct SW_DLLPUBLIC SwFormToken
246 OUString sCharStyleName
;
247 SwTwips nTabStopPosition
;
248 FormTokenType eTokenType
;
250 SvxTabAdjust eTabAlign
;
251 sal_uInt16 nChapterFormat
; //SwChapterFormat;
252 sal_uInt16 nOutlineLevel
;//the maximum permitted outline level in numbering
253 sal_uInt16 nAuthorityField
; //enum ToxAuthorityField
254 sal_Unicode cTabFillChar
;
255 bool bWithTab
; // true: do generate tab
256 // character only the tab stop
259 SwFormToken(FormTokenType eType
) :
263 eTabAlign( SvxTabAdjust::Left
),
264 nChapterFormat(0 /*CF_NUMBER*/),
265 nOutlineLevel(MAXLEVEL
), //default to maximum outline level
266 nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
268 bWithTab(true) // #i21237#
271 OUString
GetString() const;
274 struct SwFormTokenEqualToFormTokenType
278 SwFormTokenEqualToFormTokenType(FormTokenType _eType
) : eType(_eType
) {}
279 bool operator()(const SwFormToken
& rToken
)
281 return rToken
.eTokenType
== eType
;
285 /// Vector of tokens.
286 typedef std::vector
<SwFormToken
> SwFormTokens
;
289 Helper class that converts vectors of tokens to strings and vice
292 class SwFormTokensHelper
295 SwFormTokens m_Tokens
;
301 @param rStr string representation of the tokens
303 SwFormTokensHelper(std::u16string_view aStr
);
306 Returns vector of tokens.
308 @return vector of tokens
310 const SwFormTokens
& GetTokens() const { return m_Tokens
; }
313 class SW_DLLPUBLIC SwForm
315 SwFormTokens m_aPattern
[ AUTH_TYPE_END
+ 1 ]; // #i21237#
316 OUString m_aTemplate
[ AUTH_TYPE_END
+ 1 ];
319 sal_uInt16 m_nFormMaxLevel
;
321 bool m_bIsRelTabPos
: 1;
322 bool m_bCommaSeparated
: 1;
325 SwForm( TOXTypes eTOXType
= TOX_CONTENT
);
326 SwForm( const SwForm
& rForm
);
328 SwForm
& operator=( const SwForm
& rForm
);
330 inline void SetTemplate(sal_uInt16 nLevel
, const OUString
& rName
);
331 inline OUString
const & GetTemplate(sal_uInt16 nLevel
) const;
334 void SetPattern(sal_uInt16 nLevel
, SwFormTokens
&& rName
);
335 void SetPattern(sal_uInt16 nLevel
, std::u16string_view aStr
);
336 const SwFormTokens
& GetPattern(sal_uInt16 nLevel
) const;
338 // fill tab stop positions from template to pattern- #i21237#
339 void AdjustTabStops( SwDoc
const & rDoc
);
341 inline TOXTypes
GetTOXType() const;
342 inline sal_uInt16
GetFormMax() const;
344 bool IsRelTabPos() const { return m_bIsRelTabPos
; }
345 void SetRelTabPos( bool b
) { m_bIsRelTabPos
= b
; }
347 bool IsCommaSeparated() const { return m_bCommaSeparated
;}
348 void SetCommaSeparated( bool b
) { m_bCommaSeparated
= b
;}
350 static sal_uInt16
GetFormMaxLevel( TOXTypes eType
);
352 static OUString
GetFormEntry();
353 static OUString
GetFormTab();
354 static OUString
GetFormPageNums();
355 static OUString
GetFormLinkStt();
356 static OUString
GetFormLinkEnd();
357 static OUString
GetFormEntryNum();
358 static OUString
GetFormEntryText();
359 static OUString
GetFormChapterMark();
360 static OUString
GetFormText();
361 static OUString
GetFormAuth();
364 // Content to create indexes of
365 enum class SwTOXElement
: sal_uInt16
369 OutlineLevel
= 0x0002,
376 TableLeader
= 0x0100,
380 ParagraphOutlineLevel
= 0x1000,
383 template<> struct typed_flags
<SwTOXElement
> : is_typed_flags
<SwTOXElement
, 0x3fff> {};
386 enum class SwTOIOptions
: sal_uInt16
391 CaseSensitive
= 0x04,
393 AlphaDelimiter
= 0x10,
398 template<> struct typed_flags
<SwTOIOptions
> : is_typed_flags
<SwTOIOptions
, 0x7f> {};
401 //which part of the caption is to be displayed
402 enum SwCaptionDisplay
409 enum class SwTOOElements
: sal_uInt16
419 template<> struct typed_flags
<SwTOOElements
> : is_typed_flags
<SwTOOElements
, 0x9b> {};
422 #define TOX_STYLE_DELIMITER u'\x0001'
424 // Class for all indexes
425 class SW_DLLPUBLIC SwTOXBase
: public SwClient
427 SwForm m_aForm
; // description of the lines
428 OUString m_aName
; // unique name
429 OUString m_aTitle
; // title
430 OUString m_aBookmarkName
; //Bookmark Name
432 OUString m_sMainEntryCharStyle
; // name of the character style applied to main index entries
434 OUString m_aStyleNames
[MAXLEVEL
]; // (additional) style names TOX_CONTENT, TOX_USER
435 OUString m_sSequenceName
; // FieldTypeName of a caption sequence
437 LanguageType m_eLanguage
;
438 OUString m_sSortAlgorithm
;
441 sal_uInt16 nLevel
; // consider outline levels
442 SwTOIOptions nOptions
; // options of alphabetical index
445 SwTOXElement m_nCreateType
; // sources to create the index from
446 SwTOOElements m_nOLEOptions
; // OLE sources
447 SwCaptionDisplay m_eCaptionDisplay
;
448 bool m_bProtected
: 1; // index protected ?
449 bool m_bFromChapter
: 1; // create from chapter or document
450 bool m_bFromObjectNames
: 1; // create a table or object index
451 // from the names rather than the caption
452 bool m_bLevelFromChapter
: 1; // User index: get the level from the source chapter
455 // Add a data member, for record the TOC field expression of MS Word binary format
456 // For keeping fidelity and may giving a better exporting performance
457 OUString maMSTOCExpression
;
458 bool mbKeepExpression
;
461 SwTOXBase( const SwTOXType
* pTyp
, const SwForm
& rForm
,
462 SwTOXElement nCreaType
, OUString aTitle
);
463 SwTOXBase( const SwTOXBase
& rCopy
, SwDoc
* pDoc
= nullptr );
464 virtual ~SwTOXBase() override
;
466 virtual void SwClientNotify(const SwModify
& rMod
, const SfxHint
& rHint
) override
468 if(dynamic_cast<const sw::DocumentDyingHint
*>(&rHint
))
469 GetRegisteredIn()->Remove(this);
471 SwClient::SwClientNotify(rMod
, rHint
);
473 // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
474 // If not, so create it and copy all other used things.
475 void CopyTOXBase( SwDoc
*, const SwTOXBase
& );
477 const SwTOXType
* GetTOXType() const;
479 SwTOXElement
GetCreateType() const; // creation types
481 const OUString
& GetTOXName() const {return m_aName
;}
482 void SetTOXName(const OUString
& rSet
) {m_aName
= rSet
;}
484 // for record the TOC field expression of MS Word binary format
485 const OUString
& GetMSTOCExpression() const{return maMSTOCExpression
;}
486 void SetMSTOCExpression(const OUString
& rExp
) {maMSTOCExpression
= rExp
;}
487 void EnableKeepExpression() {mbKeepExpression
= true;}
488 void DisableKeepExpression() {mbKeepExpression
= false;}
490 const OUString
& GetTitle() const; // Title
491 const OUString
& GetBookmarkName() const;
492 OUString
const & GetTypeName() const; // Name
493 const SwForm
& GetTOXForm() const; // description of the lines
495 void SetCreate(SwTOXElement
);
496 void SetTitle(const OUString
& rTitle
);
497 void SetTOXForm(const SwForm
& rForm
);
498 void SetBookmarkName(const OUString
& bName
);
500 TOXTypes
GetType() const;
502 const OUString
& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle
;}
503 void SetMainEntryCharStyle(const OUString
& rSet
) {m_sMainEntryCharStyle
= rSet
;}
505 // content index only
506 inline void SetLevel(sal_uInt16
); // consider outline level
507 inline sal_uInt16
GetLevel() const;
509 // alphabetical index only
510 inline SwTOIOptions
GetOptions() const; // alphabetical index options
511 inline void SetOptions(SwTOIOptions nOpt
);
514 SwTOOElements
GetOLEOptions() const {return m_nOLEOptions
;}
515 void SetOLEOptions(SwTOOElements nOpt
) {m_nOLEOptions
= nOpt
;}
519 OUString
const & GetStyleNames(sal_uInt16 nLevel
) const
521 SAL_WARN_IF( nLevel
>= MAXLEVEL
, "sw", "Which level?");
522 return m_aStyleNames
[nLevel
];
524 void SetStyleNames(const OUString
& rSet
, sal_uInt16 nLevel
)
526 SAL_WARN_IF( nLevel
>= MAXLEVEL
, "sw", "Which level?");
527 m_aStyleNames
[nLevel
] = rSet
;
529 bool IsFromChapter() const { return m_bFromChapter
;}
530 void SetFromChapter(bool bSet
) { m_bFromChapter
= bSet
;}
532 bool IsFromObjectNames() const {return m_bFromObjectNames
;}
533 void SetFromObjectNames(bool bSet
) {m_bFromObjectNames
= bSet
;}
535 bool IsLevelFromChapter() const {return m_bLevelFromChapter
;}
536 void SetLevelFromChapter(bool bSet
) {m_bLevelFromChapter
= bSet
;}
538 bool IsProtected() const { return m_bProtected
; }
539 void SetProtected(bool bSet
) { m_bProtected
= bSet
; }
541 const OUString
& GetSequenceName() const {return m_sSequenceName
;}
542 void SetSequenceName(const OUString
& rSet
) {m_sSequenceName
= rSet
;}
544 SwCaptionDisplay
GetCaptionDisplay() const { return m_eCaptionDisplay
;}
545 void SetCaptionDisplay(SwCaptionDisplay eSet
) {m_eCaptionDisplay
= eSet
;}
547 bool IsTOXBaseInReadonly() const;
549 const SfxItemSet
* GetAttrSet() const;
550 void SetAttrSet( const SfxItemSet
& );
552 LanguageType
GetLanguage() const {return m_eLanguage
;}
553 void SetLanguage(LanguageType nLang
) {m_eLanguage
= nLang
;}
555 const OUString
& GetSortAlgorithm()const {return m_sSortAlgorithm
;}
556 void SetSortAlgorithm(const OUString
& rSet
) {m_sSortAlgorithm
= rSet
;}
558 void AdjustTabStops( SwDoc
const & rDoc
)
560 m_aForm
.AdjustTabStops( rDoc
);
563 SwTOXBase
& operator=(const SwTOXBase
& rSource
);
564 void RegisterToTOXType( SwTOXType
& rMark
);
565 virtual bool IsVisible() const { return true; }
570 inline const OUString
& SwTOXMark::GetAlternativeText() const
571 { return m_aAltText
; }
573 inline const OUString
& SwTOXMark::GetBookmarkName() const
574 { return m_aBookmarkName
; }
576 inline const SwTOXType
* SwTOXMark::GetTOXType() const
579 inline bool SwTOXMark::IsAlternativeText() const
580 { return !m_aAltText
.isEmpty(); }
582 inline void SwTOXMark::SetAlternativeText(const OUString
& rAlt
)
587 inline void SwTOXMark::SetBookmarkName(const OUString
& bName
)
589 m_aBookmarkName
= bName
;
592 inline void SwTOXMark::SetLevel( sal_uInt16 nLvl
)
594 SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX
, "sw", "Wrong type");
598 inline void SwTOXMark::SetPrimaryKey( const OUString
& rKey
)
600 SAL_WARN_IF( GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
601 m_aPrimaryKey
= rKey
;
604 inline void SwTOXMark::SetSecondaryKey( const OUString
& rKey
)
606 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
607 m_aSecondaryKey
= rKey
;
610 inline void SwTOXMark::SetTextReading( const OUString
& rText
)
612 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
613 m_aTextReading
= rText
;
616 inline void SwTOXMark::SetPrimaryKeyReading( const OUString
& rKey
)
618 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
619 m_aPrimaryKeyReading
= rKey
;
622 inline void SwTOXMark::SetSecondaryKeyReading( const OUString
& rKey
)
624 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
625 m_aSecondaryKeyReading
= rKey
;
628 inline sal_uInt16
SwTOXMark::GetLevel() const
630 SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX
, "sw", "Wrong type");
634 inline OUString
const & SwTOXMark::GetPrimaryKey() const
636 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
637 return m_aPrimaryKey
;
640 inline OUString
const & SwTOXMark::GetSecondaryKey() const
642 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
643 return m_aSecondaryKey
;
646 inline OUString
const & SwTOXMark::GetTextReading() const
648 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
649 return m_aTextReading
;
652 inline OUString
const & SwTOXMark::GetPrimaryKeyReading() const
654 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
655 return m_aPrimaryKeyReading
;
658 inline OUString
const & SwTOXMark::GetSecondaryKeyReading() const
660 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
661 return m_aSecondaryKeyReading
;
666 inline void SwForm::SetTemplate(sal_uInt16 nLevel
, const OUString
& rTemplate
)
668 SAL_WARN_IF(nLevel
>= GetFormMax(), "sw", "Index >= GetFormMax()");
669 m_aTemplate
[nLevel
] = rTemplate
;
672 inline OUString
const & SwForm::GetTemplate(sal_uInt16 nLevel
) const
674 SAL_WARN_IF(nLevel
>= GetFormMax(), "sw", "Index >= GetFormMax()");
675 return m_aTemplate
[nLevel
];
678 inline TOXTypes
SwForm::GetTOXType() const
683 inline sal_uInt16
SwForm::GetFormMax() const
685 return m_nFormMaxLevel
;
690 inline const OUString
& SwTOXType::GetTypeName() const
693 inline TOXTypes
SwTOXType::GetType() const
698 inline const SwTOXType
* SwTOXBase::GetTOXType() const
699 { return static_cast<const SwTOXType
*>(GetRegisteredIn()); }
701 inline SwTOXElement
SwTOXBase::GetCreateType() const
702 { return m_nCreateType
; }
704 inline const OUString
& SwTOXBase::GetTitle() const
707 inline const OUString
& SwTOXBase::GetBookmarkName() const
708 { return m_aBookmarkName
; }
710 inline OUString
const & SwTOXBase::GetTypeName() const
711 { return GetTOXType()->GetTypeName(); }
713 inline const SwForm
& SwTOXBase::GetTOXForm() const
716 inline void SwTOXBase::SetCreate(SwTOXElement nCreate
)
717 { m_nCreateType
= nCreate
; }
719 inline void SwTOXBase::SetTOXForm(const SwForm
& rForm
)
722 inline TOXTypes
SwTOXBase::GetType() const
723 { return GetTOXType()->GetType(); }
725 inline void SwTOXBase::SetLevel(sal_uInt16 nLev
)
727 SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX
, "sw", "Wrong type");
728 m_aData
.nLevel
= nLev
;
731 inline sal_uInt16
SwTOXBase::GetLevel() const
733 SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX
, "sw", "Wrong type");
734 return m_aData
.nLevel
;
737 inline SwTOIOptions
SwTOXBase::GetOptions() const
739 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
740 return m_aData
.nOptions
;
743 inline void SwTOXBase::SetOptions(SwTOIOptions nOpt
)
745 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX
, "sw", "Wrong type");
746 m_aData
.nOptions
= nOpt
;
749 #endif // INCLUDED_SW_INC_TOX_HXX
751 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */