merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / tox.hxx
blobfea15cfafb82c4478929492d7be08e32db61f77c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef SW_TOX_HXX
28 #define SW_TOX_HXX
30 #include <cppuhelper/weakref.hxx>
32 #include <i18npool/lang.h>
33 #include <tools/string.hxx>
35 #include <editeng/svxenum.hxx>
36 #include <svl/svarray.hxx>
37 #include <svl/poolitem.hxx>
38 #include "swdllapi.h"
39 #include <swtypes.hxx>
40 #include <toxe.hxx>
41 #include <calbck.hxx>
42 #include <errhdl.hxx>
44 #ifndef INCLUDED_VECTOR
45 #include <vector> // #i21237#
46 #define INCLUDED_VECTOR
47 #endif
50 namespace com { namespace sun { namespace star {
51 namespace text { class XDocumentIndexMark; }
52 } } }
54 class SwTOXType;
55 class SwTOXMark;
56 class SwTxtTOXMark;
57 class SwDoc;
59 SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0, 10)
61 /*--------------------------------------------------------------------
62 Description: Entry of content index, alphabetical index or user defined index
63 --------------------------------------------------------------------*/
65 #define IVER_TOXMARK_STRPOOL ((USHORT)1)
66 #define IVER_TOXMARK_NEWTOX ((USHORT)2)
68 class SW_DLLPUBLIC SwTOXMark
69 : public SfxPoolItem
70 , public SwModify
72 friend void _InitCore();
73 friend class SwTxtTOXMark;
75 String aAltText; // Der Text des Eintrages ist unterschiedlich
76 String aPrimaryKey, aSecondaryKey;
78 // three more strings for phonetic sorting
79 String aTextReading;
80 String aPrimaryKeyReading;
81 String aSecondaryKeyReading;
83 SwTxtTOXMark* pTxtAttr;
85 USHORT nLevel;
86 BOOL bAutoGenerated : 1; // generated using a concordance file
87 BOOL bMainEntry : 1; // main entry emphasized by character style
89 ::com::sun::star::uno::WeakReference<
90 ::com::sun::star::text::XDocumentIndexMark> m_wXDocumentIndexMark;
92 SwTOXMark(); // to create the dflt. atr. in _InitCore
94 public:
95 TYPEINFO(); // rtti
97 // single argument ctors shall be explicit.
98 explicit SwTOXMark( const SwTOXType* pTyp );
99 virtual ~SwTOXMark();
101 SwTOXMark( const SwTOXMark& rCopy );
102 SwTOXMark& operator=( const SwTOXMark& rCopy );
104 // "pure virtual methods" of SfxPoolItem
105 virtual int operator==( const SfxPoolItem& ) const;
106 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
108 // SwClient
109 virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew );
111 void InvalidateTOXMark();
113 String GetText() const;
115 inline BOOL IsAlternativeText() const;
116 inline const String& GetAlternativeText() const;
118 inline void SetAlternativeText( const String& rAlt );
120 // content or user defined index
121 inline void SetLevel(USHORT nLevel);
122 inline USHORT GetLevel() const;
124 // for alphabetical index only
125 inline void SetPrimaryKey(const String& rStr );
126 inline void SetSecondaryKey(const String& rStr);
127 inline void SetTextReading(const String& rStr);
128 inline void SetPrimaryKeyReading(const String& rStr );
129 inline void SetSecondaryKeyReading(const String& rStr);
131 inline const String& GetPrimaryKey() const;
132 inline const String& GetSecondaryKey() const;
133 inline const String& GetTextReading() const;
134 inline const String& GetPrimaryKeyReading() const;
135 inline const String& GetSecondaryKeyReading() const;
137 BOOL IsAutoGenerated() const {return bAutoGenerated;}
138 void SetAutoGenerated(BOOL bSet) {bAutoGenerated = bSet;}
140 BOOL IsMainEntry() const {return bMainEntry;}
141 void SetMainEntry(BOOL bSet) { bMainEntry = bSet;}
143 inline const SwTOXType* GetTOXType() const;
145 const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; }
146 SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; }
148 SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
149 ::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const
150 { return m_wXDocumentIndexMark; }
151 SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference<
152 ::com::sun::star::text::XDocumentIndexMark> const& xMark)
153 { m_wXDocumentIndexMark = xMark; }
157 /*--------------------------------------------------------------------
158 Description: index types
159 --------------------------------------------------------------------*/
161 class SwTOXType : public SwModify
163 public:
164 SwTOXType(TOXTypes eTyp, const String& aName);
166 // @@@ public copy ctor, but no copy assignment?
167 SwTOXType(const SwTOXType& rCopy);
169 inline const String& GetTypeName() const;
170 inline TOXTypes GetType() const;
172 private:
173 String aName;
174 TOXTypes eType;
176 // @@@ public copy ctor, but no copy assignment?
177 SwTOXType & operator= (const SwTOXType &);
180 /*--------------------------------------------------------------------
181 Description: Structure of the index lines
182 --------------------------------------------------------------------*/
184 #define FORM_TITLE 0
185 #define FORM_ALPHA_DELIMITTER 1
186 #define FORM_PRIMARY_KEY 2
187 #define FORM_SECONDARY_KEY 3
188 #define FORM_ENTRY 4
191 Pattern structure
193 <E#> - entry number <E# CharStyleName,PoolId>
194 <ET> - entry text <ET CharStyleName,PoolId>
195 <E> - entry text and number <E CharStyleName,PoolId>
196 <T> - tab stop <T,,Position,Adjust>
197 <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
198 <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
199 <#> - Page number <# CharStyleName,PoolId>
200 <LS> - Link start <LS>
201 <LE> - Link end <LE>
202 <A00> - Authority entry field <A02 CharStyleName, PoolId>
205 // These enum values are stored and must not be changed!
206 enum FormTokenType
208 TOKEN_ENTRY_NO,
209 TOKEN_ENTRY_TEXT,
210 TOKEN_ENTRY,
211 TOKEN_TAB_STOP,
212 TOKEN_TEXT,
213 TOKEN_PAGE_NUMS,
214 TOKEN_CHAPTER_INFO,
215 TOKEN_LINK_START,
216 TOKEN_LINK_END,
217 TOKEN_AUTHORITY,
218 TOKEN_END
221 struct SW_DLLPUBLIC SwFormToken
223 String sText;
224 String sCharStyleName;
225 SwTwips nTabStopPosition;
226 FormTokenType eTokenType;
227 USHORT nPoolId;
228 SvxTabAdjust eTabAlign;
229 USHORT nChapterFormat; //SwChapterFormat;
230 USHORT nOutlineLevel;//the maximum permitted outline level in numbering
231 USHORT nAuthorityField; //enum ToxAuthorityField
232 sal_Unicode cTabFillChar;
233 sal_Bool bWithTab; // TRUE: do generate tab
234 // character only the tab stop
235 // #i21237#
237 SwFormToken(FormTokenType eType ) :
238 nTabStopPosition(0),
239 eTokenType(eType),
240 nPoolId(USHRT_MAX),
241 eTabAlign( SVX_TAB_ADJUST_LEFT ),
242 nChapterFormat(0 /*CF_NUMBER*/),
243 nOutlineLevel(MAXLEVEL), //default to maximum outline level
244 nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
245 cTabFillChar(' '),
246 bWithTab(sal_True) // #i21237#
249 String GetString() const;
252 // -> #i21237#
254 Functor that is true when a given token has a certain token type.
256 @param _eType the type to check for
257 @param rToken the token to check
259 @retval TRUE the token has the given type
260 @retval FALSE else
262 struct SwFormTokenEqualToFormTokenType
264 FormTokenType eType;
266 SwFormTokenEqualToFormTokenType(FormTokenType _eType) : eType(_eType) {}
267 bool operator()(const SwFormToken & rToken)
269 return rToken.eTokenType == eType;
274 Functor that appends the string representation of a given token to a string.
276 @param _rText string to append the string representation to
277 @param rToken token whose string representation is appended
279 struct SwFormTokenToString
281 String & rText;
282 SwFormTokenToString(String & _rText) : rText(_rText) {}
283 void operator()(const SwFormToken & rToken) { rText += rToken.GetString(); }
286 /// Vector of tokens.
287 typedef std::vector<SwFormToken> SwFormTokens;
290 Helper class that converts vectors of tokens to strings and vice
291 versa.
293 class SW_DLLPUBLIC SwFormTokensHelper
295 /// the tokens
296 SwFormTokens aTokens;
299 Builds a token from its string representation.
301 @sPattern the whole pattern
302 @nCurPatternPos starting position of the token
304 @return the token
306 SW_DLLPRIVATE SwFormToken BuildToken( const String & sPattern,
307 xub_StrLen & nCurPatternPos ) const;
310 Returns the string of a token.
312 @param sPattern the whole pattern
313 @param nStt starting position of the token
315 @return the string representation of the token
317 SW_DLLPRIVATE String SearchNextToken( const String & sPattern,
318 xub_StrLen nStt ) const;
321 Returns the type of a token.
323 @param sToken the string representation of the token
324 @param pTokenLen return parameter the length of the head of the token
326 If pTokenLen is non-NULL the length of the token's head is
327 written to *pTokenLen
329 @return the type of the token
331 SW_DLLPRIVATE FormTokenType GetTokenType(const String & sToken,
332 xub_StrLen * pTokenLen) const;
334 public:
336 contructor
338 @param rTokens vector of tokens
340 SwFormTokensHelper(const SwFormTokens & rTokens) : aTokens(rTokens) {}
343 constructor
345 @param rStr string representation of the tokens
347 SwFormTokensHelper(const String & rStr);
350 Returns vector of tokens.
352 @return vector of tokens
354 const SwFormTokens & GetTokens() const { return aTokens; }
356 // <- #i21237#
358 class SW_DLLPUBLIC SwForm
360 SwFormTokens aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
361 String aTemplate[ AUTH_TYPE_END + 1 ];
363 TOXTypes eType;
364 USHORT nFormMaxLevel;
366 //USHORT nFirstTabPos; -> Value in tab token
367 // BOOL bHasFirstTabPos : 1;
368 BOOL bGenerateTabPos : 1;
369 BOOL bIsRelTabPos : 1;
370 BOOL bCommaSeparated : 1;
372 public:
373 SwForm( TOXTypes eTOXType = TOX_CONTENT );
374 SwForm( const SwForm& rForm );
376 SwForm& operator=( const SwForm& rForm );
378 inline void SetTemplate(USHORT nLevel, const String& rName);
379 inline const String& GetTemplate(USHORT nLevel) const;
381 // #i21237#
382 void SetPattern(USHORT nLevel, const SwFormTokens& rName);
383 void SetPattern(USHORT nLevel, const String& rStr);
384 const SwFormTokens& GetPattern(USHORT nLevel) const;
386 // fill tab stop positions from template to pattern
387 // #i21237#
388 void AdjustTabStops(SwDoc& rDoc,
389 BOOL bInsertNewTabStops = FALSE);
391 inline TOXTypes GetTOXType() const;
392 inline USHORT GetFormMax() const;
394 BOOL IsRelTabPos() const { return bIsRelTabPos; }
395 void SetRelTabPos( BOOL b ) { bIsRelTabPos = b; }
397 BOOL IsCommaSeparated() const { return bCommaSeparated;}
398 void SetCommaSeparated( BOOL b) { bCommaSeparated = b;}
400 static USHORT GetFormMaxLevel( TOXTypes eType );
402 static const sal_Char* aFormEntry; // <E>
403 static BYTE nFormEntryLen; // 3 characters
404 static const sal_Char* aFormTab; // <T>
405 static BYTE nFormTabLen; // 3 characters
406 static const sal_Char* aFormPageNums; // <P>
407 static BYTE nFormPageNumsLen; // 3 characters
408 static const sal_Char* aFormLinkStt; // <LS>
409 static BYTE nFormLinkSttLen; // 4 characters
410 static const sal_Char* aFormLinkEnd; // <LE>
411 static BYTE nFormLinkEndLen; // 4 characters
412 static const sal_Char* aFormEntryNum; // <E#>
413 static BYTE nFormEntryNumLen; // 4 characters
414 static const sal_Char* aFormEntryTxt; // <ET>
415 static BYTE nFormEntryTxtLen; // 4 characters
416 static const sal_Char* aFormChapterMark; // <C>
417 static BYTE nFormChapterMarkLen; // 3 characters
418 static const sal_Char* aFormText; // <TX>
419 static BYTE nFormTextLen; // 4 characters
420 static const sal_Char* aFormAuth; // <Axx> xx - decimal enum value
421 static BYTE nFormAuthLen; // 3 characters
424 /*--------------------------------------------------------------------
425 Description: Content to create indexes of
426 --------------------------------------------------------------------*/
428 typedef USHORT SwTOXElement;
429 namespace nsSwTOXElement
431 const SwTOXElement TOX_MARK = 1;
432 const SwTOXElement TOX_OUTLINELEVEL = 2;
433 const SwTOXElement TOX_TEMPLATE = 4;
434 const SwTOXElement TOX_OLE = 8;
435 const SwTOXElement TOX_TABLE = 16;
436 const SwTOXElement TOX_GRAPHIC = 32;
437 const SwTOXElement TOX_FRAME = 64;
438 const SwTOXElement TOX_SEQUENCE = 128;
441 typedef USHORT SwTOIOptions;
442 namespace nsSwTOIOptions
444 const SwTOIOptions TOI_SAME_ENTRY = 1;
445 const SwTOIOptions TOI_FF = 2;
446 const SwTOIOptions TOI_CASE_SENSITIVE = 4;
447 const SwTOIOptions TOI_KEY_AS_ENTRY = 8;
448 const SwTOIOptions TOI_ALPHA_DELIMITTER = 16;
449 const SwTOIOptions TOI_DASH = 32;
450 const SwTOIOptions TOI_INITIAL_CAPS = 64;
453 //which part of the caption is to be displayed
454 enum SwCaptionDisplay
456 CAPTION_COMPLETE,
457 CAPTION_NUMBER,
458 CAPTION_TEXT
461 typedef USHORT SwTOOElements;
462 namespace nsSwTOOElements
464 const SwTOOElements TOO_MATH = 0x01;
465 const SwTOOElements TOO_CHART = 0x02;
466 const SwTOOElements TOO_CALC = 0x08;
467 const SwTOOElements TOO_DRAW_IMPRESS = 0x10;
468 // const SwTOOElements TOO_IMPRESS = 0x20;
469 const SwTOOElements TOO_OTHER = 0x80;
472 #define TOX_STYLE_DELIMITER ((sal_Unicode)0x01) //JP 19.07.00: use a control char
474 /*--------------------------------------------------------------------
475 Description: Class for all indexes
476 --------------------------------------------------------------------*/
478 class SW_DLLPUBLIC SwTOXBase : public SwClient
480 SwForm aForm; // description of the lines
481 String aName; // unique name
482 String aTitle; // title
484 String sMainEntryCharStyle; // name of the character style applied to main index entries
486 String aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
487 String sSequenceName; // FieldTypeName of a caption sequence
489 LanguageType eLanguage;
490 String sSortAlgorithm;
492 union {
493 USHORT nLevel; // consider outline levels
494 USHORT nOptions; // options of alphabetical index
495 } aData;
497 USHORT nCreateType; // sources to create the index from
498 USHORT nOLEOptions; // OLE sources
499 SwCaptionDisplay eCaptionDisplay; //
500 BOOL bProtected : 1; // index protected ?
501 BOOL bFromChapter : 1; // create from chapter or document
502 BOOL bFromObjectNames : 1; // create a table or object index
503 // from the names rather than the caption
504 BOOL bLevelFromChapter : 1; // User index: get the level from the source chapter
505 public:
506 SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
507 USHORT nCreaType, const String& rTitle );
508 SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 );
509 virtual ~SwTOXBase();
511 virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
513 // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
514 // If not, so create it an copy all other used things. The return is this
515 SwTOXBase& CopyTOXBase( SwDoc*, const SwTOXBase& );
517 const SwTOXType* GetTOXType() const; //
519 USHORT GetCreateType() const; // creation types
521 const String& GetTOXName() const {return aName;}
522 void SetTOXName(const String& rSet) {aName = rSet;}
524 const String& GetTitle() const; // Title
525 const String& GetTypeName() const; // Name
526 const SwForm& GetTOXForm() const; // description of the lines
528 void SetCreate(USHORT);
529 void SetTitle(const String& rTitle);
530 void SetTOXForm(const SwForm& rForm);
532 TOXTypes GetType() const;
534 const String& GetMainEntryCharStyle() const {return sMainEntryCharStyle;}
535 void SetMainEntryCharStyle(const String& rSet) {sMainEntryCharStyle = rSet;}
537 // content index only
538 inline void SetLevel(USHORT); // consider outline level
539 inline USHORT GetLevel() const;
541 // alphabetical index only
542 inline USHORT GetOptions() const; // alphabetical index options
543 inline void SetOptions(USHORT nOpt);
545 // index of objects
546 USHORT GetOLEOptions() const {return nOLEOptions;}
547 void SetOLEOptions(USHORT nOpt) {nOLEOptions = nOpt;}
549 // index of objects
551 // user defined index only
552 inline void SetTemplateName(const String& rName); // Absatzlayout beachten
554 const String& GetStyleNames(USHORT nLevel) const
556 DBG_ASSERT( nLevel < MAXLEVEL, "Which level?");
557 return aStyleNames[nLevel];
559 void SetStyleNames(const String& rSet, USHORT nLevel)
561 DBG_ASSERT( nLevel < MAXLEVEL, "Which level?");
562 aStyleNames[nLevel] = rSet;
564 BOOL IsFromChapter() const { return bFromChapter;}
565 void SetFromChapter(BOOL bSet) { bFromChapter = bSet;}
567 BOOL IsFromObjectNames() const {return bFromObjectNames;}
568 void SetFromObjectNames(BOOL bSet) {bFromObjectNames = bSet;}
570 BOOL IsLevelFromChapter() const {return bLevelFromChapter;}
571 void SetLevelFromChapter(BOOL bSet) {bLevelFromChapter = bSet;}
573 BOOL IsProtected() const { return bProtected; }
574 void SetProtected(BOOL bSet) { bProtected = bSet; }
576 const String& GetSequenceName() const {return sSequenceName;}
577 void SetSequenceName(const String& rSet) {sSequenceName = rSet;}
579 SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;}
580 void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;}
582 BOOL IsTOXBaseInReadonly() const;
584 const SfxItemSet* GetAttrSet() const;
585 void SetAttrSet( const SfxItemSet& );
587 LanguageType GetLanguage() const {return eLanguage;}
588 void SetLanguage(LanguageType nLang) {eLanguage = nLang;}
590 const String& GetSortAlgorithm()const {return sSortAlgorithm;}
591 void SetSortAlgorithm(const String& rSet) {sSortAlgorithm = rSet;}
592 // #i21237#
593 void AdjustTabStops(SwDoc & rDoc, BOOL bDefaultRightTabStop);
594 SwTOXBase& operator=(const SwTOXBase& rSource);
598 /*--------------------------------------------------------------------
599 Description: Inlines
600 --------------------------------------------------------------------*/
603 //SwTOXMark
605 inline const String& SwTOXMark::GetAlternativeText() const
606 { return aAltText; }
608 inline const SwTOXType* SwTOXMark::GetTOXType() const
609 { return (SwTOXType*)GetRegisteredIn(); }
611 inline BOOL SwTOXMark::IsAlternativeText() const
612 { return aAltText.Len() > 0; }
614 inline void SwTOXMark::SetAlternativeText(const String& rAlt)
616 aAltText = rAlt;
619 inline void SwTOXMark::SetLevel( USHORT nLvl )
621 ASSERT( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
622 nLevel = nLvl;
625 inline void SwTOXMark::SetPrimaryKey( const String& rKey )
627 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
628 aPrimaryKey = rKey;
631 inline void SwTOXMark::SetSecondaryKey( const String& rKey )
633 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
634 aSecondaryKey = rKey;
637 inline void SwTOXMark::SetTextReading( const String& rTxt )
639 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
640 aTextReading = rTxt;
643 inline void SwTOXMark::SetPrimaryKeyReading( const String& rKey )
645 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
646 aPrimaryKeyReading = rKey;
649 inline void SwTOXMark::SetSecondaryKeyReading( const String& rKey )
651 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
652 aSecondaryKeyReading = rKey;
655 inline USHORT SwTOXMark::GetLevel() const
657 ASSERT( !GetTOXType() || GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
658 return nLevel;
661 inline const String& SwTOXMark::GetPrimaryKey() const
663 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
664 return aPrimaryKey;
667 inline const String& SwTOXMark::GetSecondaryKey() const
669 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
670 return aSecondaryKey;
673 inline const String& SwTOXMark::GetTextReading() const
675 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
676 return aTextReading;
679 inline const String& SwTOXMark::GetPrimaryKeyReading() const
681 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
682 return aPrimaryKeyReading;
685 inline const String& SwTOXMark::GetSecondaryKeyReading() const
687 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
688 return aSecondaryKeyReading;
692 //SwForm
694 inline void SwForm::SetTemplate(USHORT nLevel, const String& rTemplate)
696 ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
697 aTemplate[nLevel] = rTemplate;
700 inline const String& SwForm::GetTemplate(USHORT nLevel) const
702 ASSERT(nLevel < GetFormMax(), "Index >= FORM_MAX");
703 return aTemplate[nLevel];
706 inline TOXTypes SwForm::GetTOXType() const
708 return eType;
711 inline USHORT SwForm::GetFormMax() const
713 return nFormMaxLevel;
718 //SwTOXType
720 inline const String& SwTOXType::GetTypeName() const
721 { return aName; }
723 inline TOXTypes SwTOXType::GetType() const
724 { return eType; }
727 // SwTOXBase
729 inline const SwTOXType* SwTOXBase::GetTOXType() const
730 { return (SwTOXType*)GetRegisteredIn(); }
732 inline USHORT SwTOXBase::GetCreateType() const
733 { return nCreateType; }
735 inline const String& SwTOXBase::GetTitle() const
736 { return aTitle; }
738 inline const String& SwTOXBase::GetTypeName() const
739 { return GetTOXType()->GetTypeName(); }
741 inline const SwForm& SwTOXBase::GetTOXForm() const
742 { return aForm; }
744 inline void SwTOXBase::AdjustTabStops(SwDoc & rDoc, BOOL bDefaultRightTabStop)
746 aForm.AdjustTabStops(rDoc, bDefaultRightTabStop);
749 inline void SwTOXBase::SetCreate(USHORT nCreate)
750 { nCreateType = nCreate; }
752 inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
753 { aForm = rForm; }
755 inline TOXTypes SwTOXBase::GetType() const
756 { return GetTOXType()->GetType(); }
758 inline void SwTOXBase::SetLevel(USHORT nLev)
760 ASSERT(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
761 aData.nLevel = nLev;
764 inline USHORT SwTOXBase::GetLevel() const
766 ASSERT(GetTOXType()->GetType() != TOX_INDEX, "Falscher Feldtyp");
767 return aData.nLevel;
770 inline void SwTOXBase::SetTemplateName(const String& rName)
772 // ASSERT(GetTOXType()->GetType() == TOX_USER, "Falscher Feldtyp");
773 // ASSERT(aData.pTemplateName, "pTemplateName == 0");
774 // (*aData.pTemplateName) = rName;
775 DBG_WARNING("SwTOXBase::SetTemplateName obsolete");
776 aStyleNames[0] = rName;
780 inline USHORT SwTOXBase::GetOptions() const
782 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
783 return aData.nOptions;
786 inline void SwTOXBase::SetOptions(USHORT nOpt)
788 ASSERT(GetTOXType()->GetType() == TOX_INDEX, "Falscher Feldtyp");
789 aData.nOptions = nOpt;
793 #endif // SW_TOX_HXX