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 #include <svl/listener.hxx>
28 
29 #include <editeng/svxenum.hxx>
30 #include "swtypes.hxx"
31 #include "toxe.hxx"
32 #include "calbck.hxx"
33 #include <o3tl/typed_flags_set.hxx>
34 
35 #include <vector>
36 
37 namespace com::sun::star {
38  namespace text { class XDocumentIndexMark; }
39 }
40 class SwTOXType;
41 class SwTOXMark;
42 class SwTextTOXMark;
43 class SwDoc;
44 class SwRootFrame;
46 
47 
48 typedef std::vector<SwTOXMark*> SwTOXMarks;
49 
50 namespace sw {
51  struct CollectTextMarksHint final : SfxHint {
53  CollectTextMarksHint(SwTOXMarks& rMarks) : m_rMarks(rMarks) {}
54  };
55  struct FindContentFrameHint final : SfxHint {
57  const SwDoc& m_rDoc;
60  FindContentFrameHint(SwContentFrame*& rpContentFrame, const SwDoc& rDoc, const SwRootFrame& rLayout, const bool isReadOnlyAvailable)
61  : m_rpContentFrame(rpContentFrame)
62  , m_rDoc(rDoc)
63  , m_rLayout(rLayout)
64  , m_isReadOnlyAvailable(isReadOnlyAvailable)
65  {}
66  };
68  std::vector<std::reference_wrapper<SwTextTOXMark>>& m_rMarks;
70  CollectTextTOXMarksForLayoutHint(std::vector<std::reference_wrapper<SwTextTOXMark>>& rMarks, const SwRootFrame* pLayout) : m_rMarks(rMarks), m_pLayout(pLayout) {}
71  };
72 }
73 
74 // Entry of content index, alphabetical index or user defined index
75 
76 extern const sal_Unicode C_NUM_REPL;
77 extern const sal_Unicode C_END_PAGE_NUM;
78 extern const OUString S_PAGE_DELI;
79 
81  : public SfxPoolItem
82  , public sw::BroadcastingModify
83  , public SvtListener
84 {
85  friend void InitCore();
86  friend class SwTextTOXMark;
87 
89  OUString m_aAltText; // Text of caption is different.
90  OUString m_aPrimaryKey;
91  OUString m_aSecondaryKey;
92 
93  // three more strings for phonetic sorting
94  OUString m_aTextReading;
97 
99 
100  sal_uInt16 m_nLevel;
101  OUString m_aBookmarkName;
102  OUString m_aEntryTypeName; // stored specific entry type name for INDEX field \f
103  bool m_bAutoGenerated; // generated using a concordance file
104  bool m_bMainEntry; // main entry emphasized by character style
105 
106  css::uno::WeakReference<css::text::XDocumentIndexMark> m_wXDocumentIndexMark;
107 
108  SwTOXMark(); // to create the default attribute in InitCore
109 
110  virtual void Notify(const SfxHint& rHint) override;
111 
112 public:
113 
114  // single argument ctors shall be explicit.
115  explicit SwTOXMark( const SwTOXType* pTyp );
116  virtual ~SwTOXMark() override;
117 
118  SwTOXMark( const SwTOXMark& rCopy );
119  SwTOXMark& operator=( const SwTOXMark& rCopy );
120 
121  // "pure virtual methods" of SfxPoolItem
122  virtual bool operator==( const SfxPoolItem& ) const override;
123  virtual SwTOXMark* Clone( SfxItemPool* pPool = nullptr ) const override;
124 
125  void InvalidateTOXMark();
126 
127  OUString GetText(SwRootFrame const* pLayout) const;
128 
129  inline bool IsAlternativeText() const;
130  inline const OUString& GetAlternativeText() const;
131 
132  inline void SetAlternativeText( const OUString& rAlt );
133 
134  // content or user defined index
135  inline void SetLevel(sal_uInt16 nLevel);
136  inline sal_uInt16 GetLevel() const;
137  inline void SetBookmarkName( const OUString& bName);
138  inline const OUString& GetBookmarkName() const;
139  inline void SetEntryTypeName( const OUString& sName);
140  inline const OUString& GetEntryTypeName() const;
141 
142  // for alphabetical index only
143  inline void SetPrimaryKey(const OUString& rStr );
144  inline void SetSecondaryKey(const OUString& rStr);
145  inline void SetTextReading(const OUString& rStr);
146  inline void SetPrimaryKeyReading(const OUString& rStr );
147  inline void SetSecondaryKeyReading(const OUString& rStr);
148 
149  inline OUString const & GetPrimaryKey() const;
150  inline OUString const & GetSecondaryKey() const;
151  inline OUString const & GetTextReading() const;
152  inline OUString const & GetPrimaryKeyReading() const;
153  inline OUString const & GetSecondaryKeyReading() const;
154 
155  bool IsAutoGenerated() const {return m_bAutoGenerated;}
156  void SetAutoGenerated(bool bSet) {m_bAutoGenerated = bSet;}
157 
158  bool IsMainEntry() const {return m_bMainEntry;}
159  void SetMainEntry(bool bSet) { m_bMainEntry = bSet;}
160 
161  inline const SwTOXType* GetTOXType() const;
162 
163  const SwTextTOXMark* GetTextTOXMark() const { return m_pTextAttr; }
164  SwTextTOXMark* GetTextTOXMark() { return m_pTextAttr; }
165 
166  SAL_DLLPRIVATE css::uno::WeakReference<css::text::XDocumentIndexMark> const& GetXTOXMark() const
167  { return m_wXDocumentIndexMark; }
168  SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference<css::text::XDocumentIndexMark> const& xMark)
169  { m_wXDocumentIndexMark = xMark; }
170  void RegisterToTOXType( SwTOXType& rMark );
171 };
172 
173 // index types
175 {
176 public:
177  SwTOXType(TOXTypes eTyp, const OUString& aName);
178 
179  // @@@ public copy ctor, but no copy assignment?
180  SwTOXType(const SwTOXType& rCopy);
181 
182  inline const OUString& GetTypeName() const;
183  inline TOXTypes GetType() const;
184  void CollectTextMarks(SwTOXMarks& rMarks) const
185  { const_cast<SwTOXType*>(this)->GetNotifier().Broadcast(sw::CollectTextMarksHint(rMarks)); }
186  SwContentFrame* FindContentFrame(const SwDoc& rDoc, const SwRootFrame& rLayout, const bool isReadOnlyAvailable) const
187  {
188  SwContentFrame* pContentFrame = nullptr;
189  const_cast<SwTOXType*>(this)->GetNotifier().Broadcast(sw::FindContentFrameHint(pContentFrame, rDoc, rLayout, isReadOnlyAvailable));
190  return pContentFrame;
191  }
192  void CollectTextTOXMarksForLayout(std::vector<std::reference_wrapper<SwTextTOXMark>>& rMarks, const SwRootFrame* pLayout) const
193  { const_cast<SwTOXType*>(this)->GetNotifier().Broadcast(sw::CollectTextTOXMarksForLayoutHint(rMarks, pLayout)); }
194 
195 
196 private:
197  OUString m_aName;
199 
200  // @@@ public copy ctor, but no copy assignment?
201  SwTOXType & operator= (const SwTOXType &) = delete;
202 };
203 
204 // Structure of the index lines
205 #define FORM_TITLE 0
206 #define FORM_ALPHA_DELIMITER 1
207 #define FORM_PRIMARY_KEY 2
208 #define FORM_SECONDARY_KEY 3
209 #define FORM_ENTRY 4
210 
211 /*
212  Pattern structure
213 
214  <E#> - entry number <E# CharStyleName,PoolId>
215  <ET> - entry text <ET CharStyleName,PoolId>
216  <E> - entry text and number <E CharStyleName,PoolId>
217  <T> - tab stop <T,,Position,Adjust>
218  <C> - chapter info n = {0, 1, 2, 3, 4 } values of SwChapterFormat <C CharStyleName,PoolId>
219  <TX> - text token <X CharStyleName,PoolId, TOX_STYLE_DELIMITERTextContentTOX_STYLE_DELIMITER>
220  <#> - Page number <# CharStyleName,PoolId>
221  <LS> - Link start <LS>
222  <LE> - Link end <LE>
223  <A00> - Authority entry field <A02 CharStyleName, PoolId>
224  */
225 
226 // These enum values are stored and must not be changed!
228 {
240 };
241 
243 {
244  OUString sText;
245  OUString sCharStyleName;
248  sal_uInt16 nPoolId;
250  sal_uInt16 nChapterFormat; //SwChapterFormat;
251  sal_uInt16 nOutlineLevel;//the maximum permitted outline level in numbering
252  sal_uInt16 nAuthorityField; //enum ToxAuthorityField
254  bool bWithTab; // true: do generate tab
255  // character only the tab stop
256  // #i21237#
257 
259  nTabStopPosition(0),
260  eTokenType(eType),
261  nPoolId(USHRT_MAX),
262  eTabAlign( SvxTabAdjust::Left ),
263  nChapterFormat(0 /*CF_NUMBER*/),
264  nOutlineLevel(MAXLEVEL), //default to maximum outline level
265  nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/),
266  cTabFillChar(' '),
267  bWithTab(true) // #i21237#
268  {}
269 
270  OUString GetString() const;
271 };
272 
274 {
276 
278  bool operator()(const SwFormToken & rToken)
279  {
280  return rToken.eTokenType == eType;
281  }
282 };
283 
285 typedef std::vector<SwFormToken> SwFormTokens;
286 
292 {
295 
296 public:
302  SwFormTokensHelper(const OUString & rStr);
303 
309  const SwFormTokens & GetTokens() const { return m_Tokens; }
310 };
311 
313 {
314  SwFormTokens m_aPattern[ AUTH_TYPE_END + 1 ]; // #i21237#
315  OUString m_aTemplate[ AUTH_TYPE_END + 1 ];
316 
318  sal_uInt16 m_nFormMaxLevel;
319 
320  bool m_bIsRelTabPos : 1;
321  bool m_bCommaSeparated : 1;
322 
323 public:
324  SwForm( TOXTypes eTOXType = TOX_CONTENT );
325  SwForm( const SwForm& rForm );
326 
327  SwForm& operator=( const SwForm& rForm );
328 
329  inline void SetTemplate(sal_uInt16 nLevel, const OUString& rName);
330  inline OUString const & GetTemplate(sal_uInt16 nLevel) const;
331 
332  // #i21237#
333  void SetPattern(sal_uInt16 nLevel, const SwFormTokens& rName);
334  void SetPattern(sal_uInt16 nLevel, const OUString& rStr);
335  const SwFormTokens& GetPattern(sal_uInt16 nLevel) const;
336 
337  // fill tab stop positions from template to pattern- #i21237#
338  void AdjustTabStops( SwDoc const & rDoc );
339 
340  inline TOXTypes GetTOXType() const;
341  inline sal_uInt16 GetFormMax() const;
342 
343  bool IsRelTabPos() const { return m_bIsRelTabPos; }
344  void SetRelTabPos( bool b ) { m_bIsRelTabPos = b; }
345 
346  bool IsCommaSeparated() const { return m_bCommaSeparated;}
347  void SetCommaSeparated( bool b) { m_bCommaSeparated = b;}
348 
349  static sal_uInt16 GetFormMaxLevel( TOXTypes eType );
350 
351  static OUString GetFormEntry();
352  static OUString GetFormTab();
353  static OUString GetFormPageNums();
354  static OUString GetFormLinkStt();
355  static OUString GetFormLinkEnd();
356  static OUString GetFormEntryNum();
357  static OUString GetFormEntryText();
358  static OUString GetFormChapterMark();
359  static OUString GetFormText();
360  static OUString GetFormAuth();
361 };
362 
363 // Content to create indexes of
364 enum class SwTOXElement : sal_uInt16
365 {
366  NONE = 0x0000,
367  Mark = 0x0001,
368  OutlineLevel = 0x0002,
369  Template = 0x0004,
370  Ole = 0x0008,
371  Table = 0x0010,
372  Graphic = 0x0020,
373  Frame = 0x0040,
374  Sequence = 0x0080,
375  TableLeader = 0x0100,
376  TableInToc = 0x0200,
377  Bookmark = 0x0400,
378  Newline = 0x0800,
379  ParagraphOutlineLevel = 0x1000,
380  IndexEntryType = 0x2000,
381 };
382 namespace o3tl {
383  template<> struct typed_flags<SwTOXElement> : is_typed_flags<SwTOXElement, 0x3fff> {};
384 }
385 
386 enum class SwTOIOptions : sal_uInt16
387 {
388  NONE = 0x00,
389  SameEntry = 0x01,
390  FF = 0x02,
391  CaseSensitive = 0x04,
392  KeyAsEntry = 0x08,
393  AlphaDelimiter = 0x10,
394  Dash = 0x20,
395  InitialCaps = 0x40,
396 };
397 namespace o3tl {
398  template<> struct typed_flags<SwTOIOptions> : is_typed_flags<SwTOIOptions, 0x7f> {};
399 }
400 
401 //which part of the caption is to be displayed
403 {
407 };
408 
409 enum class SwTOOElements : sal_uInt16
410 {
411  NONE = 0x00,
412  Math = 0x01,
413  Chart = 0x02,
414  Calc = 0x08,
415  DrawImpress = 0x10,
416  Other = 0x80,
417 };
418 namespace o3tl {
419  template<> struct typed_flags<SwTOOElements> : is_typed_flags<SwTOOElements, 0x9b> {};
420 }
421 
422 #define TOX_STYLE_DELIMITER u'\x0001'
423 
424 // Class for all indexes
426 {
427  SwForm m_aForm; // description of the lines
428  OUString m_aName; // unique name
429  OUString m_aTitle; // title
430  OUString m_aBookmarkName; //Bookmark Name
431  OUString m_aEntryTypeName; // Type name
432 
433  OUString m_sMainEntryCharStyle; // name of the character style applied to main index entries
434 
435  OUString m_aStyleNames[MAXLEVEL]; // (additional) style names TOX_CONTENT, TOX_USER
436  OUString m_sSequenceName; // FieldTypeName of a caption sequence
437 
440 
441  union {
442  sal_uInt16 nLevel; // consider outline levels
443  SwTOIOptions nOptions; // options of alphabetical index
444  } m_aData;
445 
446  SwTOXElement m_nCreateType; // sources to create the index from
447  SwTOOElements m_nOLEOptions; // OLE sources
449  bool m_bProtected : 1; // index protected ?
450  bool m_bFromChapter : 1; // create from chapter or document
451  bool m_bFromObjectNames : 1; // create a table or object index
452  // from the names rather than the caption
453  bool m_bLevelFromChapter : 1; // User index: get the level from the source chapter
454 
455 protected:
456  // Add a data member, for record the TOC field expression of MS Word binary format
457  // For keeping fidelity and may giving a better exporting performance
460 
461 public:
462  SwTOXBase( const SwTOXType* pTyp, const SwForm& rForm,
463  SwTOXElement nCreaType, const OUString& rTitle );
464  SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = nullptr );
465  virtual ~SwTOXBase() override;
466 
467  // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc.
468  // If not, so create it and copy all other used things.
469  void CopyTOXBase( SwDoc*, const SwTOXBase& );
470 
471  const SwTOXType* GetTOXType() const;
472 
473  SwTOXElement GetCreateType() const; // creation types
474 
475  const OUString& GetTOXName() const {return m_aName;}
476  void SetTOXName(const OUString& rSet) {m_aName = rSet;}
477 
478  // for record the TOC field expression of MS Word binary format
479  const OUString& GetMSTOCExpression() const{return maMSTOCExpression;}
480  void SetMSTOCExpression(const OUString& rExp) {maMSTOCExpression = rExp;}
481  void EnableKeepExpression() {mbKeepExpression = true;}
482  void DisableKeepExpression() {mbKeepExpression = false;}
483 
484  const OUString& GetTitle() const; // Title
485  const OUString& GetBookmarkName() const;
486  OUString const & GetTypeName() const; // Name
487  const SwForm& GetTOXForm() const; // description of the lines
488 
489  void SetCreate(SwTOXElement);
490  void SetTitle(const OUString& rTitle);
491  void SetTOXForm(const SwForm& rForm);
492  void SetBookmarkName(const OUString& bName);
493 
494  TOXTypes GetType() const;
495 
496  const OUString& GetMainEntryCharStyle() const {return m_sMainEntryCharStyle;}
497  void SetMainEntryCharStyle(const OUString& rSet) {m_sMainEntryCharStyle = rSet;}
498 
499  // for record the Index field expression of MS Word
500  const OUString& GetEntryTypeName() const;
501  void SetEntryTypeName(const OUString& sName);
502 
503  // content index only
504  inline void SetLevel(sal_uInt16); // consider outline level
505  inline sal_uInt16 GetLevel() const;
506 
507  // alphabetical index only
508  inline SwTOIOptions GetOptions() const; // alphabetical index options
509  inline void SetOptions(SwTOIOptions nOpt);
510 
511  // index of objects
512  SwTOOElements GetOLEOptions() const {return m_nOLEOptions;}
513  void SetOLEOptions(SwTOOElements nOpt) {m_nOLEOptions = nOpt;}
514 
515  // index of objects
516 
517  OUString const & GetStyleNames(sal_uInt16 nLevel) const
518  {
519  SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
520  return m_aStyleNames[nLevel];
521  }
522  void SetStyleNames(const OUString& rSet, sal_uInt16 nLevel)
523  {
524  SAL_WARN_IF( nLevel >= MAXLEVEL, "sw", "Which level?");
525  m_aStyleNames[nLevel] = rSet;
526  }
527  bool IsFromChapter() const { return m_bFromChapter;}
528  void SetFromChapter(bool bSet) { m_bFromChapter = bSet;}
529 
530  bool IsFromObjectNames() const {return m_bFromObjectNames;}
531  void SetFromObjectNames(bool bSet) {m_bFromObjectNames = bSet;}
532 
533  bool IsLevelFromChapter() const {return m_bLevelFromChapter;}
534  void SetLevelFromChapter(bool bSet) {m_bLevelFromChapter = bSet;}
535 
536  bool IsProtected() const { return m_bProtected; }
537  void SetProtected(bool bSet) { m_bProtected = bSet; }
538 
539  const OUString& GetSequenceName() const {return m_sSequenceName;}
540  void SetSequenceName(const OUString& rSet) {m_sSequenceName = rSet;}
541 
542  SwCaptionDisplay GetCaptionDisplay() const { return m_eCaptionDisplay;}
543  void SetCaptionDisplay(SwCaptionDisplay eSet) {m_eCaptionDisplay = eSet;}
544 
545  bool IsTOXBaseInReadonly() const;
546 
547  const SfxItemSet* GetAttrSet() const;
548  void SetAttrSet( const SfxItemSet& );
549 
550  LanguageType GetLanguage() const {return m_eLanguage;}
551  void SetLanguage(LanguageType nLang) {m_eLanguage = nLang;}
552 
553  const OUString& GetSortAlgorithm()const {return m_sSortAlgorithm;}
554  void SetSortAlgorithm(const OUString& rSet) {m_sSortAlgorithm = rSet;}
555  // #i21237#
556  void AdjustTabStops( SwDoc const & rDoc )
557  {
558  m_aForm.AdjustTabStops( rDoc );
559  }
560 
561  SwTOXBase& operator=(const SwTOXBase& rSource);
562  void RegisterToTOXType( SwTOXType& rMark );
563  virtual bool IsVisible() const { return true; }
564 };
565 
566 //SwTOXMark
567 
568 inline const OUString& SwTOXMark::GetAlternativeText() const
569  { return m_aAltText; }
570 
571 inline const OUString& SwTOXMark::GetBookmarkName() const
572  { return m_aBookmarkName; }
573 
574 inline const OUString& SwTOXMark::GetEntryTypeName() const
575  { return m_aEntryTypeName; }
576 
577 inline const SwTOXType* SwTOXMark::GetTOXType() const
578  { return m_pType; }
579 
580 inline bool SwTOXMark::IsAlternativeText() const
581  { return !m_aAltText.isEmpty(); }
582 
583 inline void SwTOXMark::SetAlternativeText(const OUString& rAlt)
584 {
585  m_aAltText = rAlt;
586 }
587 
588 inline void SwTOXMark::SetBookmarkName(const OUString& bName)
589 {
590  m_aBookmarkName = bName;
591 }
592 
593 inline void SwTOXMark::SetEntryTypeName(const OUString& sName)
594 {
595  m_aEntryTypeName = sName;
596 }
597 inline void SwTOXMark::SetLevel( sal_uInt16 nLvl )
598 {
599  SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
600  m_nLevel = nLvl;
601 }
602 
603 inline void SwTOXMark::SetPrimaryKey( const OUString& rKey )
604 {
605  SAL_WARN_IF( GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
606  m_aPrimaryKey = rKey;
607 }
608 
609 inline void SwTOXMark::SetSecondaryKey( const OUString& rKey )
610 {
611  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
612  m_aSecondaryKey = rKey;
613 }
614 
615 inline void SwTOXMark::SetTextReading( const OUString& rText )
616 {
617  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
618  m_aTextReading = rText;
619 }
620 
621 inline void SwTOXMark::SetPrimaryKeyReading( const OUString& rKey )
622 {
623  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
624  m_aPrimaryKeyReading = rKey;
625 }
626 
627 inline void SwTOXMark::SetSecondaryKeyReading( const OUString& rKey )
628 {
629  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
630  m_aSecondaryKeyReading = rKey;
631 }
632 
633 inline sal_uInt16 SwTOXMark::GetLevel() const
634 {
635  SAL_WARN_IF( GetTOXType() && GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
636  return m_nLevel;
637 }
638 
639 inline OUString const & SwTOXMark::GetPrimaryKey() const
640 {
641  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
642  return m_aPrimaryKey;
643 }
644 
645 inline OUString const & SwTOXMark::GetSecondaryKey() const
646 {
647  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
648  return m_aSecondaryKey;
649 }
650 
651 inline OUString const & SwTOXMark::GetTextReading() const
652 {
653  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
654  return m_aTextReading;
655 }
656 
657 inline OUString const & SwTOXMark::GetPrimaryKeyReading() const
658 {
659  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
660  return m_aPrimaryKeyReading;
661 }
662 
663 inline OUString const & SwTOXMark::GetSecondaryKeyReading() const
664 {
665  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
666  return m_aSecondaryKeyReading;
667 }
668 
669 //SwForm
670 
671 inline void SwForm::SetTemplate(sal_uInt16 nLevel, const OUString& rTemplate)
672 {
673  SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
674  m_aTemplate[nLevel] = rTemplate;
675 }
676 
677 inline OUString const & SwForm::GetTemplate(sal_uInt16 nLevel) const
678 {
679  SAL_WARN_IF(nLevel >= GetFormMax(), "sw", "Index >= GetFormMax()");
680  return m_aTemplate[nLevel];
681 }
682 
684 {
685  return m_eType;
686 }
687 
688 inline sal_uInt16 SwForm::GetFormMax() const
689 {
690  return m_nFormMaxLevel;
691 }
692 
693 //SwTOXType
694 
695 inline const OUString& SwTOXType::GetTypeName() const
696  { return m_aName; }
697 
699  { return m_eType; }
700 
701 // SwTOXBase
702 
703 inline const SwTOXType* SwTOXBase::GetTOXType() const
704  { return static_cast<const SwTOXType*>(GetRegisteredIn()); }
705 
707  { return m_nCreateType; }
708 
709 inline const OUString& SwTOXBase::GetTitle() const
710  { return m_aTitle; }
711 
712 inline const OUString& SwTOXBase::GetBookmarkName() const
713  { return m_aBookmarkName; }
714 
715 inline const OUString& SwTOXBase::GetEntryTypeName() const
716  { return m_aEntryTypeName; }
717 
718 inline OUString const & SwTOXBase::GetTypeName() const
719  { return GetTOXType()->GetTypeName(); }
720 
721 inline const SwForm& SwTOXBase::GetTOXForm() const
722  { return m_aForm; }
723 
724 inline void SwTOXBase::SetCreate(SwTOXElement nCreate)
725  { m_nCreateType = nCreate; }
726 
727 inline void SwTOXBase::SetTOXForm(const SwForm& rForm)
728  { m_aForm = rForm; }
729 
731  { return GetTOXType()->GetType(); }
732 
733 inline void SwTOXBase::SetLevel(sal_uInt16 nLev)
734 {
735  SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
736  m_aData.nLevel = nLev;
737 }
738 
739 inline sal_uInt16 SwTOXBase::GetLevel() const
740 {
741  SAL_WARN_IF(GetTOXType()->GetType() == TOX_INDEX, "sw", "Wrong type");
742  return m_aData.nLevel;
743 }
744 
746 {
747  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
748  return m_aData.nOptions;
749 }
750 
752 {
753  SAL_WARN_IF(GetTOXType()->GetType() != TOX_INDEX, "sw", "Wrong type");
754  m_aData.nOptions = nOpt;
755 }
756 
757 #endif // INCLUDED_SW_INC_TOX_HXX
758 
759 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TOXTypes GetTOXType() const
Definition: tox.hxx:683
const SwFormTokens & GetTokens() const
Returns vector of tokens.
Definition: tox.hxx:309
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
Definition: tox.hxx:285
SwCaptionDisplay m_eCaptionDisplay
Definition: tox.hxx:448
void SetLevelFromChapter(bool bSet)
Definition: tox.hxx:534
TOXTypes
Definition: toxe.hxx:39
void SetLanguage(LanguageType nLang)
Definition: tox.hxx:551
SAL_DLLPRIVATE css::uno::WeakReference< css::text::XDocumentIndexMark > const & GetXTOXMark() const
Definition: tox.hxx:166
SwTOXType & operator=(const SwTOXType &)=delete
bool IsAlternativeText() const
Definition: tox.hxx:580
OUString const & GetSecondaryKeyReading() const
Definition: tox.hxx:663
SwTOIOptions
Definition: tox.hxx:386
SwTOXMarks & m_rMarks
Definition: tox.hxx:52
SwTOXElement GetCreateType() const
Definition: tox.hxx:706
SwTOIOptions GetOptions() const
Definition: tox.hxx:745
OUString m_sSequenceName
Definition: tox.hxx:436
SwTextTOXMark * m_pTextAttr
Definition: tox.hxx:98
void DisableKeepExpression()
Definition: tox.hxx:482
CollectTextMarksHint(SwTOXMarks &rMarks)
Definition: tox.hxx:53
void Notify(SwFlyFrame *pFly, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldRect=nullptr)
Notify the background based on the difference between old and new rectangle.
Definition: frmtool.cxx:3107
virtual bool operator==(const SfxPoolItem &) const =0
OUString const & GetPrimaryKey() const
Definition: tox.hxx:639
SwFormToken(FormTokenType eType)
Definition: tox.hxx:258
bool IsProtected() const
Definition: tox.hxx:536
const OUString & GetBookmarkName() const
Definition: tox.hxx:571
sal_uInt16 nOutlineLevel
Definition: tox.hxx:251
void SetLevel(sal_uInt16 nLevel)
Definition: tox.hxx:597
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
SwTOOElements
Definition: tox.hxx:409
Definition: tox.hxx:312
OUString m_aTitle
Definition: tox.hxx:429
OUString m_aBookmarkName
Definition: tox.hxx:430
SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference< css::text::XDocumentIndexMark > const &xMark)
Definition: tox.hxx:168
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:45
bool operator()(const SwFormToken &rToken)
Definition: tox.hxx:278
OUString const & GetTemplate(sal_uInt16 nLevel) const
Definition: tox.hxx:677
void SetEntryTypeName(const OUString &sName)
Definition: tox.hxx:593
void CollectTextMarks(SwTOXMarks &rMarks) const
Definition: tox.hxx:184
Definition: doc.hxx:184
const SwRootFrame * m_pLayout
Definition: tox.hxx:69
OUString const & GetTypeName() const
Definition: tox.hxx:718
bool m_bMainEntry
Definition: tox.hxx:104
SfxPoolItem & operator=(const SfxPoolItem &)=delete
const OUString & GetEntryTypeName() const
Definition: tox.hxx:715
union SwTOXBase::@30 m_aData
long SwTwips
Definition: swtypes.hxx:49
sal_uInt16 m_nFormMaxLevel
Definition: tox.hxx:318
css::uno::WeakReference< css::text::XDocumentIndexMark > m_wXDocumentIndexMark
Definition: tox.hxx:106
sal_uInt16 GetFormMax() const
Definition: tox.hxx:688
Dialog to specify the properties of date form field.
SwFormTokens m_Tokens
the tokens
Definition: tox.hxx:294
const SwTOXType * GetTOXType() const
Definition: tox.hxx:577
sal_uInt16 nLevel
Definition: tox.hxx:442
sal_uInt16 nPoolId
Definition: tox.hxx:248
The root element of a Writer document layout.
Definition: rootfrm.hxx:80
bool bWithTab
Definition: tox.hxx:254
void SetOptions(SwTOIOptions nOpt)
Definition: tox.hxx:751
SwTextTOXMark * GetTextTOXMark()
Definition: tox.hxx:164
sal_Unicode cTabFillChar
Definition: tox.hxx:253
void SetOLEOptions(SwTOOElements nOpt)
Definition: tox.hxx:513
static LanguageType nLang
Definition: srtdlg.cxx:51
SwTOIOptions nOptions
Definition: tox.hxx:443
void SetRelTabPos(bool b)
Definition: tox.hxx:344
OUString GetString(int nId)
void SetCreate(SwTOXElement)
Definition: tox.hxx:724
sal_uInt16 sal_Unicode
OUString const & GetPrimaryKeyReading() const
Definition: tox.hxx:657
const bool m_isReadOnlyAvailable
Definition: tox.hxx:59
const SwTOXType * GetTOXType() const
Definition: tox.hxx:703
SwTOXElement m_nCreateType
Definition: tox.hxx:446
void AdjustTabStops(SwDoc const &rDoc)
Definition: tox.hxx:556
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:671
MapData m_aData
OUString sText
Definition: tox.hxx:244
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
bool IsAutoGenerated() const
Definition: tox.hxx:155
sal_uInt16 m_nLevel
Definition: tox.hxx:100
void SetSortAlgorithm(const OUString &rSet)
Definition: tox.hxx:554
const OUString & GetSequenceName() const
Definition: tox.hxx:539
OUString m_aTextReading
Definition: tox.hxx:94
void SetAlternativeText(const OUString &rAlt)
Definition: tox.hxx:583
SwTOOElements GetOLEOptions() const
Definition: tox.hxx:512
LanguageType m_eLanguage
Definition: tox.hxx:438
OUString maMSTOCExpression
Definition: tox.hxx:458
const sal_Unicode C_END_PAGE_NUM
Definition: tox.cxx:47
exports com.sun.star. text
const OUString & GetAlternativeText() const
Definition: tox.hxx:568
const OUString & GetEntryTypeName() const
Definition: tox.hxx:574
SwTOXType(TOXTypes eTyp, const OUString &aName)
Definition: tox.cxx:215
SwContentFrame *& m_rpContentFrame
Definition: tox.hxx:56
void Broadcast(const SfxHint &rHint)
void SetPrimaryKey(const OUString &rStr)
Definition: tox.hxx:603
SwTOXElement
Definition: tox.hxx:364
void SetTextReading(const OUString &rStr)
Definition: tox.hxx:615
FormTokenType eTokenType
Definition: tox.hxx:247
OUString sCharStyleName
Definition: tox.hxx:245
virtual bool IsVisible() const
Definition: tox.hxx:563
FindContentFrameHint(SwContentFrame *&rpContentFrame, const SwDoc &rDoc, const SwRootFrame &rLayout, const bool isReadOnlyAvailable)
Definition: tox.hxx:60
bool IsFromObjectNames() const
Definition: tox.hxx:530
void SetSequenceName(const OUString &rSet)
Definition: tox.hxx:540
void SetMainEntryCharStyle(const OUString &rSet)
Definition: tox.hxx:497
sal_uInt16 GetLevel() const
Definition: tox.hxx:633
bool m_bAutoGenerated
Definition: tox.hxx:103
void SetCaptionDisplay(SwCaptionDisplay eSet)
Definition: tox.hxx:543
void SetPrimaryKeyReading(const OUString &rStr)
Definition: tox.hxx:621
void SetFromChapter(bool bSet)
Definition: tox.hxx:528
OUString m_aEntryTypeName
Definition: tox.hxx:102
const OUString & GetTypeName() const
Definition: tox.hxx:695
SwTOOElements m_nOLEOptions
Definition: tox.hxx:447
const SwDoc & m_rDoc
Definition: tox.hxx:57
sal_uInt16 nChapterFormat
Definition: tox.hxx:250
sal_uInt16 nAuthorityField
Definition: tox.hxx:252
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
bool IsFromChapter() const
Definition: tox.hxx:527
sal_uInt16 GetLevel() const
Definition: tox.hxx:739
OUString m_aSecondaryKey
Definition: tox.hxx:91
SwForm m_aForm
Definition: tox.hxx:427
const OUString & GetTitle() const
Definition: tox.hxx:709
OUString const & GetTextReading() const
Definition: tox.hxx:651
const SwRootFrame & m_rLayout
Definition: tox.hxx:58
SwCaptionDisplay GetCaptionDisplay() const
Definition: tox.hxx:542
OUString m_sSortAlgorithm
Definition: tox.hxx:439
void SetAutoGenerated(bool bSet)
Definition: tox.hxx:156
const OUString & GetSortAlgorithm() const
Definition: tox.hxx:553
void SetTOXForm(const SwForm &rForm)
Definition: tox.hxx:727
const sal_Unicode C_NUM_REPL
Definition: tox.cxx:46
OUString m_aAltText
Definition: tox.hxx:89
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:93
const OUString & GetBookmarkName() const
Definition: tox.hxx:712
TOXTypes m_eType
Definition: tox.hxx:198
void InitCore()
Definition: init.cxx:454
bool IsRelTabPos() const
Definition: tox.hxx:343
void SetTOXName(const OUString &rSet)
Definition: tox.hxx:476
SwTwips nTabStopPosition
Definition: tox.hxx:246
OUString m_aSecondaryKeyReading
Definition: tox.hxx:96
OUString const & GetSecondaryKey() const
Definition: tox.hxx:645
#define SAL_WARN_IF(condition, area, stream)
OUString m_aEntryTypeName
Definition: tox.hxx:431
TOXTypes GetType() const
Definition: tox.hxx:730
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
OUString const & GetStyleNames(sal_uInt16 nLevel) const
Definition: tox.hxx:517
bool mbKeepExpression
Definition: tox.hxx:459
OUString aName
void SetStyleNames(const OUString &rSet, sal_uInt16 nLevel)
Definition: tox.hxx:522
LanguageType GetLanguage() const
Definition: tox.hxx:550
bool IsCommaSeparated() const
Definition: tox.hxx:346
TOXTypes m_eType
Definition: tox.hxx:317
void CollectTextTOXMarksForLayout(std::vector< std::reference_wrapper< SwTextTOXMark >> &rMarks, const SwRootFrame *pLayout) const
Definition: tox.hxx:192
CollectTextTOXMarksForLayoutHint(std::vector< std::reference_wrapper< SwTextTOXMark >> &rMarks, const SwRootFrame *pLayout)
Definition: tox.hxx:70
const SwTOXType * m_pType
Definition: tox.hxx:88
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
void SetBookmarkName(const OUString &bName)
Definition: tox.hxx:588
OUString m_sMainEntryCharStyle
Definition: tox.hxx:433
OUString m_aTemplate[AUTH_TYPE_END+1]
Definition: tox.hxx:315
void EnableKeepExpression()
Definition: tox.hxx:481
WriterListener & operator=(WriterListener const &)=delete
void SetSecondaryKey(const OUString &rStr)
Definition: tox.hxx:609
const OUString & GetMainEntryCharStyle() const
Definition: tox.hxx:496
TOXTypes GetType() const
Definition: tox.hxx:698
SwFormTokenEqualToFormTokenType(FormTokenType _eType)
Definition: tox.hxx:277
SwContentFrame * FindContentFrame(const SwDoc &rDoc, const SwRootFrame &rLayout, const bool isReadOnlyAvailable) const
Definition: tox.hxx:186
void SetProtected(bool bSet)
Definition: tox.hxx:537
bool IsMainEntry() const
Definition: tox.hxx:158
SvxTabAdjust eTabAlign
Definition: tox.hxx:249
OUString m_aBookmarkName
Definition: tox.hxx:101
Left
const SwTextTOXMark * GetTextTOXMark() const
Definition: tox.hxx:163
void SetLevel(sal_uInt16)
Definition: tox.hxx:733
OUString m_aPrimaryKey
Definition: tox.hxx:90
void SetCommaSeparated(bool b)
Definition: tox.hxx:347
Helper class that converts vectors of tokens to strings and vice versa.
Definition: tox.hxx:291
const SwForm & GetTOXForm() const
Definition: tox.hxx:721
void SetSecondaryKeyReading(const OUString &rStr)
Definition: tox.hxx:627
SwCaptionDisplay
Definition: tox.hxx:402
std::vector< std::reference_wrapper< SwTextTOXMark > > & m_rMarks
Definition: tox.hxx:68
void AdjustTabStops(SwDoc const &rDoc)
Definition: tox.cxx:465
void SetMainEntry(bool bSet)
Definition: tox.hxx:159
FormTokenType
Definition: tox.hxx:227
void SetMSTOCExpression(const OUString &rExp)
Definition: tox.hxx:480
void SetFromObjectNames(bool bSet)
Definition: tox.hxx:531
const OUString & GetMSTOCExpression() const
Definition: tox.hxx:479
OUString m_aName
Definition: tox.hxx:197
bool IsLevelFromChapter() const
Definition: tox.hxx:533
const OUString & GetTOXName() const
Definition: tox.hxx:475
SvxTabAdjust
SwFormTokensHelper(const OUString &rStr)
constructor
Definition: tox.cxx:922
OUString m_aPrimaryKeyReading
Definition: tox.hxx:95
OUString m_aName
Definition: tox.hxx:428