LibreOffice Module sw (master)  1
tox.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_INC_TOX_HXX
20 #define INCLUDED_SW_INC_TOX_HXX
21 
22 #include <cppuhelper/weakref.hxx>
23 #include <sal/log.hxx>
24 
25 #include <i18nlangtag/lang.h>
26 #include <svl/poolitem.hxx>
27 
28 #include <editeng/svxenum.hxx>
29 #include "swtypes.hxx"
30 #include "toxe.hxx"
31 #include "calbck.hxx"
32 #include <o3tl/typed_flags_set.hxx>
33 
34 #include <vector>
35 
36 namespace com { namespace sun { namespace star {
37  namespace text { class XDocumentIndexMark; }
38 } } }
39 
40 class SwTOXType;
41 class SwTOXMark;
42 class SwTextTOXMark;
43 class SwDoc;
45 
46 typedef std::vector<SwTOXMark*> SwTOXMarks;
47 
48 // Entry of content index, alphabetical index or user defined index
49 
50 extern const sal_Unicode C_NUM_REPL;
51 extern const sal_Unicode C_END_PAGE_NUM;
52 extern const OUString S_PAGE_DELI;
53 
55  : public SfxPoolItem
56  , public SwModify
57 {
58  friend void InitCore();
59  friend class SwTextTOXMark;
60 
61  OUString m_aAltText; // Text of caption is different.
62  OUString m_aPrimaryKey;
63  OUString m_aSecondaryKey;
64 
65  // three more strings for phonetic sorting
66  OUString m_aTextReading;
69 
71 
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
77 
78  css::uno::WeakReference<css::text::XDocumentIndexMark> m_wXDocumentIndexMark;
79 
80  SwTOXMark(); // to create the default attribute in InitCore
81 
82 protected:
83  // SwClient
84  virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) override;
85 
86 public:
87 
88  // single argument ctors shall be explicit.
89  explicit SwTOXMark( const SwTOXType* pTyp );
90  virtual ~SwTOXMark() override;
91 
92  SwTOXMark( const SwTOXMark& rCopy );
93  SwTOXMark& operator=( const SwTOXMark& rCopy );
94 
95  // "pure virtual methods" of SfxPoolItem
96  virtual bool operator==( const SfxPoolItem& ) const override;
97  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
98 
99  void InvalidateTOXMark();
100 
101  OUString GetText(SwRootFrame const* pLayout) const;
102 
103  inline bool IsAlternativeText() const;
104  inline const OUString& GetAlternativeText() const;
105 
106  inline void SetAlternativeText( const OUString& rAlt );
107 
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;
115 
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);
122 
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;
128 
129  bool IsAutoGenerated() const {return m_bAutoGenerated;}
130  void SetAutoGenerated(bool bSet) {m_bAutoGenerated = bSet;}
131 
132  bool IsMainEntry() const {return m_bMainEntry;}
133  void SetMainEntry(bool bSet) { m_bMainEntry = bSet;}
134 
135  inline const SwTOXType* GetTOXType() const;
136 
137  const SwTextTOXMark* GetTextTOXMark() const { return m_pTextAttr; }
138  SwTextTOXMark* GetTextTOXMark() { return m_pTextAttr; }
139 
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 );
146 };
147 
148 // index types
149 class SwTOXType : public SwModify
150 {
151 public:
152  SwTOXType(TOXTypes eTyp, const OUString& aName);
153 
154  // @@@ public copy ctor, but no copy assignment?
155  SwTOXType(const SwTOXType& rCopy);
156 
157  inline const OUString& GetTypeName() const;
158  inline TOXTypes GetType() const;
159 
160 private:
161  OUString const m_aName;
163 
164  // @@@ public copy ctor, but no copy assignment?
165  SwTOXType & operator= (const SwTOXType &) = delete;
166 };
167 
168 // Structure of the index lines
169 #define FORM_TITLE 0
170 #define FORM_ALPHA_DELIMITTER 1
171 #define FORM_PRIMARY_KEY 2
172 #define FORM_SECONDARY_KEY 3
173 #define FORM_ENTRY 4
174 
175 /*
176  Pattern structure
177 
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>
188  */
189 
190 // These enum values are stored and must not be changed!
192 {
204 };
205 
207 {
208  OUString sText;
209  OUString sCharStyleName;
212  sal_uInt16 nPoolId;
214  sal_uInt16 nChapterFormat; //SwChapterFormat;
215  sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
216  sal_uInt16 nAuthorityField; //enum ToxAuthorityField
218  bool bWithTab; // true: do generate tab
219  // character only the tab stop
220  // #i21237#
221 
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#
232  {}
233 
234  OUString GetString() const;
235 };
236 
238 {
240 
242  bool operator()(const SwFormToken & rToken)
243  {
244  return rToken.eTokenType == eType;
245  }
246 };
247 
249 typedef std::vector<SwFormToken> SwFormTokens;
250 
256 {
259 
260 public:
266  SwFormTokensHelper(const OUString & rStr);
267 
273  const SwFormTokens & GetTokens() const { return m_Tokens; }
274 };
275 
277 {
278  SwFormTokens m_aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
279  OUString m_aTemplate[ AUTH_TYPE_END + 1 ];
280 
282  sal_uInt16 m_nFormMaxLevel;
283 
284  bool m_bIsRelTabPos : 1;
285  bool m_bCommaSeparated : 1;
286 
287 public:
288  SwForm( TOXTypes eTOXType = TOX_CONTENT );
289  SwForm( const SwForm& rForm );
290 
291  SwForm& operator=( const SwForm& rForm );
292 
293  inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName);
294  inline OUString const & GetTemplate(sal_uInt16 nLevel) const;
295 
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;
300 
301  // fill tab stop positions from template to pattern- #i21237#
302  void AdjustTabStops( SwDoc const & rDoc );
303 
304  inline TOXTypes GetTOXType() const;
305  inline sal_uInt16 GetFormMax() const;
306 
307  bool IsRelTabPos() const { return m_bIsRelTabPos; }
308  void SetRelTabPos( bool b ) { m_bIsRelTabPos = b; }
309 
310  bool IsCommaSeparated() const { return m_bCommaSeparated;}
311  void SetCommaSeparated( bool b) { m_bCommaSeparated = b;}
312 
313  static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
314 
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();
325 };
326 
327 // Content to create indexes of
328 enum class SwTOXElement : sal_uInt16
329 {
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,
345 };
346 namespace o3tl {
347  template<> struct typed_flags<SwTOXElement> : is_typed_flags<SwTOXElement, 0x3fff> {};
348 }
349 
350 enum class SwTOIOptions : sal_uInt16
351 {
352  NONE = 0x00,
353  SameEntry = 0x01,
354  FF = 0x02,
355  CaseSensitive = 0x04,
356  KeyAsEntry = 0x08,
357  AlphaDelimiter = 0x10,
358  Dash = 0x20,
359  InitialCaps = 0x40,
360 };
361 namespace o3tl {
362  template<> struct typed_flags<SwTOIOptions> : is_typed_flags<SwTOIOptions, 0x7f> {};
363 }
364 
365 //which part of the caption is to be displayed
367 {
371 };
372 
373 enum class SwTOOElements : sal_uInt16
374 {
375  NONE = 0x00,
376  Math = 0x01,
377  Chart = 0x02,
378  Calc = 0x08,
379  DrawImpress = 0x10,
380  Other = 0x80,
381 };
382 namespace o3tl {
383  template<> struct typed_flags<SwTOOElements> : is_typed_flags<SwTOOElements, 0x9b> {};
384 }
385 
386 #define TOX_STYLE_DELIMITER u'\x0001'
387 
388 // Class for all indexes
390 {
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
396 
397  OUString m_sMainEntryCharStyle; // name of the character style applied to main index entries
398 
399  OUString m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
400  OUString m_sSequenceName; // FieldTypeName of a caption sequence
401 
404 
405  union {
406  sal_uInt16 nLevel; // consider outline levels
407  SwTOIOptions nOptions; // options of alphabetical index
408  } m_aData;
409 
410  SwTOXElement m_nCreateType; // sources to create the index from
411  SwTOOElements m_nOLEOptions; // OLE sources
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
418 
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
424 
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;
430 
431  virtual bool GetInfo( SfxPoolItem& rInfo ) const override;
432 
433  // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
434  // If not, so create it an copy all other used things.
435  void CopyTOXBase( SwDoc*, const SwTOXBase& );
436 
437  const SwTOXType* GetTOXType() const;
438 
439  SwTOXElement GetCreateType() const; // creation types
440 
441  const OUString& GetTOXName() const {return m_aName;}
442  void SetTOXName(const OUString& rSet) {m_aName = rSet;}
443 
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;}
449 
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
454 
455  void SetCreate(SwTOXElement);
456  void SetTitle(const OUString& rTitle);
457  void SetTOXForm(const SwForm& rForm);
458  void SetBookmarkName(const OUString& bName);
459 
460  TOXTypes GetType() const;
461 
462  const OUString& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;}
463  void SetMainEntryCharStyle(const OUString& rSet) {m_sMainEntryCharStyle = rSet;}
464 
465  // for record the Index field expression of MS Word
466  const OUString& GetEntryTypeName() const;
467  void SetEntryTypeName(const OUString& sName);
468 
469  // content index only
470  inline void SetLevel(sal_uInt16); // consider outline level
471  inline sal_uInt16 GetLevel() const;
472 
473  // alphabetical index only
474  inline SwTOIOptions GetOptions() const; // alphabetical index options
475  inline void SetOptions(SwTOIOptions nOpt);
476 
477  // index of objects
478  SwTOOElements GetOLEOptions() const {return m_nOLEOptions;}
479  void SetOLEOptions(SwTOOElements nOpt) {m_nOLEOptions = nOpt;}
480 
481  // index of objects
482 
483  OUString const & GetStyleNames(sal_uInt16 nLevel) const
484  {
485  SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
486  return m_aStyleNames[nLevel];
487  }
488  void SetStyleNames(const OUString& rSet, sal_uInt16 nLevel)
489  {
490  SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
491  m_aStyleNames[nLevel] = rSet;
492  }
493  bool IsFromChapter() const { return m_bFromChapter;}
494  void SetFromChapter(bool bSet) { m_bFromChapter = bSet;}
495 
496  bool IsFromObjectNames() const {return m_bFromObjectNames;}
497  void SetFromObjectNames(bool bSet) {m_bFromObjectNames = bSet;}
498 
499  bool IsLevelFromChapter() const {return m_bLevelFromChapter;}
500  void SetLevelFromChapter(bool bSet) {m_bLevelFromChapter = bSet;}
501 
502  bool IsProtected() const { return m_bProtected; }
503  void SetProtected(bool bSet) { m_bProtected = bSet; }
504 
505  const OUString& GetSequenceName() const {return m_sSequenceName;}
506  void SetSequenceName(const OUString& rSet) {m_sSequenceName = rSet;}
507 
508  SwCaptionDisplay GetCaptionDisplay() const { return m_eCaptionDisplay;}
509  void SetCaptionDisplay(SwCaptionDisplay eSet) {m_eCaptionDisplay = eSet;}
510 
511  bool IsTOXBaseInReadonly() const;
512 
513  const SfxItemSet* GetAttrSet() const;
514  void SetAttrSet( const SfxItemSet& );
515 
516  LanguageType GetLanguage() const {return m_eLanguage;}
517  void SetLanguage(LanguageType nLang) {m_eLanguage = nLang;}
518 
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 )
523  {
524  m_aForm.AdjustTabStops( rDoc );
525  }
526 
527  SwTOXBase& operator=(const SwTOXBase& rSource);
528  void RegisterToTOXType( SwTOXType& rMark );
529 };
530 
531 //SwTOXMark
532 
533 inline const OUString& SwTOXMark::GetAlternativeText() const
534  { return m_aAltText; }
535 
536 inline const OUString& SwTOXMark::GetBookmarkName() const
537  { return m_aBookmarkName; }
538 
539 inline const OUString& SwTOXMark::GetEntryTypeName() const
540  { return m_aEntryTypeName; }
541 
542 inline const SwTOXType* SwTOXMark::GetTOXType() const
543  { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
544 
545 inline bool SwTOXMark::IsAlternativeText() const
546  { return !m_aAltText.isEmpty(); }
547 
548 inline void SwTOXMark::SetAlternativeText(const OUString& rAlt)
549 {
550  m_aAltText = rAlt;
551 }
552 
553 inline void SwTOXMark::SetBookmarkName(const OUString& bName)
554 {
555  m_aBookmarkName = bName;
556 }
557 
558 inline void SwTOXMark::SetEntryTypeName(const OUString& sName)
559 {
560  m_aEntryTypeName = sName;
561 }
562 inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
563 {
564  SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
565  m_nLevel = nLvl;
566 }
567 
568 inline void SwTOXMark::SetPrimaryKey( const OUString& rKey )
569 {
570  SAL_WARN_IF( GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
571  m_aPrimaryKey = rKey;
572 }
573 
574 inline void SwTOXMark::SetSecondaryKey( const OUString& rKey )
575 {
576  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
577  m_aSecondaryKey = rKey;
578 }
579 
580 inline void SwTOXMark::SetTextReading( const OUString& rText )
581 {
582  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
583  m_aTextReading = rText;
584 }
585 
586 inline void SwTOXMark::SetPrimaryKeyReading( const OUString& rKey )
587 {
588  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
589  m_aPrimaryKeyReading = rKey;
590 }
591 
592 inline void SwTOXMark::SetSecondaryKeyReading( const OUString& rKey )
593 {
594  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
595  m_aSecondaryKeyReading = rKey;
596 }
597 
598 inline sal_uInt16 SwTOXMark::GetLevel() const
599 {
600  SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
601  return m_nLevel;
602 }
603 
604 inline OUString const & SwTOXMark::GetPrimaryKey() const
605 {
606  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
607  return m_aPrimaryKey;
608 }
609 
610 inline OUString const & SwTOXMark::GetSecondaryKey() const
611 {
612  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
613  return m_aSecondaryKey;
614 }
615 
616 inline OUString const & SwTOXMark::GetTextReading() const
617 {
618  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
619  return m_aTextReading;
620 }
621 
622 inline OUString const & SwTOXMark::GetPrimaryKeyReading() const
623 {
624  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
625  return m_aPrimaryKeyReading;
626 }
627 
628 inline OUString const & SwTOXMark::GetSecondaryKeyReading() const
629 {
630  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
631  return m_aSecondaryKeyReading;
632 }
633 
634 //SwForm
635 
636 inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate)
637 {
638  SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
639  m_aTemplate[nLevel] = rTemplate;
640 }
641 
642 inline OUString const & SwForm::GetTemplate(sal_uInt16 nLevel) const
643 {
644  SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
645  return m_aTemplate[nLevel];
646 }
647 
649 {
650  return m_eType;
651 }
652 
653 inline sal_uInt16 SwForm::GetFormMax() const
654 {
655  return m_nFormMaxLevel;
656 }
657 
658 //SwTOXType
659 
660 inline const OUString& SwTOXType::GetTypeName() const
661  { return m_aName; }
662 
664  { return m_eType; }
665 
666 // SwTOXBase
667 
668 inline const SwTOXType* SwTOXBase::GetTOXType() const
669  { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
670 
672  { return m_nCreateType; }
673 
674 inline const OUString& SwTOXBase::GetTitle() const
675  { return m_aTitle; }
676 
677 inline const OUString& SwTOXBase::GetBookmarkName() const
678  { return m_aBookmarkName; }
679 
680 inline const OUString& SwTOXBase::GetEntryTypeName() const
681  { return m_aEntryTypeName; }
682 
683 inline OUString const & SwTOXBase::GetTypeName() const
684  { return GetTOXType()->GetTypeName(); }
685 
686 inline const SwForm& SwTOXBase::GetTOXForm() const
687  { return m_aForm; }
688 
689 inline void SwTOXBase::SetCreate(SwTOXElement nCreate)
690  { m_nCreateType = nCreate; }
691 
692 inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
693  { m_aForm = rForm; }
694 
696  { return GetTOXType()->GetType(); }
697 
698 inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
699 {
700  SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
701  m_aData.nLevel = nLev;
702 }
703 
704 inline sal_uInt16 SwTOXBase::GetLevel() const
705 {
706  SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
707  return m_aData.nLevel;
708 }
709 
711 {
712  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
713  return m_aData.nOptions;
714 }
715 
717 {
718  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
719  m_aData.nOptions = nOpt;
720 }
721 
722 #endif // INCLUDED_SW_INC_TOX_HXX
723 
724 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TOXTypes GetTOXType() const
Definition: tox.hxx:648
FormTokenType const eType
Definition: tox.hxx:239
const SwFormTokens & GetTokens() const
Returns vector of tokens.
Definition: tox.hxx:273
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
Definition: tox.hxx:249
SwCaptionDisplay m_eCaptionDisplay
Definition: tox.hxx:412
void SetLevelFromChapter(bool bSet)
Definition: tox.hxx:500
TOXTypes
Definition: toxe.hxx:39
void SetLanguage(LanguageType nLang)
Definition: tox.hxx:517
SAL_DLLPRIVATE css::uno::WeakReference< css::text::XDocumentIndexMark > const & GetXTOXMark() const
Definition: tox.hxx:140
SwTOXType & operator=(const SwTOXType &)=delete
bool IsAlternativeText() const
Definition: tox.hxx:545
OUString const & GetSecondaryKeyReading() const
Definition: tox.hxx:628
SwTOIOptions
Definition: tox.hxx:350
SwTOXElement GetCreateType() const
Definition: tox.hxx:671
SwTOIOptions GetOptions() const
Definition: tox.hxx:710
OUString m_sSequenceName
Definition: tox.hxx:400
SwTextTOXMark * m_pTextAttr
Definition: tox.hxx:70
void DisableKeepExpression()
Definition: tox.hxx:448
virtual bool operator==(const SfxPoolItem &) const =0
OUString const & GetPrimaryKey() const
Definition: tox.hxx:604
SwFormToken(FormTokenType eType)
Definition: tox.hxx:222
bool IsProtected() const
Definition: tox.hxx:502
const OUString & GetBookmarkName() const
Definition: tox.hxx:536
sal_uInt16 nOutlineLevel
Definition: tox.hxx:215
void SetLevel(sal_uInt16 nLevel)
Definition: tox.hxx:562
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
SwTOOElements
Definition: tox.hxx:373
Definition: tox.hxx:276
OUString m_aTitle
Definition: tox.hxx:393
OUString m_aBookmarkName
Definition: tox.hxx:394
SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference< css::text::XDocumentIndexMark > const &xMark)
Definition: tox.hxx:142
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:44
bool operator()(const SwFormToken &rToken)
Definition: tox.hxx:242
OUString const & GetTemplate(sal_uInt16 nLevel) const
Definition: tox.hxx:642
void SetEntryTypeName(const OUString &sName)
Definition: tox.hxx:558
Definition: doc.hxx:185
OUString const & GetTypeName() const
Definition: tox.hxx:683
SfxPoolItem & operator=(const SfxPoolItem &)=delete
const OUString & GetEntryTypeName() const
Definition: tox.hxx:680
long SwTwips
Definition: swtypes.hxx:49
sal_uInt16 m_nFormMaxLevel
Definition: tox.hxx:282
css::uno::WeakReference< css::text::XDocumentIndexMark > m_wXDocumentIndexMark
Definition: tox.hxx:78
sal_uInt16 GetFormMax() const
Definition: tox.hxx:653
SwFormTokens m_Tokens
the tokens
Definition: tox.hxx:258
const SwTOXType * GetTOXType() const
Definition: tox.hxx:542
sal_uInt16 nLevel
Definition: tox.hxx:406
sal_uInt16 nPoolId
Definition: tox.hxx:212
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
bool bWithTab
Definition: tox.hxx:218
void SetOptions(SwTOIOptions nOpt)
Definition: tox.hxx:716
SwTextTOXMark * GetTextTOXMark()
Definition: tox.hxx:138
sal_Unicode cTabFillChar
Definition: tox.hxx:217
void SetOLEOptions(SwTOOElements nOpt)
Definition: tox.hxx:479
static LanguageType nLang
Definition: srtdlg.cxx:58
SwTOIOptions nOptions
Definition: tox.hxx:407
void SetRelTabPos(bool b)
Definition: tox.hxx:308
OUString GetString(int nId)
void SetCreate(SwTOXElement)
Definition: tox.hxx:689
sal_uInt16 sal_Unicode
OUString const & GetPrimaryKeyReading() const
Definition: tox.hxx:622
const SwTOXType * GetTOXType() const
Definition: tox.hxx:668
SwTOXElement m_nCreateType
Definition: tox.hxx:410
void AdjustTabStops(SwDoc const &rDoc)
Definition: tox.hxx:522
UNOTOOLS_DLLPUBLIC bool GetTitle(OUString const &url, OUString *title)
const OUString S_PAGE_DELI
void SetTemplate(sal_uInt16 nLevel, const OUString &rName)
Definition: tox.hxx:636
OUString sText
Definition: tox.hxx:208
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
bool IsAutoGenerated() const
Definition: tox.hxx:129
sal_uInt16 m_nLevel
Definition: tox.hxx:72
void SetSortAlgorithm(const OUString &rSet)
Definition: tox.hxx:520
const OUString & GetSequenceName() const
Definition: tox.hxx:505
OUString m_aTextReading
Definition: tox.hxx:66
void SetAlternativeText(const OUString &rAlt)
Definition: tox.hxx:548
SwTOOElements GetOLEOptions() const
Definition: tox.hxx:478
LanguageType m_eLanguage
Definition: tox.hxx:402
OUString maMSTOCExpression
Definition: tox.hxx:422
const sal_Unicode C_END_PAGE_NUM
Definition: tox.cxx:47
const OUString & GetAlternativeText() const
Definition: tox.hxx:533
const OUString & GetEntryTypeName() const
Definition: tox.hxx:539
SwTOXType(TOXTypes eTyp, const OUString &aName)
Definition: tox.cxx:201
OUString const m_aName
Definition: tox.hxx:161
void SetPrimaryKey(const OUString &rStr)
Definition: tox.hxx:568
SwTOXElement
Definition: tox.hxx:328
void SetTextReading(const OUString &rStr)
Definition: tox.hxx:580
FormTokenType eTokenType
Definition: tox.hxx:211
OUString sCharStyleName
Definition: tox.hxx:209
bool IsFromObjectNames() const
Definition: tox.hxx:496
void SetSequenceName(const OUString &rSet)
Definition: tox.hxx:506
void SetMainEntryCharStyle(const OUString &rSet)
Definition: tox.hxx:463
sal_uInt16 GetLevel() const
Definition: tox.hxx:598
void SetCaptionDisplay(SwCaptionDisplay eSet)
Definition: tox.hxx:509
void SetPrimaryKeyReading(const OUString &rStr)
Definition: tox.hxx:586
void SetFromChapter(bool bSet)
Definition: tox.hxx:494
OUString m_aEntryTypeName
Definition: tox.hxx:74
const OUString & GetTypeName() const
Definition: tox.hxx:660
union SwTOXBase::@31 m_aData
SwTOOElements m_nOLEOptions
Definition: tox.hxx:411
sal_uInt16 nChapterFormat
Definition: tox.hxx:214
sal_uInt16 nAuthorityField
Definition: tox.hxx:216
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool IsFromChapter() const
Definition: tox.hxx:493
sal_uInt16 GetLevel() const
Definition: tox.hxx:704
OUString m_aSecondaryKey
Definition: tox.hxx:63
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: calbck.hxx:183
SwForm m_aForm
Definition: tox.hxx:391
const OUString & GetTitle() const
Definition: tox.hxx:674
OUString const & GetTextReading() const
Definition: tox.hxx:616
SwCaptionDisplay GetCaptionDisplay() const
Definition: tox.hxx:508
OUString m_sSortAlgorithm
Definition: tox.hxx:403
void SetAutoGenerated(bool bSet)
Definition: tox.hxx:130
const OUString & GetSortAlgorithm() const
Definition: tox.hxx:519
void SetTOXForm(const SwForm &rForm)
Definition: tox.hxx:692
const sal_Unicode C_NUM_REPL
Definition: tox.cxx:46
OUString m_aAltText
Definition: tox.hxx:61
const OUString & GetBookmarkName() const
Definition: tox.hxx:677
void InitCore()
Definition: init.cxx:449
bool IsRelTabPos() const
Definition: tox.hxx:307
void SetTOXName(const OUString &rSet)
Definition: tox.hxx:442
SwTwips nTabStopPosition
Definition: tox.hxx:210
OUString m_aSecondaryKeyReading
Definition: tox.hxx:68
OUString const & GetSecondaryKey() const
Definition: tox.hxx:610
#define SAL_WARN_IF(condition, area, stream)
OUString m_aEntryTypeName
Definition: tox.hxx:395
TOXTypes GetType() const
Definition: tox.hxx:695
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:259
OUString const & GetStyleNames(sal_uInt16 nLevel) const
Definition: tox.hxx:483
bool mbKeepExpression
Definition: tox.hxx:423
void SetStyleNames(const OUString &rSet, sal_uInt16 nLevel)
Definition: tox.hxx:488
LanguageType GetLanguage() const
Definition: tox.hxx:516
bool IsCommaSeparated() const
Definition: tox.hxx:310
TOXTypes m_eType
Definition: tox.hxx:281
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
void SetBookmarkName(const OUString &bName)
Definition: tox.hxx:553
OUString m_sMainEntryCharStyle
Definition: tox.hxx:397
OUString m_aTemplate[AUTH_TYPE_END+1]
Definition: tox.hxx:279
TOXTypes const m_eType
Definition: tox.hxx:162
void EnableKeepExpression()
Definition: tox.hxx:447
WriterListener & operator=(WriterListener const &)=delete
void SetSecondaryKey(const OUString &rStr)
Definition: tox.hxx:574
const OUString & GetMainEntryCharStyle() const
Definition: tox.hxx:462
TOXTypes GetType() const
Definition: tox.hxx:663
virtual bool GetInfo(SfxPoolItem &) const
Definition: calbck.hxx:164
SwFormTokenEqualToFormTokenType(FormTokenType _eType)
Definition: tox.hxx:241
void SetProtected(bool bSet)
Definition: tox.hxx:503
def text(shape, st)
OString const aName
bool IsMainEntry() const
Definition: tox.hxx:132
SvxTabAdjust eTabAlign
Definition: tox.hxx:213
OUString m_aBookmarkName
Definition: tox.hxx:73
Left
const SwTextTOXMark * GetTextTOXMark() const
Definition: tox.hxx:137
void SetLevel(sal_uInt16)
Definition: tox.hxx:698
OUString m_aPrimaryKey
Definition: tox.hxx:62
void SetCommaSeparated(bool b)
Definition: tox.hxx:311
Helper class that converts vectors of tokens to strings and vice versa.
Definition: tox.hxx:255
const SwForm & GetTOXForm() const
Definition: tox.hxx:686
void SetSecondaryKeyReading(const OUString &rStr)
Definition: tox.hxx:592
SwCaptionDisplay
Definition: tox.hxx:366
void AdjustTabStops(SwDoc const &rDoc)
Definition: tox.cxx:451
void SetMainEntry(bool bSet)
Definition: tox.hxx:133
FormTokenType
Definition: tox.hxx:191
void SetMSTOCExpression(const OUString &rExp)
Definition: tox.hxx:446
void SetFromObjectNames(bool bSet)
Definition: tox.hxx:497
const OUString & GetMSTOCExpression() const
Definition: tox.hxx:445
bool IsLevelFromChapter() const
Definition: tox.hxx:499
const OUString & GetTOXName() const
Definition: tox.hxx:441
SvxTabAdjust
OUString m_aPrimaryKeyReading
Definition: tox.hxx:67
OUString m_aName
Definition: tox.hxx:392