LibreOffice Module sw (master) 1
editsh.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_EDITSH_HXX
20#define INCLUDED_SW_INC_EDITSH_HXX
21
22#include "crsrsh.hxx"
23
24#include "charfmt.hxx"
25#include "fldupde.hxx"
26#include "frmfmt.hxx"
27#include "swdllapi.h"
28#include "swundo.hxx"
29#include "tblenum.hxx"
30#include "tox.hxx"
31
32#include <memory>
33#include <utility>
34#include <vector>
36
37namespace tools { class PolyPolygon; }
38class SwDoc;
40
42class SfxPoolItem;
43class SfxItemSet;
45class SvxAutoCorrect;
46
47class SwDDEFieldType;
48class SwDBManager;
49
50struct SwDocStat;
52
53class SwFormatRefMark;
54
55class SwNumRule;
56
58class SwGrfNode;
59
60class Graphic;
61class GraphicObject;
62class GraphicAttr;
64class SwTable;
65class SwTextBlocks;
67class SwSection;
68class SwSectionData;
69class SwSectionFormat;
71class SwPageDesc;
73class SwSeqFieldList;
76class SwRangeRedline;
77class SwRedlineData;
78class SwFootnoteInfo;
79class SwEndNoteInfo;
81class SwAuthEntry;
82class SwRewriter;
83class SwView;
84struct SwConversionArgs;
87struct SwDBData;
88enum class SvtScriptType : sal_uInt8;
90enum class RedlineFlags;
91enum class TransliterationFlags;
92enum class GraphicType;
93
94namespace com::sun::star::uno { template < class > class Sequence; }
95namespace com::sun::star::linguistic2 { class XSpellAlternatives; }
96namespace com::sun::star::linguistic2 { struct ProofreadingResult; }
97
98namespace svx{
99 struct SpellPortion;
100 typedef std::vector<SpellPortion> SpellPortions;
102}
103
104namespace sfx2{
105 class LinkManager;
106}
107
108namespace sw {
109 class UndoRedoContext;
110}
111
112enum class ParaBreakType {
113 ToBlank = 0,
114 ToOnlyCR = 2
115};
116
119{
120 OUString sText;
122
123 SwGetINetAttr( OUString aText, const SwTextINetFormat& rAttr )
124 : sText(std::move( aText )), rINetAttr( rAttr )
125 {}
126};
127typedef std::vector<SwGetINetAttr> SwGetINetAttrs;
128
129// Types of forms of content.
130#define CNT_TXT 0x0001
131#define CNT_GRF 0x0002
132#define CNT_OLE 0x0010
133
134// Test USHORT for a defined form of content.
135#define CNT_HasText(USH) ((USH)&CNT_TXT)
136#define CNT_HasGrf(USH) ((USH)&CNT_GRF)
137#define CNT_HasOLE(USH) ((USH)&CNT_OLE)
138
140{
142
144 friend class SwAutoFormat;
145 friend void InitCore();
146 friend void FinitCore();
148 friend class SwUndo;
149
152 SAL_DLLPRIVATE SwGrfNode *GetGrfNode_() const ;
153
154 SAL_DLLPRIVATE void DeleteSel(SwPaM& rPam, bool isArtificialSelection, bool* pUndo = nullptr);
155
156 SAL_DLLPRIVATE void SetSectionAttr_( SwSectionFormat& rSectFormat, const SfxItemSet& rSet );
157
159 using sw::BroadcastingModify::GetInfo;
160
161public:
163 void Insert( sal_Unicode, bool bOnlyCurrCursor = false );
164 void Insert2( const OUString &, const bool bForceExpandHints = false );
165 void Overwrite( const OUString & );
166
172 bool Replace( const OUString& rNewStr, bool bRegExpRplc );
173
176 bool Delete(bool isArtificialSelection = false);
177
179 bool DelFullPara();
180
182 void TransliterateText( TransliterationFlags nType );
183
185 void CountWords( SwDocStat& rStat ) const;
186
188 bool ConvertFieldsToText();
189
191 void SetNumberingRestart();
192
194 sal_uInt16 GetLinkUpdMode() const;
195 void SetLinkUpdMode( sal_uInt16 nMode );
196
198 bool Copy( SwEditShell& rDestShell );
199
204 bool CopySelToDoc( SwDoc& rInsDoc );
205
206 void SplitNode( bool bAutoFormat = false, bool bCheckTableStart = true );
207 bool AppendTextNode();
208 void AutoFormatBySplitNode();
209
212 void DelINetAttrWithText();
213
216 bool DontExpandFormat();
217
227 bool GetPaMAttr( SwPaM* pPaM, SfxItemSet& ,
228 const bool bMergeIndentValuesOfNumRule = false ) const;
229 bool GetCurAttr( SfxItemSet& ,
230 const bool bMergeIndentValuesOfNumRule = false ) const;
231 void SetAttrItem( const SfxPoolItem&, SetAttrMode nFlags = SetAttrMode::DEFAULT,
232 const bool bParagraphSetting = false );
233 void SetAttrSet( const SfxItemSet&, SetAttrMode nFlags = SetAttrMode::DEFAULT,
234 SwPaM* pCursor = nullptr, const bool bParagraphSetting = false );
235
240 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
241
251 void GetCurParAttr( SfxItemSet& rSet ) const;
262 void GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const;
263
265 void SetDefault( const SfxPoolItem& );
266
268 const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint ) const;
269 template<class T> const T& GetDefault( TypedWhichId<T> nWhich ) const
270 {
271 return static_cast<const T&>(GetDefault(sal_uInt16(nWhich)));
272 }
273
274 void ResetAttr( const o3tl::sorted_vector<sal_uInt16> &attrs = o3tl::sorted_vector<sal_uInt16>(), SwPaM* pCursor = nullptr );
275 void GCAttr();
276
278 SvtScriptType GetScriptType() const;
279
281 LanguageType GetCurLang() const;
282
284 size_t GetTableFrameFormatCount( bool bUsed = false ) const;
285 SwFrameFormat& GetTableFrameFormat(size_t nFormat, bool bUsed = false ) const;
286 OUString GetUniqueTableName() const;
287
289 sal_uInt16 GetCharFormatCount() const;
290 SwCharFormat& GetCharFormat(sal_uInt16 nFormat) const;
291 SwCharFormat* GetCurCharFormat() const;
292 void FillByEx(SwCharFormat*);
293 SwCharFormat* MakeCharFormat( const OUString& rName );
294 SwCharFormat* FindCharFormatByName( const OUString& rName ) const;
295
296 /* FormatCollections (new) - Explaining the general naming pattern:
297 * GetXXXCount() returns the count of xxx in the document.
298 * GetXXX(i) returns i-th xxx (ERR_RAISE if beyond range!).
299 * DelXXX(i) deletes i-th xxx (ERR_RAISE if beyond range!).
300 * GetCurXXX() returns xxx that is valid at cursor or in ranges.
301 * returns 0, if not unanimous.
302 * SetXXX() sets xxx at cursor or in ranges.
303 * MakeXXX() makes a xxx, derived from pDerivedFrom.
304 */
305
306 // TXT
307 SwTextFormatColl& GetDfltTextFormatColl() const;
308 sal_uInt16 GetTextFormatCollCount() const;
309 SwTextFormatColl& GetTextFormatColl( sal_uInt16 nTextFormatColl) const;
329 SwTextFormatColl* GetPaMTextFormatColl( SwPaM* pPaM ) const;
330
331 // #i62675#
333 void SetTextFormatColl(SwTextFormatColl*, const bool bResetListAttrs = false);
334 SwTextFormatColl *MakeTextFormatColl(const OUString &rFormatCollName,
335 SwTextFormatColl *pDerivedFrom = nullptr);
336 void FillByEx(SwTextFormatColl*);
337 SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const;
338
340 SwTextFormatColl* GetTextCollFromPool( sal_uInt16 nId );
341
343 SwFormat* GetFormatFromPool( sal_uInt16 nId );
344
346 SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
347
349 bool IsUsed( const sw::BroadcastingModify& ) const;
350
353 { return static_cast<SwFrameFormat*>(SwEditShell::GetFormatFromPool( nId )); }
355 { return static_cast<SwCharFormat*>(SwEditShell::GetFormatFromPool( nId )); }
356
357 void SetClassification(const OUString& rName, SfxClassificationPolicyType eType);
358 void ApplyAdvancedClassification(std::vector<svx::ClassificationResult> const & rResult);
359 std::vector<svx::ClassificationResult> CollectAdvancedClassification();
360
361 SfxWatermarkItem GetWatermark() const;
362 void SetWatermark(const SfxWatermarkItem& rText);
363
365 void SignParagraph();
366
368 void ValidateParagraphSignatures(SwTextNode* pNode, bool updateDontRemove);
369
371 void ValidateCurrentParagraphSignatures(bool updateDontRemove);
372
374 void ValidateAllParagraphSignatures(bool updateDontRemove);
375
380 void RestoreMetadataFieldsAndValidateParagraphSignatures();
381
384 void ClassifyDocPerHighestParagraphClass();
385
387 void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
388 std::vector<svx::ClassificationResult> CollectParagraphClassification();
389
392 bool IsCursorInParagraphMetadataField() const;
393
397 bool RemoveParagraphMetadataFieldAtCursor();
398
399 bool InsertField(SwField const &, const bool bForceExpandHints);
400
401 void UpdateOneField(SwField &);
402
403 size_t GetFieldTypeCount(SwFieldIds nResId = SwFieldIds::Unknown) const;
404 SwFieldType* GetFieldType(size_t nField, SwFieldIds nResId = SwFieldIds::Unknown) const;
405 SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName) const;
406
407 void RemoveFieldType(size_t nField);
408 void RemoveFieldType(SwFieldIds nResId, const OUString& rName);
409
410 void FieldToText( SwFieldType const * pType );
411
412 void ChangeAuthorityData(const SwAuthEntry* pNewData);
413
415 SwDBData const & GetDBData() const;
416 void ChgDBData(const SwDBData& SwDBData);
417 void ChangeDBFields( const std::vector<OUString>& rOldNames,
418 const OUString& rNewName );
419 void GetAllUsedDB( std::vector<OUString>& rDBNameList,
420 std::vector<OUString> const * pAllDBNames );
421
422 bool IsAnyDatabaseFieldInDoc()const;
423
425 bool IsFieldDataSourceAvailable(OUString& rUsedDataSource) const;
426 void UpdateExpFields(bool bCloseDB = false);
427 void LockExpFields();
428 void UnlockExpFields();
429 bool IsExpFieldsLocked() const;
430
431 SwFieldUpdateFlags GetFieldUpdateFlags() const;
432 void SetFieldUpdateFlags( SwFieldUpdateFlags eFlags );
433
435 SwDBManager* GetDBManager() const;
436
437 SwFieldType* InsertFieldType(const SwFieldType &);
438
440 bool IsModified() const;
441 void SetModified();
442 void ResetModified();
443 void SetUndoNoResetModified();
444
446 void UpdateDocStat();
447 const SwDocStat &GetUpdatedDocStat();
448
449 void Insert(const SwTOXMark& rMark);
450
451 void DeleteTOXMark(SwTOXMark const * pMark);
452
454 void GetCurTOXMarks(SwTOXMarks& rMarks) const ;
455
457 void InsertTableOf(const SwTOXBase& rTOX,
458 const SfxItemSet* pSet = nullptr);
459 void UpdateTableOf(const SwTOXBase& rTOX,
460 const SfxItemSet* pSet = nullptr);
461 const SwTOXBase* GetCurTOX() const;
462 const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false );
463 void SetDefaultTOXBase(const SwTOXBase& rBase);
464
465 static bool IsTOXBaseReadonly(const SwTOXBase& rTOXBase);
466 void SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly);
467
468 sal_uInt16 GetTOXCount() const;
469 const SwTOXBase* GetTOX( sal_uInt16 nPos ) const;
470 bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes );
471
473 void SetUpdateTOX( bool bFlag );
474 bool IsUpdateTOX() const;
475
477 sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const;
478 const SwTOXType* GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const;
479 void InsertTOXType(const SwTOXType& rTyp);
480
482 OUString const & GetTOIAutoMarkURL() const;
483 void SetTOIAutoMarkURL(const OUString& rSet);
484 void ApplyAutoMark();
485
487 void GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
488
489 void SetOutlineNumRule(const SwNumRule&);
490 const SwNumRule* GetOutlineNumRule() const;
491
492 bool OutlineUpDown( short nOffset = 1 );
493
494 bool MoveOutlinePara( SwOutlineNodes::difference_type nOffset );
495
496 bool IsProtectedOutlinePara() const;
497
498 const SwNumRule* GetNumRuleAtCurrCursorPos() const;
499
502 const SwNumRule* GetNumRuleAtCurrentSelection() const;
503
512 void SetCurNumRule( const SwNumRule&,
513 const bool bCreateNewList /*= false*/,
514 const OUString& sContinuedListId = OUString(),
515 const bool bResetIndentAttrs = false );
516
518 void NoNum();
519
521 void DelNumRules();
522
523 void NumUpDown( bool bDown = true );
524
525 bool MoveParagraph( SwNodeOffset nOffset = SwNodeOffset(1));
526 bool MoveNumParas( bool bUpperLower, bool bUpperLeft );
527
529 bool NumOrNoNum(bool bDelete = false, bool bChkStart = true);
530
531 // #i23726#
532 // #i90078#
534 // Adjust method name and parameter name
535 void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
536 // Adjust method name
537 void SetIndent(short nIndent, const SwPosition & rPos);
538 bool IsFirstOfNumRuleAtCursorPos() const;
539
540 bool IsNoNum( bool bChkStart = true ) const;
541
544 sal_uInt8 GetNumLevel() const;
545
547 void GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower );
548
550 int GetCurrentParaOutlineLevel( ) const;
551
552 // i29560
553 bool HasNumber() const;
554 bool HasBullet() const;
555
556 bool SelectionHasNumber() const;
557 bool SelectionHasBullet() const;
558
559 OUString GetUniqueNumRuleName() const;
560 void ChgNumRuleFormats( const SwNumRule& rRule );
561
563 void SetNumRuleStart( bool bFlag, SwPaM* pCursor );
564 bool IsNumRuleStart( SwPaM* pPaM = nullptr ) const;
565 void SetNodeNumStart( sal_uInt16 nStt );
566
567 sal_uInt16 GetNodeNumStart( SwPaM* pPaM ) const;
568
569 void ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule );
570
574 const SwNumRule * SearchNumRule(const bool bNum,
575 OUString& sListId );
576
580 void DoUndo( bool bOn = true );
581 bool DoesUndo() const;
582 void DoGroupUndo( bool bUn );
583 bool DoesGroupUndo() const;
584 void DelAllUndoObj();
585
587 SwUndoId StartUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
588
590 SwUndoId EndUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
591
592 bool GetLastUndoInfo(OUString *const o_pStr,
593 SwUndoId *const o_pId,
594 const SwView* pView = nullptr) const;
595 bool GetFirstRedoInfo(OUString *const o_pStr,
596 SwUndoId *const o_pId,
597 const SwView* pView = nullptr) const;
598 SwUndoId GetRepeatInfo(OUString *const o_pStr) const;
599
601 bool CursorsLocked() const;
604 void HandleUndoRedoContext(::sw::UndoRedoContext & rContext);
605
606 void Undo(sal_uInt16 const nCount = 1, sal_uInt16 nOffset = 0);
607 void Redo(sal_uInt16 const nCount = 1);
608 void Repeat(sal_uInt16 const nCount);
609
611 void StartAllAction();
612 void EndAllAction();
613
615 virtual void CalcLayout() override;
616
618 sal_uInt16 GetCntType() const;
619
621 bool HasOtherCnt() const;
622
624 virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
625
627 void GetSelectedText( OUString &rBuf,
628 ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
629
633 const Graphic* GetGraphic( bool bWait = true ) const;
634 const GraphicObject* GetGraphicObj() const;
635 const GraphicAttr* GetGraphicAttr( GraphicAttr& rGA ) const;
636
637 bool IsLinkedGrfSwapOut() const;
638 GraphicType GetGraphicType() const;
639
640 const tools::PolyPolygon *GetGraphicPolygon() const;
641 void SetGraphicPolygon( const tools::PolyPolygon *pPoly );
642
645 void ClearAutomaticContour();
646
648 bool GetGrfSize(Size&) const;
649
653 void GetGrfNms( OUString* pGrfName, OUString* pFltName,
654 const SwFlyFrameFormat* = nullptr ) const;
655
657 void ReRead( const OUString& rGrfName, const OUString& rFltName,
658 const Graphic* pGraphic = nullptr );
659
661 void *GetIMapInventor() const;
662
663 // #i73788#
665 Graphic GetIMapGraphic() const;
666 const SwFlyFrameFormat* FindFlyByName( const OUString& rName ) const;
667
671 svt::EmbeddedObjectRef& GetOLEObject() const;
672
674 bool HasOLEObj( std::u16string_view rName ) const;
675
677 void SetChartName( const OUString &rName );
678
680 void UpdateCharts( const OUString& rName );
681
682 OUString GetCurWord() const;
683
686 void InsertGlossary( SwTextBlocks& rGlossary, const OUString& );
687
690 sal_uInt16 MakeGlossary( SwTextBlocks& rToFill, const OUString& rName,
691 const OUString& rShortName, bool bSaveRelFile,
692 const OUString* pOnlyText );
693
695 sal_uInt16 SaveGlossaryDoc( SwTextBlocks& rGlossary, const OUString& rName,
696 const OUString& rShortName,
697 bool bSaveRelFile,
698 bool bOnlyText );
699
700 // Linguistics...
702 void HyphStart( SwDocPositions eStart, SwDocPositions eEnd );
703
705 void HyphEnd();
706 css::uno::Reference< css::uno::XInterface>
707 HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
708
709 void HyphIgnore();
710
712 static void InsertSoftHyph( const sal_Int32 nHyphPos );
713
719 const SwTable& InsertTable( const SwInsertTableOptions& rInsTableOpts,
720 sal_uInt16 nRows, sal_uInt16 nCols,
721 const SwTableAutoFormat* pTAFormat = nullptr );
722
723 void InsertDDETable( const SwInsertTableOptions& rInsTableOpts,
724 SwDDEFieldType* pDDEType,
725 sal_uInt16 nRows, sal_uInt16 nCols );
726
727 void UpdateTable();
728 void SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName );
729
730 SwFrameFormat *GetTableFormat();
731 bool TextToTable( const SwInsertTableOptions& rInsTableOpts,
732 sal_Unicode cCh,
733 const SwTableAutoFormat* pTAFormat = nullptr );
734 bool TableToText( sal_Unicode cCh );
735 bool IsTextToTableAvailable() const;
736
737 bool GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const;
738 void SetTableBoxFormulaAttrs( const SfxItemSet& rSet );
739
740 bool IsTableBoxTextFormat() const;
741 OUString GetTableBoxText() const;
742
743 TableChgMode GetTableChgMode() const;
744 void SetTableChgMode( TableChgMode eMode );
745
747 void SplitTable( SplitTable_HeadlineOption eMode );
748
753 bool CanMergeTable( bool bWithPrev = true, bool* pChkNxtPrv = nullptr ) const;
754 bool MergeTable( bool bWithPrev );
755
757 void AppendUndoForInsertFromDB( bool bIsTable );
758
760
762 void SpellStart( SwDocPositions eStart, SwDocPositions eEnd,
763 SwDocPositions eCurr, SwConversionArgs *pConvArgs = nullptr );
764
766 void SpellEnd( SwConversionArgs const *pConvArgs = nullptr, bool bRestoreSelection = true );
767 css::uno::Any SpellContinue(
768 sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
769 SwConversionArgs const *pConvArgs );
770
773 bool SpellSentence(svx::SpellPortions& rToFill, bool bIsGrammarCheck );
774
776 static void PutSpellingToSentenceStart();
777
779 static void MoveContinuationPosToEndOfCheckedSentence();
780
782 void ApplyChangedSentence(const svx::SpellPortions& rNewPortions, bool bRecheck);
783
785 static bool HasLastSentenceGotGrammarChecked();
786
788 static bool HasConvIter();
789
791 static bool HasHyphIter();
792
793 void HandleCorrectionError(const OUString& aText, SwPosition aPos, sal_Int32 nBegin,
794 sal_Int32 nLen, const Point* pPt,
795 SwRect& rSelectRect);
796 css::uno::Reference< css::linguistic2::XSpellAlternatives >
797 GetCorrection( const Point* pPt, SwRect& rSelectRect );
798
799 bool GetGrammarCorrection( css::linguistic2::ProofreadingResult /*out*/ &rResult,
800 sal_Int32 /*out*/ &rErrorPosInText,
801 sal_Int32 /*out*/ &rErrorIndexInResult,
802 css::uno::Sequence< OUString > /*out*/ &rSuggestions,
803 const Point* pPt, SwRect& rSelectRect );
804
805 static void IgnoreGrammarErrorAt( SwPaM& rErrorPosition );
806 void SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd );
807
809 const SwFormatRefMark* GetRefMark( std::u16string_view rName ) const;
810
813 sal_uInt16 GetRefMarks( std::vector<OUString>* = nullptr ) const;
814
816 void AutoCorrect( SvxAutoCorrect& rACorr, bool bInsertMode,
817 sal_Unicode cChar );
818 OUString GetPrevAutoCorrWord(SvxAutoCorrect& rACorr);
819
820 // We consider no more than 9 characters before the cursor, and they must not start in the
821 // middle of a word (leading spaces are OK)
822 std::vector<OUString> GetChunkForAutoText();
823
825 void AutoFormat( const SvxSwAutoFormatFlags* pAFlags );
826
827 static SvxSwAutoFormatFlags* GetAutoFormatFlags();
828 static void SetAutoFormatFlags(SvxSwAutoFormatFlags const *);
829
831 OUString Calculate();
832
833 bool InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr,
834 bool bKeepSelection = false );
835 void GetINetAttrs(SwGetINetAttrs& rArr , bool bIncludeInToxContent = true);
836
837 OUString GetDropText( const sal_Int32 nChars ) const;
838 void ReplaceDropText( const OUString &rStr, SwPaM* pPaM = nullptr );
839
842 bool IsOutlineMovable( SwOutlineNodes::size_type nIdx ) const;
843 bool IsOutlineCopyable( SwOutlineNodes::size_type nIdx ) const;
844
845 sal_uInt16 GetLineCount();
846
848 bool GetCurFootnote( SwFormatFootnote* pToFillFootnote = nullptr );
849 bool SetCurFootnote( const SwFormatFootnote& rFillFootnote );
850 bool HasFootnotes( bool bEndNotes = false ) const;
851
852 size_t GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes = false );
854
855 SwSection const* InsertSection(
856 SwSectionData & rNewData, SfxItemSet const*const = nullptr );
857 bool IsInsRegionAvailable() const;
858 const SwSection* GetCurrSection() const;
859
865 SwSection* GetAnySection( bool bOutOfTab = false, const Point* pPt = nullptr );
866
867 size_t GetSectionFormatCount() const;
868 size_t GetSectionFormatPos(const SwSectionFormat&) const;
869 const SwSectionFormat& GetSectionFormat(size_t nFormat) const;
870 void DelSectionFormat( size_t nFormat);
871 void UpdateSection( size_t const nSect, SwSectionData &,
872 SfxItemSet const*const = nullptr);
873 bool IsAnySectionInDoc() const;
874
875 OUString GetUniqueSectionName( const OUString* pChkStr = nullptr ) const;
876
878 void SetSectionAttr(const SfxItemSet& rSet, SwSectionFormat* pSectFormat = nullptr);
879
883 sal_uInt16 GetFullSelectedSectionCount() const;
884
890 void DoSpecialInsert();
891 bool CanSpecialInsert() const;
892
894 void SetNewDoc();
895
896 sfx2::LinkManager& GetLinkManager();
897 inline const sfx2::LinkManager& GetLinkManager() const;
898
902 bool IsMoveLeftMargin( bool bRight, bool bModulus = true ) const;
903 void MoveLeftMargin( bool bRight, bool bModulus = true );
904
906 SvNumberFormatter* GetNumberFormatter();
908 { return const_cast<SwEditShell*>(this)->GetNumberFormatter(); }
909
911 bool IsGlobalDoc() const;
912 void SetGlblDocSaveLinks( bool bFlag );
913 bool IsGlblDocSaveLinks() const;
914 void GetGlobalDocContent( SwGlblDocContents& rArr ) const;
915 void InsertGlobalDocContent( const SwGlblDocContent& rPos,
916 SwSectionData & rNew );
917 bool InsertGlobalDocContent( const SwGlblDocContent& rPos,
918 const SwTOXBase& rTOX );
919 bool InsertGlobalDocContent( const SwGlblDocContent& rPos );
920 void DeleteGlobalDocContent( const SwGlblDocContents& rArr,
921 size_t nPos );
922 bool MoveGlobalDocContent( const SwGlblDocContents& rArr ,
923 size_t nFromPos, size_t nToPos,
924 size_t nNewPos );
925 void GotoGlobalDocContent( const SwGlblDocContent& rPos );
926
929 void SetRedlineFlags( RedlineFlags eMode );
930 bool IsRedlineOn() const;
931 SwRedlineTable::size_type GetRedlineCount() const;
932 const SwRangeRedline& GetRedline( SwRedlineTable::size_type nPos ) const;
933 bool AcceptRedline( SwRedlineTable::size_type nPos );
934 bool RejectRedline( SwRedlineTable::size_type nPos );
935 bool AcceptRedlinesInSelection();
936 bool RejectRedlinesInSelection();
937
940 SwRedlineTable::size_type FindRedlineOfData( const SwRedlineData& ) const;
941
943 bool SetRedlineComment( const OUString& rS );
944 const SwRangeRedline* GetCurrRedline() const;
945
947 void UpdateRedlineAttr();
948
950 tools::Long CompareDoc( const SwDoc& rDoc );
951
953 tools::Long MergeDoc( const SwDoc& rDoc );
954
956 const SwFootnoteInfo& GetFootnoteInfo() const;
957 void SetFootnoteInfo(const SwFootnoteInfo& rInfo);
958 const SwEndNoteInfo& GetEndNoteInfo() const;
959 void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
960
961 const SwLineNumberInfo &GetLineNumberInfo() const;
962 void SetLineNumberInfo( const SwLineNumberInfo& rInfo);
963
965 void SetLabelDoc( bool bFlag );
966 bool IsLabelDoc() const;
967
969 void CreateExtTextInput(LanguageType eInputLanguage);
970 OUString DeleteExtTextInput( bool bInsText = true);
971 void SetExtTextInputData( const CommandExtTextInputData& );
972
974 bool IsParagraphSignatureValidationEnabled() const { return m_bDoParagraphSignatureValidation; }
976 bool SetParagraphSignatureValidation(const bool bEnable)
977 {
978 const bool bOldFlag = m_bDoParagraphSignatureValidation;
979 m_bDoParagraphSignatureValidation = bEnable;
980 return bOldFlag;
981 }
982
984 static SwAutoCompleteWord& GetAutoCompleteWords();
985
988 sal_uInt16 GetScalingOfSelectedText() const;
989
990 bool IsNbspRunNext() const { return m_bNbspRunNext; }
991
993 SwEditShell( SwDoc&, vcl::Window*, const SwViewOption *pOpt );
994
997 virtual ~SwEditShell() override;
998
999private:
1000 SwEditShell(const SwEditShell &) = delete;
1001 const SwEditShell &operator=(const SwEditShell &) = delete;
1002
1003 /* TODO: this flag may have to be invalidated / reset to false at various
1004 * places if it was true and the edit cursor position changes. It's somehow
1005 * overkill though because it can only be true if a NO-BREAK SPACE was
1006 * inserted by the last DoAutoCorrect() call (in French language), any
1007 * subsequent call will reset it anyway and just if the cursor is
1008 * positioned behind "x :" and the next character inserted is not a space
1009 * the existing nb-space will be removed. Bear this in mind if that problem
1010 * arises. */
1013};
1014
1016{ return const_cast<SwEditShell*>(this)->GetLinkManager(); }
1017
1021public:
1022 SwActContext(SwEditShell *pShell);
1023 ~SwActContext() COVERITY_NOEXCEPT_FALSE;
1024};
1025
1029public:
1030 SwMvContext(SwEditShell *pShell);
1031 ~SwMvContext() COVERITY_NOEXCEPT_FALSE;
1032};
1033
1034#endif
1035
1036/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SwTOXBase & GetTOX(SwDoc &rDoc, SwNodeOffset const nNodeIndex)
static void EndUndo(SwWrtShell &rSh)
Definition: basesh.cxx:3088
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1019
SwActContext(SwEditShell *pShell)
Definition: edws.cxx:161
~SwActContext() COVERITY_NOEXCEPT_FALSE
Definition: edws.cxx:167
SwEditShell & m_rShell
Definition: editsh.hxx:1020
Represents the style of a text portion.
Definition: charfmt.hxx:27
Definition: doc.hxx:195
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:127
bool IsNbspRunNext() const
Definition: editsh.hxx:990
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:354
SwEditShell(const SwEditShell &)=delete
bool m_bNbspRunNext
NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect()
Definition: editsh.hxx:1011
const T & GetDefault(TypedWhichId< T > nWhich) const
Definition: editsh.hxx:269
const SvNumberFormatter * GetNumberFormatter() const
Definition: editsh.hxx:907
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
Definition: editsh.hxx:976
bool m_bDoParagraphSignatureValidation
Prevent nested calls of ValidateParagraphSignatures.
Definition: editsh.hxx:1012
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
Definition: editsh.hxx:974
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:592
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:352
static SvxSwAutoFormatFlags * s_pAutoFormatFlags
Definition: editsh.hxx:141
const SwEditShell & operator=(const SwEditShell &)=delete
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:244
Base class of all fields.
Definition: fldbas.hxx:295
Base class for various Writer styles.
Definition: format.hxx:47
Style of a layout element.
Definition: frmfmt.hxx:62
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:39
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1027
SwEditShell & m_rShell
Definition: editsh.hxx:1028
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
vector_type::size_type size_type
Definition: docary.hxx:222
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:121
virtual void Repeat(SfxRepeatTarget &) override
Definition: undobj.cxx:237
virtual void Redo() override
Definition: undobj.cxx:214
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:120
virtual void Undo() override
Definition: undobj.cxx:209
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2201
virtual void CalcLayout()
Definition: viewsh.cxx:1070
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
Definition: viewsh.cxx:710
Definition: view.hxx:146
SfxClassificationPolicyType
std::vector< Value >::difference_type difference_type
SwDocPositions
Definition: cshtyp.hxx:104
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
std::vector< SwGetINetAttr > SwGetINetAttrs
Definition: editsh.hxx:127
ParaBreakType
Definition: editsh.hxx:112
SwFieldIds
Definition: fldbas.hxx:46
SwFieldUpdateFlags
Definition: fldupde.hxx:23
GraphicType
void InitCore()
Definition: init.cxx:457
void FinitCore()
Definition: init.cxx:682
SvtScriptType
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:674
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
@ Sequence
std::vector< SpellPortion > SpellPortions
Dialog to specify the properties of date form field.
long Long
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
sal_Int16 nId
For querying the INet-attributes for Navigator.
Definition: editsh.hxx:119
OUString sText
Definition: editsh.hxx:120
SwGetINetAttr(OUString aText, const SwTextINetFormat &rAttr)
Definition: editsh.hxx:123
const SwTextINetFormat & rINetAttr
Definition: editsh.hxx:121
Marks a position in the document model.
Definition: pam.hxx:37
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
SetAttrMode
Definition: swtypes.hxx:133
SwUndoId
Definition: swundo.hxx:30
SplitTable_HeadlineOption
Definition: tblenum.hxx:55
TableChgMode
Definition: tblenum.hxx:48
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:46
SwTOIKeyType
Definition: toxe.hxx:31
TOXTypes
Definition: toxe.hxx:40
TransliterationFlags
unsigned char sal_uInt8
sal_uInt16 sal_Unicode