bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / tox.hxx
blob4eb7b1d1dfcb128ae23bb36362dcac1a104ad2aa
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 SW_TOX_HXX
20 #define SW_TOX_HXX
22 #include <cppuhelper/weakref.hxx>
24 #include <i18nlangtag/lang.h>
25 #include <svl/poolitem.hxx>
26 #include <tools/string.hxx>
27 #include <osl/diagnose.h>
29 #include <editeng/svxenum.hxx>
30 #include <swtypes.hxx>
31 #include <toxe.hxx>
32 #include <calbck.hxx>
34 #include <vector> // #i21237#
36 namespace com { namespace sun { namespace star {
37 namespace text { class XDocumentIndexMark; }
38 } } }
40 class SwTOXType;
41 class SwTOXMark;
42 class SwTxtTOXMark;
43 class SwDoc;
45 class SwTOXMarks : public std::vector<SwTOXMark*> {};
47 /*--------------------------------------------------------------------
48 Description: Entry of content index, alphabetical index or user defined index
49 --------------------------------------------------------------------*/
51 class SW_DLLPUBLIC SwTOXMark
52 : public SfxPoolItem
53 , public SwModify
55 friend void _InitCore();
56 friend class SwTxtTOXMark;
58 String aAltText; // Text of caption is different.
59 String aPrimaryKey, aSecondaryKey;
61 // three more strings for phonetic sorting
62 String aTextReading;
63 String aPrimaryKeyReading;
64 String aSecondaryKeyReading;
66 SwTxtTOXMark* pTxtAttr;
68 sal_uInt16 nLevel;
69 sal_Bool bAutoGenerated : 1; // generated using a concordance file
70 sal_Bool bMainEntry : 1; // main entry emphasized by character style
72 ::com::sun::star::uno::WeakReference<
73 ::com::sun::star::text::XDocumentIndexMark> m_wXDocumentIndexMark;
75 SwTOXMark(); // to create the dflt. atr. in _InitCore
77 protected:
78 // SwClient
79 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
81 public:
82 TYPEINFO(); // rtti
84 // single argument ctors shall be explicit.
85 explicit SwTOXMark( const SwTOXType* pTyp );
86 virtual ~SwTOXMark();
88 SwTOXMark( const SwTOXMark& rCopy );
89 SwTOXMark& operator=( const SwTOXMark& rCopy );
91 // "pure virtual methods" of SfxPoolItem
92 virtual int operator==( const SfxPoolItem& ) const;
93 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
95 void InvalidateTOXMark();
97 String GetText() const;
99 inline sal_Bool IsAlternativeText() const;
100 inline const String& GetAlternativeText() const;
102 inline void SetAlternativeText( const String& rAlt );
104 // content or user defined index
105 inline void SetLevel(sal_uInt16 nLevel);
106 inline sal_uInt16 GetLevel() const;
108 // for alphabetical index only
109 inline void SetPrimaryKey(const String& rStr );
110 inline void SetSecondaryKey(const String& rStr);
111 inline void SetTextReading(const String& rStr);
112 inline void SetPrimaryKeyReading(const String& rStr );
113 inline void SetSecondaryKeyReading(const String& rStr);
115 inline const String& GetPrimaryKey() const;
116 inline const String& GetSecondaryKey() const;
117 inline const String& GetTextReading() const;
118 inline const String& GetPrimaryKeyReading() const;
119 inline const String& GetSecondaryKeyReading() const;
121 sal_Bool IsAutoGenerated() const {return bAutoGenerated;}
122 void SetAutoGenerated(sal_Bool bSet) {bAutoGenerated = bSet;}
124 sal_Bool IsMainEntry() const {return bMainEntry;}
125 void SetMainEntry(sal_Bool bSet) { bMainEntry = bSet;}
127 inline const SwTOXType* GetTOXType() const;
129 const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; }
130 SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; }
132 SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
133 ::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const
134 { return m_wXDocumentIndexMark; }
135 SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference<
136 ::com::sun::star::text::XDocumentIndexMark> const& xMark)
137 { m_wXDocumentIndexMark = xMark; }
138 void DeRegister() { GetRegisteredInNonConst()->Remove( this ); }
139 void RegisterToTOXType( SwTOXType& rMark );
140 static void InsertTOXMarks( SwTOXMarks& aMarks, const SwTOXType& rType );
143 /*--------------------------------------------------------------------
144 Description: index types
145 --------------------------------------------------------------------*/
147 class SwTOXType : public SwModify
149 public:
150 SwTOXType(TOXTypes eTyp, const String& aName);
152 // @@@ public copy ctor, but no copy assignment?
153 SwTOXType(const SwTOXType& rCopy);
155 inline const String& GetTypeName() const;
156 inline TOXTypes GetType() const;
158 private:
159 String aName;
160 TOXTypes eType;
162 // @@@ public copy ctor, but no copy assignment?
163 SwTOXType & operator= (const SwTOXType &);
166 /*--------------------------------------------------------------------
167 Description: Structure of the index lines
168 --------------------------------------------------------------------*/
170 #define FORM_TITLE 0
171 #define FORM_ALPHA_DELIMITTER 1
172 #define FORM_PRIMARY_KEY 2
173 #define FORM_SECONDARY_KEY 3
174 #define FORM_ENTRY 4
177 Pattern structure
179 <E#> - entry number <E# CharStyleName,PoolId>
180 <ET> - entry text <ET CharStyleName,PoolId>
181 <E> - entry text and number <E CharStyleName,PoolId>
182 <T> - tab stop <T,,Position,Adjust>
183 <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
184 <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
185 <#> - Page number <# CharStyleName,PoolId>
186 <LS> - Link start <LS>
187 <LE> - Link end <LE>
188 <A00> - Authority entry field <A02 CharStyleName, PoolId>
191 // These enum values are stored and must not be changed!
192 enum FormTokenType
194 TOKEN_ENTRY_NO,
195 TOKEN_ENTRY_TEXT,
196 TOKEN_ENTRY,
197 TOKEN_TAB_STOP,
198 TOKEN_TEXT,
199 TOKEN_PAGE_NUMS,
200 TOKEN_CHAPTER_INFO,
201 TOKEN_LINK_START,
202 TOKEN_LINK_END,
203 TOKEN_AUTHORITY,
204 TOKEN_END
207 struct SW_DLLPUBLIC SwFormToken
209 String sText;
210 String sCharStyleName;
211 SwTwips nTabStopPosition;
212 FormTokenType eTokenType;
213 sal_uInt16 nPoolId;
214 SvxTabAdjust eTabAlign;
215 sal_uInt16 nChapterFormat; //SwChapterFormat;
216 sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
217 sal_uInt16 nAuthorityField; //enum ToxAuthorityField
218 sal_Unicode cTabFillChar;
219 sal_Bool bWithTab; // sal_True: do generate tab
220 // character only the tab stop
221 // #i21237#
223 SwFormToken(FormTokenType eType ) :
224 nTabStopPosition(0),
225 eTokenType(eType),
226 nPoolId(USHRT_MAX),
227 eTabAlign( SVX_TAB_ADJUST_LEFT ),
228 nChapterFormat(0 /*CF_NUMBER*/),
229 nOutlineLevel(MAXLEVEL), //default to maximum outline level
230 nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
231 cTabFillChar(' '),
232 bWithTab(sal_True) // #i21237#
235 String GetString() const;
238 struct SwFormTokenEqualToFormTokenType
240 FormTokenType eType;
242 SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {}
243 bool operator()(const SwFormToken & rToken)
245 return rToken.eTokenType == eType;
250 Functor that appends the string representation of a given token to a string.
252 @param _rText string to append the string representation to
253 @param rToken token whose string representation is appended
255 struct SwFormTokenToString
257 String & rText;
258 SwFormTokenToString(String & _rText) : rText(_rText) {}
259 void operator()(const SwFormToken & rToken) { rText += rToken.GetString(); }
262 /// Vector of tokens.
263 typedef std::vector<SwFormToken> SwFormTokens;
266 Helper class that converts vectors of tokens to strings and vice
267 versa.
269 class SW_DLLPUBLIC SwFormTokensHelper
271 /// the tokens
272 SwFormTokens aTokens;
275 Builds a token from its string representation.
277 @sPattern the whole pattern
278 @nCurPatternPos starting position of the token
280 @return the token
282 SW_DLLPRIVATE SwFormToken BuildToken( const String & sPattern,
283 xub_StrLen & nCurPatternPos ) const;
286 Returns the string of a token.
288 @param sPattern the whole pattern
289 @param nStt starting position of the token
291 @return the string representation of the token
293 SW_DLLPRIVATE String SearchNextToken( const String & sPattern,
294 xub_StrLen nStt ) const;
297 Returns the type of a token.
299 @param sToken the string representation of the token
300 @param pTokenLen return parameter the length of the head of the token
302 If pTokenLen is non-NULL the length of the token's head is
303 written to *pTokenLen
305 @return the type of the token
307 SW_DLLPRIVATE FormTokenType GetTokenType(const String & sToken,
308 xub_StrLen * pTokenLen) const;
310 public:
312 contructor
314 @param rTokens vector of tokens
316 SwFormTokensHelper(const SwFormTokens & rTokens) : aTokens(rTokens) {}
319 constructor
321 @param rStr string representation of the tokens
323 SwFormTokensHelper(const String & rStr);
326 Returns vector of tokens.
328 @return vector of tokens
330 const SwFormTokens & GetTokens() const { return aTokens; }
333 class SW_DLLPUBLIC SwForm
335 SwFormTokens aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
336 String aTemplate[ AUTH_TYPE_END + 1 ];
338 TOXTypes eType;
339 sal_uInt16 nFormMaxLevel;
341 sal_Bool bGenerateTabPos : 1;
342 sal_Bool bIsRelTabPos : 1;
343 sal_Bool bCommaSeparated : 1;
345 public:
346 SwForm( TOXTypes eTOXType = TOX_CONTENT );
347 SwForm( const SwForm& rForm );
349 SwForm& operator=( const SwForm& rForm );
351 inline void SetTemplate(sal_uInt16 nLevel, const String& rName);
352 inline const String& GetTemplate(sal_uInt16 nLevel) const;
354 // #i21237#
355 void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName);
356 void SetPattern(sal_uInt16 nLevel, const String& rStr);
357 const SwFormTokens& GetPattern(sal_uInt16 nLevel) const;
359 // fill tab stop positions from template to pattern
360 // #i21237#
361 void AdjustTabStops(SwDoc& rDoc,
362 sal_Bool bInsertNewTabStops = sal_False);
364 inline TOXTypes GetTOXType() const;
365 inline sal_uInt16 GetFormMax() const;
367 sal_Bool IsRelTabPos() const { return bIsRelTabPos; }
368 void SetRelTabPos( sal_Bool b ) { bIsRelTabPos = b; }
370 sal_Bool IsCommaSeparated() const { return bCommaSeparated;}
371 void SetCommaSeparated( sal_Bool b) { bCommaSeparated = b;}
373 static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
375 static const sal_Char* aFormEntry; // <E>
376 static sal_uInt8 nFormEntryLen; // 3 characters
377 static const sal_Char* aFormTab; // <T>
378 static sal_uInt8 nFormTabLen; // 3 characters
379 static const sal_Char* aFormPageNums; // <P>
380 static sal_uInt8 nFormPageNumsLen; // 3 characters
381 static const sal_Char* aFormLinkStt; // <LS>
382 static sal_uInt8 nFormLinkSttLen; // 4 characters
383 static const sal_Char* aFormLinkEnd; // <LE>
384 static sal_uInt8 nFormLinkEndLen; // 4 characters
385 static const sal_Char* aFormEntryNum; // <E#>
386 static sal_uInt8 nFormEntryNumLen; // 4 characters
387 static const sal_Char* aFormEntryTxt; // <ET>
388 static sal_uInt8 nFormEntryTxtLen; // 4 characters
389 static const sal_Char* aFormChapterMark; // <C>
390 static sal_uInt8 nFormChapterMarkLen; // 3 characters
391 static const sal_Char* aFormText; // <TX>
392 static sal_uInt8 nFormTextLen; // 4 characters
393 static const sal_Char* aFormAuth; // <Axx> xx - decimal enum value
394 static sal_uInt8 nFormAuthLen; // 3 characters
397 /*--------------------------------------------------------------------
398 Description: Content to create indexes of
399 --------------------------------------------------------------------*/
401 typedef sal_uInt16 SwTOXElement;
402 namespace nsSwTOXElement
404 const SwTOXElement TOX_MARK = 1;
405 const SwTOXElement TOX_OUTLINELEVEL = 2;
406 const SwTOXElement TOX_TEMPLATE = 4;
407 const SwTOXElement TOX_OLE = 8;
408 const SwTOXElement TOX_TABLE = 16;
409 const SwTOXElement TOX_GRAPHIC = 32;
410 const SwTOXElement TOX_FRAME = 64;
411 const SwTOXElement TOX_SEQUENCE = 128;
414 typedef sal_uInt16 SwTOIOptions;
415 namespace nsSwTOIOptions
417 const SwTOIOptions TOI_SAME_ENTRY = 1;
418 const SwTOIOptions TOI_FF = 2;
419 const SwTOIOptions TOI_CASE_SENSITIVE = 4;
420 const SwTOIOptions TOI_KEY_AS_ENTRY = 8;
421 const SwTOIOptions TOI_ALPHA_DELIMITTER = 16;
422 const SwTOIOptions TOI_DASH = 32;
423 const SwTOIOptions TOI_INITIAL_CAPS = 64;
426 //which part of the caption is to be displayed
427 enum SwCaptionDisplay
429 CAPTION_COMPLETE,
430 CAPTION_NUMBER,
431 CAPTION_TEXT
434 typedef sal_uInt16 SwTOOElements;
435 namespace nsSwTOOElements
437 const SwTOOElements TOO_MATH = 0x01;
438 const SwTOOElements TOO_CHART = 0x02;
439 const SwTOOElements TOO_CALC = 0x08;
440 const SwTOOElements TOO_DRAW_IMPRESS = 0x10;
441 const SwTOOElements TOO_OTHER = 0x80;
444 #define TOX_STYLE_DELIMITER ((sal_Unicode)0x01)
446 /*--------------------------------------------------------------------
447 Description: Class for all indexes
448 --------------------------------------------------------------------*/
450 class SW_DLLPUBLIC SwTOXBase : public SwClient
452 SwForm aForm; // description of the lines
453 String aName; // unique name
454 String aTitle; // title
456 String sMainEntryCharStyle; // name of the character style applied to main index entries
458 String aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
459 String sSequenceName; // FieldTypeName of a caption sequence
461 LanguageType eLanguage;
462 String sSortAlgorithm;
464 union {
465 sal_uInt16 nLevel; // consider outline levels
466 sal_uInt16 nOptions; // options of alphabetical index
467 } aData;
469 sal_uInt16 nCreateType; // sources to create the index from
470 sal_uInt16 nOLEOptions; // OLE sources
471 SwCaptionDisplay eCaptionDisplay; //
472 sal_Bool bProtected : 1; // index protected ?
473 sal_Bool bFromChapter : 1; // create from chapter or document
474 sal_Bool bFromObjectNames : 1; // create a table or object index
475 // from the names rather than the caption
476 sal_Bool bLevelFromChapter : 1; // User index: get the level from the source chapter
477 public:
478 SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
479 sal_uInt16 nCreaType, const String& rTitle );
480 SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 );
481 virtual ~SwTOXBase();
483 virtual bool GetInfo( SfxPoolItem& rInfo ) const;
485 // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
486 // If not, so create it an copy all other used things. The return is this
487 SwTOXBase& CopyTOXBase( SwDoc*, const SwTOXBase& );
489 const SwTOXType* GetTOXType() const; //
491 sal_uInt16 GetCreateType() const; // creation types
493 const String& GetTOXName() const {return aName;}
494 void SetTOXName(const String& rSet) {aName = rSet;}
496 const String& GetTitle() const; // Title
497 const String& GetTypeName() const; // Name
498 const SwForm& GetTOXForm() const; // description of the lines
500 void SetCreate(sal_uInt16);
501 void SetTitle(const String& rTitle);
502 void SetTOXForm(const SwForm& rForm);
504 TOXTypes GetType() const;
506 const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;}
507 void SetMainEntryCharStyle(const String& rSet) {sMainEntryCharStyle = rSet;}
509 // content index only
510 inline void SetLevel(sal_uInt16); // consider outline level
511 inline sal_uInt16 GetLevel() const;
513 // alphabetical index only
514 inline sal_uInt16 GetOptions() const; // alphabetical index options
515 inline void SetOptions(sal_uInt16 nOpt);
517 // index of objects
518 sal_uInt16 GetOLEOptions() const {return nOLEOptions;}
519 void SetOLEOptions(sal_uInt16 nOpt) {nOLEOptions = nOpt;}
521 // index of objects
523 // user defined index only
524 inline void SetTemplateName(const String& rName); // Absatzlayout beachten
526 const String& GetStyleNames(sal_uInt16 nLevel) const
528 OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
529 return aStyleNames[nLevel];
531 void SetStyleNames(const String& rSet, sal_uInt16 nLevel)
533 OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
534 aStyleNames[nLevel] = rSet;
536 sal_Bool IsFromChapter() const { return bFromChapter;}
537 void SetFromChapter(sal_Bool bSet) { bFromChapter = bSet;}
539 sal_Bool IsFromObjectNames() const {return bFromObjectNames;}
540 void SetFromObjectNames(sal_Bool bSet) {bFromObjectNames = bSet;}
542 sal_Bool IsLevelFromChapter() const {return bLevelFromChapter;}
543 void SetLevelFromChapter(sal_Bool bSet) {bLevelFromChapter = bSet;}
545 sal_Bool IsProtected() const { return bProtected; }
546 void SetProtected(sal_Bool bSet) { bProtected = bSet; }
548 const String& GetSequenceName() const {return sSequenceName;}
549 void SetSequenceName(const String& rSet) {sSequenceName = rSet;}
551 SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;}
552 void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;}
554 bool IsTOXBaseInReadonly() const;
556 const SfxItemSet* GetAttrSet() const;
557 void SetAttrSet( const SfxItemSet& );
559 LanguageType GetLanguage() const {return eLanguage;}
560 void SetLanguage(LanguageType nLang) {eLanguage = nLang;}
562 const String& GetSortAlgorithm()const {return sSortAlgorithm;}
563 void SetSortAlgorithm(const String& rSet) {sSortAlgorithm = rSet;}
564 // #i21237#
565 void AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop);
566 SwTOXBase& operator=(const SwTOXBase& rSource);
567 void RegisterToTOXType( SwTOXType& rMark );
571 /*--------------------------------------------------------------------
572 Description: Inlines
573 --------------------------------------------------------------------*/
576 //SwTOXMark
578 inline const String& SwTOXMark::GetAlternativeText() const
579 { return aAltText; }
581 inline const SwTOXType* SwTOXMark::GetTOXType() const
582 { return (SwTOXType*)GetRegisteredIn(); }
584 inline sal_Bool SwTOXMark::IsAlternativeText() const
585 { return aAltText.Len() > 0; }
587 inline void SwTOXMark::SetAlternativeText(const String& rAlt)
589 aAltText = rAlt;
592 inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
594 OSL_ENSURE( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
595 nLevel = nLvl;
598 inline void SwTOXMark::SetPrimaryKey( const String& rKey )
600 OSL_ENSURE( GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
601 aPrimaryKey = rKey;
604 inline void SwTOXMark::SetSecondaryKey( const String& rKey )
606 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
607 aSecondaryKey = rKey;
610 inline void SwTOXMark::SetTextReading( const String& rTxt )
612 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
613 aTextReading = rTxt;
616 inline void SwTOXMark::SetPrimaryKeyReading( const String& rKey )
618 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
619 aPrimaryKeyReading = rKey;
622 inline void SwTOXMark::SetSecondaryKeyReading( const String& rKey )
624 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
625 aSecondaryKeyReading = rKey;
628 inline sal_uInt16 SwTOXMark::GetLevel() const
630 OSL_ENSURE( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
631 return nLevel;
634 inline const String& SwTOXMark::GetPrimaryKey() const
636 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
637 return aPrimaryKey;
640 inline const String& SwTOXMark::GetSecondaryKey() const
642 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
643 return aSecondaryKey;
646 inline const String& SwTOXMark::GetTextReading() const
648 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
649 return aTextReading;
652 inline const String& SwTOXMark::GetPrimaryKeyReading() const
654 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
655 return aPrimaryKeyReading;
658 inline const String& SwTOXMark::GetSecondaryKeyReading() const
660 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
661 return aSecondaryKeyReading;
665 //SwForm
667 inline void SwForm::SetTemplate(sal_uInt16 nLevel, const String& rTemplate)
669 OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
670 aTemplate[nLevel] = rTemplate;
673 inline const String& SwForm::GetTemplate(sal_uInt16 nLevel) const
675 OSL_ENSURE(nLevel < GetFormMax(), "Index >= FORM_MAX");
676 return aTemplate[nLevel];
679 inline TOXTypes SwForm::GetTOXType() const
681 return eType;
684 inline sal_uInt16 SwForm::GetFormMax() const
686 return nFormMaxLevel;
691 //SwTOXType
693 inline const String& SwTOXType::GetTypeName() const
694 { return aName; }
696 inline TOXTypes SwTOXType::GetType() const
697 { return eType; }
700 // SwTOXBase
702 inline const SwTOXType* SwTOXBase::GetTOXType() const
703 { return (SwTOXType*)GetRegisteredIn(); }
705 inline sal_uInt16 SwTOXBase::GetCreateType() const
706 { return nCreateType; }
708 inline const String& SwTOXBase::GetTitle() const
709 { return aTitle; }
711 inline const String& SwTOXBase::GetTypeName() const
712 { return GetTOXType()->GetTypeName(); }
714 inline const SwForm& SwTOXBase::GetTOXForm() const
715 { return aForm; }
717 inline void SwTOXBase::AdjustTabStops(SwDoc & rDoc, sal_Bool bDefaultRightTabStop)
719 aForm.AdjustTabStops(rDoc, bDefaultRightTabStop);
722 inline void SwTOXBase::SetCreate(sal_uInt16 nCreate)
723 { nCreateType = nCreate; }
725 inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
726 { aForm = rForm; }
728 inline TOXTypes SwTOXBase::GetType() const
729 { return GetTOXType()->GetType(); }
731 inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
733 OSL_ENSURE(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
734 aData.nLevel = nLev;
737 inline sal_uInt16 SwTOXBase::GetLevel() const
739 OSL_ENSURE(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
740 return aData.nLevel;
743 inline void SwTOXBase::SetTemplateName(const String& rName)
745 OSL_FAIL("SwTOXBase::SetTemplateName obsolete");
746 aStyleNames[0] = rName;
749 inline sal_uInt16 SwTOXBase::GetOptions() const
751 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
752 return aData.nOptions;
755 inline void SwTOXBase::SetOptions(sal_uInt16 nOpt)
757 OSL_ENSURE(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
758 aData.nOptions = nOpt;
762 #endif // SW_TOX_HXX
764 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */