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