lok: Hide file linking in section
[LibreOffice.git] / sw / inc / tox.hxx
blobaecda558fcb514eccbbee1277764689e9ce767e3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #include <cppuhelper/weakref.hxx>
23 #include <sal/log.hxx>
25 #include <i18nlangtag/lang.h>
26 #include <svl/poolitem.hxx>
28 #include <editeng/svxenum.hxx>
29 #include "swtypes.hxx"
30 #include "toxe.hxx"
31 #include "calbck.hxx"
32 #include <o3tl/typed_flags_set.hxx>
34 #include <vector>
36 namespace com { namespace sun { namespace star {
37 namespace text { class XDocumentIndexMark; }
38 } } }
40 class SwTOXType;
41 class SwTOXMark;
42 class SwTextTOXMark;
43 class SwDoc;
44 class SwRootFrame;
46 typedef std::vector<SwTOXMark*> SwTOXMarks;
48 // Entry of content index, alphabetical index or user defined index
50 extern const sal_Unicode C_NUM_REPL;
51 extern const sal_Unicode C_END_PAGE_NUM;
52 extern const OUString S_PAGE_DELI;
54 class SW_DLLPUBLIC SwTOXMark
55 : public SfxPoolItem
56 , public sw::BroadcastingModify
58 friend void InitCore();
59 friend class SwTextTOXMark;
61 OUString m_aAltText; // Text of caption is different.
62 OUString m_aPrimaryKey;
63 OUString m_aSecondaryKey;
65 // three more strings for phonetic sorting
66 OUString m_aTextReading;
67 OUString m_aPrimaryKeyReading;
68 OUString m_aSecondaryKeyReading;
70 SwTextTOXMark* m_pTextAttr;
72 sal_uInt16 m_nLevel;
73 OUString m_aBookmarkName;
74 OUString m_aEntryTypeName; // stored specific entry type name for INDEX field \f
75 bool m_bAutoGenerated : 1; // generated using a concordance file
76 bool m_bMainEntry : 1; // main entry emphasized by character style
78 css::uno::WeakReference<css::text::XDocumentIndexMark> m_wXDocumentIndexMark;
80 SwTOXMark(); // to create the default attribute in InitCore
82 protected:
83 // SwClient
84 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override;
86 public:
88 // single argument ctors shall be explicit.
89 explicit SwTOXMark( const SwTOXType* pTyp );
90 virtual ~SwTOXMark() override;
92 SwTOXMark( const SwTOXMark& rCopy );
93 SwTOXMark& operator=( const SwTOXMark& rCopy );
95 // "pure virtual methods" of SfxPoolItem
96 virtual bool operator==( const SfxPoolItem& ) const override;
97 virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
99 void InvalidateTOXMark();
101 OUString GetText(SwRootFrame const* pLayout) const;
103 inline bool IsAlternativeText() const;
104 inline const OUString& GetAlternativeText() const;
106 inline void SetAlternativeText( const OUString& rAlt );
108 // content or user defined index
109 inline void SetLevel(sal_uInt16 nLevel);
110 inline sal_uInt16 GetLevel() const;
111 inline void SetBookmarkName( const OUString& bName);
112 inline const OUString& GetBookmarkName() const;
113 inline void SetEntryTypeName( const OUString& sName);
114 inline const OUString& GetEntryTypeName() const;
116 // for alphabetical index only
117 inline void SetPrimaryKey(const OUString& rStr );
118 inline void SetSecondaryKey(const OUString& rStr);
119 inline void SetTextReading(const OUString& rStr);
120 inline void SetPrimaryKeyReading(const OUString& rStr );
121 inline void SetSecondaryKeyReading(const OUString& rStr);
123 inline OUString const & GetPrimaryKey() const;
124 inline OUString const & GetSecondaryKey() const;
125 inline OUString const & GetTextReading() const;
126 inline OUString const & GetPrimaryKeyReading() const;
127 inline OUString const & GetSecondaryKeyReading() const;
129 bool IsAutoGenerated() const {return m_bAutoGenerated;}
130 void SetAutoGenerated(bool bSet) {m_bAutoGenerated = bSet;}
132 bool IsMainEntry() const {return m_bMainEntry;}
133 void SetMainEntry(bool bSet) { m_bMainEntry = bSet;}
135 inline const SwTOXType* GetTOXType() const;
137 const SwTextTOXMark* GetTextTOXMark() const { return m_pTextAttr; }
138 SwTextTOXMark* GetTextTOXMark() { return m_pTextAttr; }
140 SAL_DLLPRIVATE css::uno::WeakReference<css::text::XDocumentIndexMark> const& GetXTOXMark() const
141 { return m_wXDocumentIndexMark; }
142 SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference<css::text::XDocumentIndexMark> const& xMark)
143 { m_wXDocumentIndexMark = xMark; }
144 void RegisterToTOXType( SwTOXType& rMark );
145 static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
148 // index types
149 class SwTOXType final: public sw::BroadcastingModify
151 public:
152 SwTOXType(TOXTypes eTyp, const OUString& aName);
154 // @@@ public copy ctor, but no copy assignment?
155 SwTOXType(const SwTOXType& rCopy);
157 inline const OUString& GetTypeName() const;
158 inline TOXTypes GetType() const;
160 private:
161 OUString const m_aName;
162 TOXTypes const m_eType;
164 // @@@ public copy ctor, but no copy assignment?
165 SwTOXType & operator= (const SwTOXType &) = delete;
168 // Structure of the index lines
169 #define FORM_TITLE 0
170 #define FORM_ALPHA_DELIMITER 1
171 #define FORM_PRIMARY_KEY 2
172 #define FORM_SECONDARY_KEY 3
173 #define FORM_ENTRY 4
176 Pattern structure
178 <E#> - entry number <E# CharStyleName,PoolId>
179 <ET> - entry text <ET CharStyleName,PoolId>
180 <E> - entry text and number <E CharStyleName,PoolId>
181 <T> - tab stop <T,,Position,Adjust>
182 <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
183 <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
184 <#> - Page number <# CharStyleName,PoolId>
185 <LS> - Link start <LS>
186 <LE> - Link end <LE>
187 <A00> - Authority entry field <A02 CharStyleName, PoolId>
190 // These enum values are stored and must not be changed!
191 enum FormTokenType
193 TOKEN_ENTRY_NO,
194 TOKEN_ENTRY_TEXT,
195 TOKEN_ENTRY,
196 TOKEN_TAB_STOP,
197 TOKEN_TEXT,
198 TOKEN_PAGE_NUMS,
199 TOKEN_CHAPTER_INFO,
200 TOKEN_LINK_START,
201 TOKEN_LINK_END,
202 TOKEN_AUTHORITY,
203 TOKEN_END
206 struct SW_DLLPUBLIC SwFormToken
208 OUString sText;
209 OUString sCharStyleName;
210 SwTwips nTabStopPosition;
211 FormTokenType eTokenType;
212 sal_uInt16 nPoolId;
213 SvxTabAdjust eTabAlign;
214 sal_uInt16 nChapterFormat; //SwChapterFormat;
215 sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
216 sal_uInt16 nAuthorityField; //enum ToxAuthorityField
217 sal_Unicode cTabFillChar;
218 bool bWithTab; // true: do generate tab
219 // character only the tab stop
220 // #i21237#
222 SwFormToken(FormTokenType eType ) :
223 nTabStopPosition(0),
224 eTokenType(eType),
225 nPoolId(USHRT_MAX),
226 eTabAlign( SvxTabAdjust::Left ),
227 nChapterFormat(0 /*CF_NUMBER*/),
228 nOutlineLevel(MAXLEVEL), //default to maximum outline level
229 nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
230 cTabFillChar(' '),
231 bWithTab(true) // #i21237#
234 OUString GetString() const;
237 struct SwFormTokenEqualToFormTokenType
239 FormTokenType const eType;
241 SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {}
242 bool operator()(const SwFormToken & rToken)
244 return rToken.eTokenType == eType;
248 /// Vector of tokens.
249 typedef std::vector<SwFormToken> SwFormTokens;
252 Helper class that converts vectors of tokens to strings and vice
253 versa.
255 class SwFormTokensHelper
257 /// the tokens
258 SwFormTokens m_Tokens;
260 public:
262 constructor
264 @param rStr string representation of the tokens
266 SwFormTokensHelper(const OUString & rStr);
269 Returns vector of tokens.
271 @return vector of tokens
273 const SwFormTokens & GetTokens() const { return m_Tokens; }
276 class SW_DLLPUBLIC SwForm
278 SwFormTokens m_aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
279 OUString m_aTemplate[ AUTH_TYPE_END + 1 ];
281 TOXTypes m_eType;
282 sal_uInt16 m_nFormMaxLevel;
284 bool m_bIsRelTabPos : 1;
285 bool m_bCommaSeparated : 1;
287 public:
288 SwForm( TOXTypes eTOXType = TOX_CONTENT );
289 SwForm( const SwForm& rForm );
291 SwForm& operator=( const SwForm& rForm );
293 inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName);
294 inline OUString const & GetTemplate(sal_uInt16 nLevel) const;
296 // #i21237#
297 void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName);
298 void SetPattern(sal_uInt16 nLevel, const OUString& rStr);
299 const SwFormTokens& GetPattern(sal_uInt16 nLevel) const;
301 // fill tab stop positions from template to pattern- #i21237#
302 void AdjustTabStops( SwDoc const & rDoc );
304 inline TOXTypes GetTOXType() const;
305 inline sal_uInt16 GetFormMax() const;
307 bool IsRelTabPos() const { return m_bIsRelTabPos; }
308 void SetRelTabPos( bool b ) { m_bIsRelTabPos = b; }
310 bool IsCommaSeparated() const { return m_bCommaSeparated;}
311 void SetCommaSeparated( bool b) { m_bCommaSeparated = b;}
313 static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
315 static OUString GetFormEntry();
316 static OUString GetFormTab();
317 static OUString GetFormPageNums();
318 static OUString GetFormLinkStt();
319 static OUString GetFormLinkEnd();
320 static OUString GetFormEntryNum();
321 static OUString GetFormEntryText();
322 static OUString GetFormChapterMark();
323 static OUString GetFormText();
324 static OUString GetFormAuth();
327 // Content to create indexes of
328 enum class SwTOXElement : sal_uInt16
330 NONE = 0x0000,
331 Mark = 0x0001,
332 OutlineLevel = 0x0002,
333 Template = 0x0004,
334 Ole = 0x0008,
335 Table = 0x0010,
336 Graphic = 0x0020,
337 Frame = 0x0040,
338 Sequence = 0x0080,
339 TableLeader = 0x0100,
340 TableInToc = 0x0200,
341 Bookmark = 0x0400,
342 Newline = 0x0800,
343 ParagraphOutlineLevel = 0x1000,
344 IndexEntryType = 0x2000,
346 namespace o3tl {
347 template<> struct typed_flags<SwTOXElement> : is_typed_flags<SwTOXElement, 0x3fff> {};
350 enum class SwTOIOptions : sal_uInt16
352 NONE = 0x00,
353 SameEntry = 0x01,
354 FF = 0x02,
355 CaseSensitive = 0x04,
356 KeyAsEntry = 0x08,
357 AlphaDelimiter = 0x10,
358 Dash = 0x20,
359 InitialCaps = 0x40,
361 namespace o3tl {
362 template<> struct typed_flags<SwTOIOptions> : is_typed_flags<SwTOIOptions, 0x7f> {};
365 //which part of the caption is to be displayed
366 enum SwCaptionDisplay
368 CAPTION_COMPLETE,
369 CAPTION_NUMBER,
370 CAPTION_TEXT
373 enum class SwTOOElements : sal_uInt16
375 NONE = 0x00,
376 Math = 0x01,
377 Chart = 0x02,
378 Calc = 0x08,
379 DrawImpress = 0x10,
380 Other = 0x80,
382 namespace o3tl {
383 template<> struct typed_flags<SwTOOElements> : is_typed_flags<SwTOOElements, 0x9b> {};
386 #define TOX_STYLE_DELIMITER u'\x0001'
388 // Class for all indexes
389 class SW_DLLPUBLIC SwTOXBase : public SwClient
391 SwForm m_aForm; // description of the lines
392 OUString m_aName; // unique name
393 OUString m_aTitle; // title
394 OUString m_aBookmarkName; //Bookmark Name
395 OUString m_aEntryTypeName; // Type name
397 OUString m_sMainEntryCharStyle; // name of the character style applied to main index entries
399 OUString m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
400 OUString m_sSequenceName; // FieldTypeName of a caption sequence
402 LanguageType m_eLanguage;
403 OUString m_sSortAlgorithm;
405 union {
406 sal_uInt16 nLevel; // consider outline levels
407 SwTOIOptions nOptions; // options of alphabetical index
408 } m_aData;
410 SwTOXElement m_nCreateType; // sources to create the index from
411 SwTOOElements m_nOLEOptions; // OLE sources
412 SwCaptionDisplay m_eCaptionDisplay;
413 bool m_bProtected : 1; // index protected ?
414 bool m_bFromChapter : 1; // create from chapter or document
415 bool m_bFromObjectNames : 1; // create a table or object index
416 // from the names rather than the caption
417 bool m_bLevelFromChapter : 1; // User index: get the level from the source chapter
419 protected:
420 // Add a data member, for record the TOC field expression of MS Word binary format
421 // For keeping fidelity and may giving a better exporting performance
422 OUString maMSTOCExpression;
423 bool mbKeepExpression;
425 public:
426 SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
427 SwTOXElement nCreaType, const OUString& rTitle );
428 SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = nullptr );
429 virtual ~SwTOXBase() override;
431 virtual bool GetInfo( SfxPoolItem& rInfo ) const override;
433 // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
434 // If not, so create it and copy all other used things.
435 void CopyTOXBase( SwDoc*, const SwTOXBase& );
437 const SwTOXType* GetTOXType() const;
439 SwTOXElement GetCreateType() const; // creation types
441 const OUString& GetTOXName() const {return m_aName;}
442 void SetTOXName(const OUString& rSet) {m_aName = rSet;}
444 // for record the TOC field expression of MS Word binary format
445 const OUString& GetMSTOCExpression() const{return maMSTOCExpression;}
446 void SetMSTOCExpression(const OUString& rExp) {maMSTOCExpression = rExp;}
447 void EnableKeepExpression() {mbKeepExpression = true;}
448 void DisableKeepExpression() {mbKeepExpression = false;}
450 const OUString& GetTitle() const; // Title
451 const OUString& GetBookmarkName() const;
452 OUString const & GetTypeName() const; // Name
453 const SwForm& GetTOXForm() const; // description of the lines
455 void SetCreate(SwTOXElement);
456 void SetTitle(const OUString& rTitle);
457 void SetTOXForm(const SwForm& rForm);
458 void SetBookmarkName(const OUString& bName);
460 TOXTypes GetType() const;
462 const OUString& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;}
463 void SetMainEntryCharStyle(const OUString& rSet) {m_sMainEntryCharStyle = rSet;}
465 // for record the Index field expression of MS Word
466 const OUString& GetEntryTypeName() const;
467 void SetEntryTypeName(const OUString& sName);
469 // content index only
470 inline void SetLevel(sal_uInt16); // consider outline level
471 inline sal_uInt16 GetLevel() const;
473 // alphabetical index only
474 inline SwTOIOptions GetOptions() const; // alphabetical index options
475 inline void SetOptions(SwTOIOptions nOpt);
477 // index of objects
478 SwTOOElements GetOLEOptions() const {return m_nOLEOptions;}
479 void SetOLEOptions(SwTOOElements nOpt) {m_nOLEOptions = nOpt;}
481 // index of objects
483 OUString const & GetStyleNames(sal_uInt16 nLevel) const
485 SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
486 return m_aStyleNames[nLevel];
488 void SetStyleNames(const OUString& rSet, sal_uInt16 nLevel)
490 SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
491 m_aStyleNames[nLevel] = rSet;
493 bool IsFromChapter() const { return m_bFromChapter;}
494 void SetFromChapter(bool bSet) { m_bFromChapter = bSet;}
496 bool IsFromObjectNames() const {return m_bFromObjectNames;}
497 void SetFromObjectNames(bool bSet) {m_bFromObjectNames = bSet;}
499 bool IsLevelFromChapter() const {return m_bLevelFromChapter;}
500 void SetLevelFromChapter(bool bSet) {m_bLevelFromChapter = bSet;}
502 bool IsProtected() const { return m_bProtected; }
503 void SetProtected(bool bSet) { m_bProtected = bSet; }
505 const OUString& GetSequenceName() const {return m_sSequenceName;}
506 void SetSequenceName(const OUString& rSet) {m_sSequenceName = rSet;}
508 SwCaptionDisplay GetCaptionDisplay() const { return m_eCaptionDisplay;}
509 void SetCaptionDisplay(SwCaptionDisplay eSet) {m_eCaptionDisplay = eSet;}
511 bool IsTOXBaseInReadonly() const;
513 const SfxItemSet* GetAttrSet() const;
514 void SetAttrSet( const SfxItemSet& );
516 LanguageType GetLanguage() const {return m_eLanguage;}
517 void SetLanguage(LanguageType nLang) {m_eLanguage = nLang;}
519 const OUString& GetSortAlgorithm()const {return m_sSortAlgorithm;}
520 void SetSortAlgorithm(const OUString& rSet) {m_sSortAlgorithm = rSet;}
521 // #i21237#
522 void AdjustTabStops( SwDoc const & rDoc )
524 m_aForm.AdjustTabStops( rDoc );
527 SwTOXBase& operator=(const SwTOXBase& rSource);
528 void RegisterToTOXType( SwTOXType& rMark );
531 //SwTOXMark
533 inline const OUString& SwTOXMark::GetAlternativeText() const
534 { return m_aAltText; }
536 inline const OUString& SwTOXMark::GetBookmarkName() const
537 { return m_aBookmarkName; }
539 inline const OUString& SwTOXMark::GetEntryTypeName() const
540 { return m_aEntryTypeName; }
542 inline const SwTOXType* SwTOXMark::GetTOXType() const
543 { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
545 inline bool SwTOXMark::IsAlternativeText() const
546 { return !m_aAltText.isEmpty(); }
548 inline void SwTOXMark::SetAlternativeText(const OUString& rAlt)
550 m_aAltText = rAlt;
553 inline void SwTOXMark::SetBookmarkName(const OUString& bName)
555 m_aBookmarkName = bName;
558 inline void SwTOXMark::SetEntryTypeName(const OUString& sName)
560 m_aEntryTypeName = sName;
562 inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
564 SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
565 m_nLevel = nLvl;
568 inline void SwTOXMark::SetPrimaryKey( const OUString& rKey )
570 SAL_WARN_IF( GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
571 m_aPrimaryKey = rKey;
574 inline void SwTOXMark::SetSecondaryKey( const OUString& rKey )
576 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
577 m_aSecondaryKey = rKey;
580 inline void SwTOXMark::SetTextReading( const OUString& rText )
582 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
583 m_aTextReading = rText;
586 inline void SwTOXMark::SetPrimaryKeyReading( const OUString& rKey )
588 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
589 m_aPrimaryKeyReading = rKey;
592 inline void SwTOXMark::SetSecondaryKeyReading( const OUString& rKey )
594 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
595 m_aSecondaryKeyReading = rKey;
598 inline sal_uInt16 SwTOXMark::GetLevel() const
600 SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
601 return m_nLevel;
604 inline OUString const & SwTOXMark::GetPrimaryKey() const
606 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
607 return m_aPrimaryKey;
610 inline OUString const & SwTOXMark::GetSecondaryKey() const
612 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
613 return m_aSecondaryKey;
616 inline OUString const & SwTOXMark::GetTextReading() const
618 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
619 return m_aTextReading;
622 inline OUString const & SwTOXMark::GetPrimaryKeyReading() const
624 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
625 return m_aPrimaryKeyReading;
628 inline OUString const & SwTOXMark::GetSecondaryKeyReading() const
630 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
631 return m_aSecondaryKeyReading;
634 //SwForm
636 inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate)
638 SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
639 m_aTemplate[nLevel] = rTemplate;
642 inline OUString const & SwForm::GetTemplate(sal_uInt16 nLevel) const
644 SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
645 return m_aTemplate[nLevel];
648 inline TOXTypes SwForm::GetTOXType() const
650 return m_eType;
653 inline sal_uInt16 SwForm::GetFormMax() const
655 return m_nFormMaxLevel;
658 //SwTOXType
660 inline const OUString& SwTOXType::GetTypeName() const
661 { return m_aName; }
663 inline TOXTypes SwTOXType::GetType() const
664 { return m_eType; }
666 // SwTOXBase
668 inline const SwTOXType* SwTOXBase::GetTOXType() const
669 { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
671 inline SwTOXElement SwTOXBase::GetCreateType() const
672 { return m_nCreateType; }
674 inline const OUString& SwTOXBase::GetTitle() const
675 { return m_aTitle; }
677 inline const OUString& SwTOXBase::GetBookmarkName() const
678 { return m_aBookmarkName; }
680 inline const OUString& SwTOXBase::GetEntryTypeName() const
681 { return m_aEntryTypeName; }
683 inline OUString const & SwTOXBase::GetTypeName() const
684 { return GetTOXType()->GetTypeName(); }
686 inline const SwForm& SwTOXBase::GetTOXForm() const
687 { return m_aForm; }
689 inline void SwTOXBase::SetCreate(SwTOXElement nCreate)
690 { m_nCreateType = nCreate; }
692 inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
693 { m_aForm = rForm; }
695 inline TOXTypes SwTOXBase::GetType() const
696 { return GetTOXType()->GetType(); }
698 inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
700 SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
701 m_aData.nLevel = nLev;
704 inline sal_uInt16 SwTOXBase::GetLevel() const
706 SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
707 return m_aData.nLevel;
710 inline SwTOIOptions SwTOXBase::GetOptions() const
712 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
713 return m_aData.nOptions;
716 inline void SwTOXBase::SetOptions(SwTOIOptions nOpt)
718 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
719 m_aData.nOptions = nOpt;
722 #endif // INCLUDED_SW_INC_TOX_HXX
724 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */