Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / tox.hxx
blob1b75da2d94727539af7eab8fb0b68720b8f3abea
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>
33 #include <vector>
35 namespace com { namespace sun { namespace star {
36 namespace text { class XDocumentIndexMark; }
37 } } }
39 class SwTOXType;
40 class SwTOXMark;
41 class SwTextTOXMark;
42 class SwDoc;
44 typedef std::vector<SwTOXMark*> SwTOXMarks;
46 // Entry of content index, alphabetical index or user defined index
48 extern const sal_Unicode C_NUM_REPL;
49 extern const sal_Unicode C_END_PAGE_NUM;
50 extern const OUString S_PAGE_DELI;
52 class SW_DLLPUBLIC SwTOXMark
53 : public SfxPoolItem
54 , public SwModify
56 friend void _InitCore();
57 friend class SwTextTOXMark;
59 OUString aAltText; // Text of caption is different.
60 OUString aPrimaryKey;
61 OUString aSecondaryKey;
62 OUString aCitationKeyReading;
64 // three more strings for phonetic sorting
65 OUString aTextReading;
66 OUString aPrimaryKeyReading;
67 OUString aSecondaryKeyReading;
69 SwTextTOXMark* pTextAttr;
71 sal_uInt16 nLevel;
72 OUString m_aBookmarkName;
73 OUString m_aEntryTypeName; // stored specific entry type name for INDEX field \f
74 bool bAutoGenerated : 1; // generated using a concordance file
75 bool bMainEntry : 1; // main entry emphasized by character style
77 ::com::sun::star::uno::WeakReference<
78 ::com::sun::star::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 ) SAL_OVERRIDE;
86 public:
87 TYPEINFO_OVERRIDE(); // rtti
89 // single argument ctors shall be explicit.
90 explicit SwTOXMark( const SwTOXType* pTyp );
91 virtual ~SwTOXMark();
93 SwTOXMark( const SwTOXMark& rCopy );
94 SwTOXMark& operator=( const SwTOXMark& rCopy );
96 // "pure virtual methods" of SfxPoolItem
97 virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
98 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
100 void InvalidateTOXMark();
102 OUString GetText() const;
104 inline bool IsAlternativeText() const;
105 inline OUString GetAlternativeText() const;
107 inline void SetAlternativeText( const OUString& rAlt );
109 // content or user defined index
110 inline void SetLevel(sal_uInt16 nLevel);
111 inline sal_uInt16 GetLevel() const;
112 inline void SetBookmarkName( const OUString& bName);
113 inline OUString GetBookmarkName() const;
114 inline void SetEntryTypeName( const OUString& sName);
115 inline OUString GetEntryTypeName() const;
117 // for alphabetical index only
118 inline void SetPrimaryKey(const OUString& rStr );
119 inline void SetSecondaryKey(const OUString& rStr);
120 inline void SetTextReading(const OUString& rStr);
121 inline void SetPrimaryKeyReading(const OUString& rStr );
122 inline void SetSecondaryKeyReading(const OUString& rStr);
123 inline void SetCitationKeyReading(const OUString& rStr);
125 inline OUString GetPrimaryKey() const;
126 inline OUString GetSecondaryKey() const;
127 inline OUString GetTextReading() const;
128 inline OUString GetPrimaryKeyReading() const;
129 inline OUString GetSecondaryKeyReading() const;
130 inline OUString GetCitationKeyReading() const;
132 bool IsAutoGenerated() const {return bAutoGenerated;}
133 void SetAutoGenerated(bool bSet) {bAutoGenerated = bSet;}
135 bool IsMainEntry() const {return bMainEntry;}
136 void SetMainEntry(bool bSet) { bMainEntry = bSet;}
138 inline const SwTOXType* GetTOXType() const;
140 const SwTextTOXMark* GetTextTOXMark() const { return pTextAttr; }
141 SwTextTOXMark* GetTextTOXMark() { return pTextAttr; }
143 SAL_DLLPRIVATE ::com::sun::star::uno::WeakReference<
144 ::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const
145 { return m_wXDocumentIndexMark; }
146 SAL_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference<
147 ::com::sun::star::text::XDocumentIndexMark> const& xMark)
148 { m_wXDocumentIndexMark = xMark; }
149 void DeRegister() { GetRegisteredInNonConst()->Remove( this ); }
150 void RegisterToTOXType( SwTOXType& rMark );
151 static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
154 // index types
155 class SwTOXType : public SwModify
157 public:
158 SwTOXType(TOXTypes eTyp, const OUString& aName);
160 // @@@ public copy ctor, but no copy assignment?
161 SwTOXType(const SwTOXType& rCopy);
163 inline OUString GetTypeName() const;
164 inline TOXTypes GetType() const;
166 private:
167 OUString aName;
168 TOXTypes eType;
170 // @@@ public copy ctor, but no copy assignment?
171 SwTOXType & operator= (const SwTOXType &) SAL_DELETED_FUNCTION;
174 // Structure of the index lines
175 #define FORM_TITLE 0
176 #define FORM_ALPHA_DELIMITTER 1
177 #define FORM_PRIMARY_KEY 2
178 #define FORM_SECONDARY_KEY 3
179 #define FORM_ENTRY 4
182 Pattern structure
184 <E#> - entry number <E# CharStyleName,PoolId>
185 <ET> - entry text <ET CharStyleName,PoolId>
186 <E> - entry text and number <E CharStyleName,PoolId>
187 <T> - tab stop <T,,Position,Adjust>
188 <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
189 <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
190 <#> - Page number <# CharStyleName,PoolId>
191 <LS> - Link start <LS>
192 <LE> - Link end <LE>
193 <A00> - Authority entry field <A02 CharStyleName, PoolId>
196 // These enum values are stored and must not be changed!
197 enum FormTokenType
199 TOKEN_ENTRY_NO,
200 TOKEN_ENTRY_TEXT,
201 TOKEN_ENTRY,
202 TOKEN_TAB_STOP,
203 TOKEN_TEXT,
204 TOKEN_PAGE_NUMS,
205 TOKEN_CHAPTER_INFO,
206 TOKEN_LINK_START,
207 TOKEN_LINK_END,
208 TOKEN_AUTHORITY,
209 TOKEN_END
212 struct SW_DLLPUBLIC SwFormToken
214 OUString sText;
215 OUString sCharStyleName;
216 SwTwips nTabStopPosition;
217 FormTokenType eTokenType;
218 sal_uInt16 nPoolId;
219 SvxTabAdjust eTabAlign;
220 sal_uInt16 nChapterFormat; //SwChapterFormat;
221 sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
222 sal_uInt16 nAuthorityField; //enum ToxAuthorityField
223 sal_Unicode cTabFillChar;
224 bool bWithTab; // true: do generate tab
225 // character only the tab stop
226 // #i21237#
228 SwFormToken(FormTokenType eType ) :
229 nTabStopPosition(0),
230 eTokenType(eType),
231 nPoolId(USHRT_MAX),
232 eTabAlign( SVX_TAB_ADJUST_LEFT ),
233 nChapterFormat(0 /*CF_NUMBER*/),
234 nOutlineLevel(MAXLEVEL), //default to maximum outline level
235 nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
236 cTabFillChar(' '),
237 bWithTab(true) // #i21237#
240 OUString GetString() const;
243 struct SwFormTokenEqualToFormTokenType
245 FormTokenType eType;
247 SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {}
248 bool operator()(const SwFormToken & rToken)
250 return rToken.eTokenType == eType;
254 /// Vector of tokens.
255 typedef std::vector<SwFormToken> SwFormTokens;
258 Helper class that converts vectors of tokens to strings and vice
259 versa.
261 class SW_DLLPUBLIC SwFormTokensHelper
263 /// the tokens
264 SwFormTokens m_Tokens;
266 public:
268 constructor
270 @param rTokens vector of tokens
272 SwFormTokensHelper(const SwFormTokens & rTokens) : m_Tokens(rTokens) {}
275 constructor
277 @param rStr string representation of the tokens
279 SwFormTokensHelper(const OUString & rStr);
282 Returns vector of tokens.
284 @return vector of tokens
286 const SwFormTokens & GetTokens() const { return m_Tokens; }
289 class SW_DLLPUBLIC SwForm
291 SwFormTokens aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
292 OUString aTemplate[ AUTH_TYPE_END + 1 ];
294 TOXTypes eType;
295 sal_uInt16 nFormMaxLevel;
297 bool bGenerateTabPos : 1;
298 bool bIsRelTabPos : 1;
299 bool bCommaSeparated : 1;
301 public:
302 SwForm( TOXTypes eTOXType = TOX_CONTENT );
303 SwForm( const SwForm& rForm );
305 SwForm& operator=( const SwForm& rForm );
307 inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName);
308 inline OUString GetTemplate(sal_uInt16 nLevel) const;
310 // #i21237#
311 void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName);
312 void SetPattern(sal_uInt16 nLevel, const OUString& rStr);
313 const SwFormTokens& GetPattern(sal_uInt16 nLevel) const;
315 // fill tab stop positions from template to pattern- #i21237#
316 void AdjustTabStops( SwDoc& rDoc );
318 inline TOXTypes GetTOXType() const;
319 inline sal_uInt16 GetFormMax() const;
321 bool IsRelTabPos() const { return bIsRelTabPos; }
322 void SetRelTabPos( bool b ) { bIsRelTabPos = b; }
324 bool IsCommaSeparated() const { return bCommaSeparated;}
325 void SetCommaSeparated( bool b) { bCommaSeparated = b;}
327 static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
329 static OUString GetFormEntry();
330 static OUString GetFormTab();
331 static OUString GetFormPageNums();
332 static OUString GetFormLinkStt();
333 static OUString GetFormLinkEnd();
334 static OUString GetFormEntryNum();
335 static OUString GetFormEntryText();
336 static OUString GetFormChapterMark();
337 static OUString GetFormText();
338 static OUString GetFormAuth();
341 // Content to create indexes of
342 typedef sal_uInt16 SwTOXElement;
343 namespace nsSwTOXElement
345 const SwTOXElement TOX_MARK = 1;
346 const SwTOXElement TOX_OUTLINELEVEL = 2;
347 const SwTOXElement TOX_TEMPLATE = 4;
348 const SwTOXElement TOX_OLE = 8;
349 const SwTOXElement TOX_TABLE = 16;
350 const SwTOXElement TOX_GRAPHIC = 32;
351 const SwTOXElement TOX_FRAME = 64;
352 const SwTOXElement TOX_SEQUENCE = 128;
353 const SwTOXElement TOX_TABLEADER = 256;
354 const SwTOXElement TOX_TAB_IN_TOC = 512;
355 const SwTOXElement TOX_BOOKMARK = 1024;
356 const SwTOXElement TOX_NEWLINE = 2048;
357 const SwTOXElement TOX_PARAGRAPH_OUTLINE_LEVEL = 4096;
358 const SwTOXElement TOX_INDEX_ENTRY_TYPE = 8192;
361 typedef sal_uInt16 SwTOIOptions;
362 namespace nsSwTOIOptions
364 const SwTOIOptions TOI_SAME_ENTRY = 1;
365 const SwTOIOptions TOI_FF = 2;
366 const SwTOIOptions TOI_CASE_SENSITIVE = 4;
367 const SwTOIOptions TOI_KEY_AS_ENTRY = 8;
368 const SwTOIOptions TOI_ALPHA_DELIMITTER = 16;
369 const SwTOIOptions TOI_DASH = 32;
370 const SwTOIOptions TOI_INITIAL_CAPS = 64;
373 //which part of the caption is to be displayed
374 enum SwCaptionDisplay
376 CAPTION_COMPLETE,
377 CAPTION_NUMBER,
378 CAPTION_TEXT
381 typedef sal_uInt16 SwTOOElements;
382 namespace nsSwTOOElements
384 const SwTOOElements TOO_MATH = 0x01;
385 const SwTOOElements TOO_CHART = 0x02;
386 const SwTOOElements TOO_CALC = 0x08;
387 const SwTOOElements TOO_DRAW_IMPRESS = 0x10;
388 const SwTOOElements TOO_OTHER = 0x80;
391 #define TOX_STYLE_DELIMITER ((sal_Unicode)0x01)
393 // Class for all indexes
394 class SW_DLLPUBLIC SwTOXBase : public SwClient
396 SwForm aForm; // description of the lines
397 OUString aName; // unique name
398 OUString aTitle; // title
399 OUString m_aBookmarkName; //Bookmark Name
400 OUString m_aEntryTypeName; // Type name
402 OUString sMainEntryCharStyle; // name of the character style applied to main index entries
404 OUString aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
405 OUString sSequenceName; // FieldTypeName of a caption sequence
407 LanguageType eLanguage;
408 OUString sSortAlgorithm;
410 union {
411 sal_uInt16 nLevel; // consider outline levels
412 sal_uInt16 nOptions; // options of alphabetical index
413 } aData;
415 sal_uInt16 nCreateType; // sources to create the index from
416 sal_uInt16 nOLEOptions; // OLE sources
417 SwCaptionDisplay eCaptionDisplay;
418 bool bProtected : 1; // index protected ?
419 bool bFromChapter : 1; // create from chapter or document
420 bool bFromObjectNames : 1; // create a table or object index
421 // from the names rather than the caption
422 bool bLevelFromChapter : 1; // User index: get the level from the source chapter
424 protected:
425 // Add a data member, for record the TOC field expression of MS Word binary format
426 // For keeping fedality and may giving a better exporting performance
427 OUString maMSTOCExpression;
428 bool mbKeepExpression;
430 public:
431 SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
432 sal_uInt16 nCreaType, const OUString& rTitle );
433 SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 );
434 virtual ~SwTOXBase();
436 virtual bool GetInfo( SfxPoolItem& rInfo ) const SAL_OVERRIDE;
438 // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
439 // If not, so create it an copy all other used things. The return is this
440 SwTOXBase& CopyTOXBase( SwDoc*, const SwTOXBase& );
442 const SwTOXType* GetTOXType() const;
444 sal_uInt16 GetCreateType() const; // creation types
446 OUString GetTOXName() const {return aName;}
447 void SetTOXName(const OUString& rSet) {aName = rSet;}
449 // for record the TOC field expression of MS Word binary format
450 const OUString& GetMSTOCExpression() const{return maMSTOCExpression;}
451 void SetMSTOCExpression(const OUString& rExp) {maMSTOCExpression = rExp;}
452 void EnableKeepExpression() {mbKeepExpression = true;}
453 void DisableKeepExpression() {mbKeepExpression = false;}
455 OUString GetTitle() const; // Title
456 OUString GetBookmarkName() const;
457 OUString GetTypeName() const; // Name
458 const SwForm& GetTOXForm() const; // description of the lines
460 void SetCreate(sal_uInt16);
461 void SetTitle(const OUString& rTitle);
462 void SetTOXForm(const SwForm& rForm);
463 void SetBookmarkName(const OUString& bName);
465 TOXTypes GetType() const;
467 OUString GetMainEntryCharStyle() const {return sMainEntryCharStyle;}
468 void SetMainEntryCharStyle(const OUString& rSet) {sMainEntryCharStyle = rSet;}
470 // for record the Index field expression of MS Word
471 OUString GetEntryTypeName() const;
472 void SetEntryTypeName(const OUString& sName);
474 // content index only
475 inline void SetLevel(sal_uInt16); // consider outline level
476 inline sal_uInt16 GetLevel() const;
478 // alphabetical index only
479 inline sal_uInt16 GetOptions() const; // alphabetical index options
480 inline void SetOptions(sal_uInt16 nOpt);
482 // index of objects
483 sal_uInt16 GetOLEOptions() const {return nOLEOptions;}
484 void SetOLEOptions(sal_uInt16 nOpt) {nOLEOptions = nOpt;}
486 // index of objects
488 // user defined index only
489 inline void SetTemplateName(const OUString& rName); // Absatzlayout beachten
491 OUString GetStyleNames(sal_uInt16 nLevel) const
493 SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
494 return aStyleNames[nLevel];
496 void SetStyleNames(const OUString& rSet, sal_uInt16 nLevel)
498 SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
499 aStyleNames[nLevel] = rSet;
501 bool IsFromChapter() const { return bFromChapter;}
502 void SetFromChapter(bool bSet) { bFromChapter = bSet;}
504 bool IsFromObjectNames() const {return bFromObjectNames;}
505 void SetFromObjectNames(bool bSet) {bFromObjectNames = bSet;}
507 bool IsLevelFromChapter() const {return bLevelFromChapter;}
508 void SetLevelFromChapter(bool bSet) {bLevelFromChapter = bSet;}
510 bool IsProtected() const { return bProtected; }
511 void SetProtected(bool bSet) { bProtected = bSet; }
513 OUString GetSequenceName() const {return sSequenceName;}
514 void SetSequenceName(const OUString& rSet) {sSequenceName = rSet;}
516 SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;}
517 void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;}
519 bool IsTOXBaseInReadonly() const;
521 const SfxItemSet* GetAttrSet() const;
522 void SetAttrSet( const SfxItemSet& );
524 LanguageType GetLanguage() const {return eLanguage;}
525 void SetLanguage(LanguageType nLang) {eLanguage = nLang;}
527 OUString GetSortAlgorithm()const {return sSortAlgorithm;}
528 void SetSortAlgorithm(const OUString& rSet) {sSortAlgorithm = rSet;}
529 // #i21237#
530 void AdjustTabStops( SwDoc & rDoc )
532 aForm.AdjustTabStops( rDoc );
535 SwTOXBase& operator=(const SwTOXBase& rSource);
536 void RegisterToTOXType( SwTOXType& rMark );
539 //SwTOXMark
541 inline OUString SwTOXMark::GetAlternativeText() const
542 { return aAltText; }
544 inline OUString SwTOXMark::GetBookmarkName() const
545 { return m_aBookmarkName; }
547 inline OUString SwTOXMark::GetEntryTypeName() const
548 { return m_aEntryTypeName; }
550 inline const SwTOXType* SwTOXMark::GetTOXType() const
551 { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
553 inline bool SwTOXMark::IsAlternativeText() const
554 { return !aAltText.isEmpty(); }
556 inline void SwTOXMark::SetAlternativeText(const OUString& rAlt)
558 aAltText = rAlt;
561 inline void SwTOXMark::SetBookmarkName(const OUString& bName)
563 m_aBookmarkName = bName;
566 inline void SwTOXMark::SetEntryTypeName(const OUString& sName)
568 m_aEntryTypeName = sName;
570 inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
572 SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
573 nLevel = nLvl;
576 inline void SwTOXMark::SetPrimaryKey( const OUString& rKey )
578 SAL_WARN_IF( GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
579 aPrimaryKey = rKey;
582 inline void SwTOXMark::SetSecondaryKey( const OUString& rKey )
584 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
585 aSecondaryKey = rKey;
588 inline void SwTOXMark::SetTextReading( const OUString& rText )
590 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
591 aTextReading = rText;
594 inline void SwTOXMark::SetPrimaryKeyReading( const OUString& rKey )
596 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
597 aPrimaryKeyReading = rKey;
600 inline void SwTOXMark::SetCitationKeyReading( const OUString& rKey )
602 SAL_WARN_IF(GetTOXType()->GetType() != TOX_CITATION, "sw", "Wrong type");
603 aCitationKeyReading = rKey;
606 inline void SwTOXMark::SetSecondaryKeyReading( const OUString& rKey )
608 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
609 aSecondaryKeyReading = rKey;
612 inline sal_uInt16 SwTOXMark::GetLevel() const
614 SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
615 return nLevel;
618 inline OUString SwTOXMark::GetPrimaryKey() const
620 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
621 return aPrimaryKey;
624 inline OUString SwTOXMark::GetSecondaryKey() const
626 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
627 return aSecondaryKey;
630 inline OUString SwTOXMark::GetTextReading() const
632 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
633 return aTextReading;
636 inline OUString SwTOXMark::GetPrimaryKeyReading() const
638 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
639 return aPrimaryKeyReading;
642 inline OUString SwTOXMark::GetSecondaryKeyReading() const
644 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
645 return aSecondaryKeyReading;
648 inline OUString SwTOXMark::GetCitationKeyReading() const
650 SAL_WARN_IF(GetTOXType()->GetType() != TOX_CITATION, "sw", "Wrong type");
651 return aCitationKeyReading;
654 //SwForm
656 inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate)
658 SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
659 aTemplate[nLevel] = rTemplate;
662 inline OUString SwForm::GetTemplate(sal_uInt16 nLevel) const
664 SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
665 return aTemplate[nLevel];
668 inline TOXTypes SwForm::GetTOXType() const
670 return eType;
673 inline sal_uInt16 SwForm::GetFormMax() const
675 return nFormMaxLevel;
678 //SwTOXType
680 inline OUString SwTOXType::GetTypeName() const
681 { return aName; }
683 inline TOXTypes SwTOXType::GetType() const
684 { return eType; }
686 // SwTOXBase
688 inline const SwTOXType* SwTOXBase::GetTOXType() const
689 { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
691 inline sal_uInt16 SwTOXBase::GetCreateType() const
692 { return nCreateType; }
694 inline OUString SwTOXBase::GetTitle() const
695 { return aTitle; }
697 inline OUString SwTOXBase::GetBookmarkName() const
698 { return m_aBookmarkName; }
700 inline OUString SwTOXBase::GetEntryTypeName() const
701 { return m_aEntryTypeName; }
703 inline OUString SwTOXBase::GetTypeName() const
704 { return GetTOXType()->GetTypeName(); }
706 inline const SwForm& SwTOXBase::GetTOXForm() const
707 { return aForm; }
709 inline void SwTOXBase::SetCreate(sal_uInt16 nCreate)
710 { nCreateType = nCreate; }
712 inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
713 { aForm = rForm; }
715 inline TOXTypes SwTOXBase::GetType() const
716 { return GetTOXType()->GetType(); }
718 inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
720 SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
721 aData.nLevel = nLev;
724 inline sal_uInt16 SwTOXBase::GetLevel() const
726 SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
727 return aData.nLevel;
730 inline void SwTOXBase::SetTemplateName(const OUString& rName)
732 SAL_WARN("sw", "SwTOXBase::SetTemplateName obsolete");
733 aStyleNames[0] = rName;
736 inline sal_uInt16 SwTOXBase::GetOptions() const
738 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
739 return aData.nOptions;
742 inline void SwTOXBase::SetOptions(sal_uInt16 nOpt)
744 SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
745 aData.nOptions = nOpt;
748 #endif // INCLUDED_SW_INC_TOX_HXX
750 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */