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;
84class SwWrtShell;
85struct SwConversionArgs;
88struct SwDBData;
89enum class SvtScriptType : sal_uInt8;
91enum class RedlineFlags;
92enum class TransliterationFlags;
93enum class GraphicType;
94
95namespace com::sun::star::uno { template < class > class Sequence; }
96namespace com::sun::star::linguistic2 { class XSpellAlternatives; }
97namespace com::sun::star::linguistic2 { struct ProofreadingResult; }
98
99namespace svx{
100 struct SpellPortion;
101 typedef std::vector<SpellPortion> SpellPortions;
103}
104
105namespace sfx2{
106 class LinkManager;
107}
108
109namespace sw {
110 class UndoRedoContext;
111}
112
113enum class ParaBreakType {
114 ToBlank = 0,
115 ToOnlyCR = 2
116};
117
120{
121 OUString sText;
123
124 SwGetINetAttr( OUString aText, const SwTextINetFormat& rAttr )
125 : sText(std::move( aText )), rINetAttr( rAttr )
126 {}
127};
128typedef std::vector<SwGetINetAttr> SwGetINetAttrs;
129
130// Types of forms of content.
131#define CNT_TXT 0x0001
132#define CNT_GRF 0x0002
133#define CNT_OLE 0x0010
134
135// Test USHORT for a defined form of content.
136#define CNT_HasText(USH) ((USH)&CNT_TXT)
137#define CNT_HasGrf(USH) ((USH)&CNT_GRF)
138#define CNT_HasOLE(USH) ((USH)&CNT_OLE)
139
141{
143
145 friend class SwAutoFormat;
146 friend void InitCore();
147 friend void FinitCore();
149 friend class SwUndo;
150
153 SAL_DLLPRIVATE SwGrfNode *GetGrfNode_() const ;
154
155 SAL_DLLPRIVATE void DeleteSel(SwPaM& rPam, bool isArtificialSelection, bool* pUndo = nullptr);
156
157 SAL_DLLPRIVATE void SetSectionAttr_( SwSectionFormat& rSectFormat, const SfxItemSet& rSet );
158
160 using sw::BroadcastingModify::GetInfo;
161
162public:
164 void Insert( sal_Unicode, bool bOnlyCurrCursor = false );
165 void Insert2( const OUString &, const bool bForceExpandHints = false );
166 void Overwrite( const OUString & );
167
173 bool Replace( const OUString& rNewStr, bool bRegExpRplc );
174
177 bool Delete(bool isArtificialSelection = false);
178
180 bool DelFullPara();
181
183 void TransliterateText( TransliterationFlags nType );
184
186 void CountWords( SwDocStat& rStat ) const;
187
189 bool ConvertFieldsToText();
190
192 void SetNumberingRestart();
193
195 sal_uInt16 GetLinkUpdMode() const;
196 void SetLinkUpdMode( sal_uInt16 nMode );
197
199 bool Copy( SwEditShell& rDestShell );
200
205 bool CopySelToDoc( SwDoc& rInsDoc );
206
207 void SplitNode( bool bAutoFormat = false, bool bCheckTableStart = true );
208 bool AppendTextNode();
209 void AutoFormatBySplitNode();
210
213 void DelINetAttrWithText();
214
217 bool DontExpandFormat();
218
228 bool GetPaMAttr( SwPaM* pPaM, SfxItemSet& ,
229 const bool bMergeIndentValuesOfNumRule = false ) const;
230 bool GetCurAttr( SfxItemSet& ,
231 const bool bMergeIndentValuesOfNumRule = false ) const;
232 void SetAttrItem( const SfxPoolItem&, SetAttrMode nFlags = SetAttrMode::DEFAULT,
233 const bool bParagraphSetting = false );
234 void SetAttrSet( const SfxItemSet&, SetAttrMode nFlags = SetAttrMode::DEFAULT,
235 SwPaM* pCursor = nullptr, const bool bParagraphSetting = false );
236
241 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
242
252 void GetCurParAttr( SfxItemSet& rSet ) const;
263 void GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const;
264
266 void SetDefault( const SfxPoolItem& );
267
269 const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint ) const;
270 template<class T> const T& GetDefault( TypedWhichId<T> nWhich ) const
271 {
272 return static_cast<const T&>(GetDefault(sal_uInt16(nWhich)));
273 }
274
275 void ResetAttr( const o3tl::sorted_vector<sal_uInt16> &attrs = o3tl::sorted_vector<sal_uInt16>(), SwPaM* pCursor = nullptr );
276 void GCAttr();
277
279 SvtScriptType GetScriptType() const;
280
282 LanguageType GetCurLang() const;
283
285 size_t GetTableFrameFormatCount( bool bUsed = false ) const;
286 SwFrameFormat& GetTableFrameFormat(size_t nFormat, bool bUsed = false ) const;
287 OUString GetUniqueTableName() const;
288
290 sal_uInt16 GetCharFormatCount() const;
291 SwCharFormat& GetCharFormat(sal_uInt16 nFormat) const;
292 SwCharFormat* GetCurCharFormat() const;
293 void FillByEx(SwCharFormat*);
294 SwCharFormat* MakeCharFormat( const OUString& rName );
295 SwCharFormat* FindCharFormatByName( const OUString& rName ) const;
296
297 /* FormatCollections (new) - Explaining the general naming pattern:
298 * GetXXXCount() returns the count of xxx in the document.
299 * GetXXX(i) returns i-th xxx (ERR_RAISE if beyond range!).
300 * DelXXX(i) deletes i-th xxx (ERR_RAISE if beyond range!).
301 * GetCurXXX() returns xxx that is valid at cursor or in ranges.
302 * returns 0, if not unanimous.
303 * SetXXX() sets xxx at cursor or in ranges.
304 * MakeXXX() makes a xxx, derived from pDerivedFrom.
305 */
306
307 // TXT
308 SwTextFormatColl& GetDfltTextFormatColl() const;
309 sal_uInt16 GetTextFormatCollCount() const;
310 SwTextFormatColl& GetTextFormatColl( sal_uInt16 nTextFormatColl) const;
330 SwTextFormatColl* GetPaMTextFormatColl( SwPaM* pPaM ) const;
331
332 // #i62675#
334 void SetTextFormatColl(SwTextFormatColl*, const bool bResetListAttrs = false);
335 SwTextFormatColl *MakeTextFormatColl(const OUString &rFormatCollName,
336 SwTextFormatColl *pDerivedFrom = nullptr);
337 void FillByEx(SwTextFormatColl*);
338 SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const;
339
341 SwTextFormatColl* GetTextCollFromPool( sal_uInt16 nId );
342
344 SwFormat* GetFormatFromPool( sal_uInt16 nId );
345
347 SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
348
350 bool IsUsed( const sw::BroadcastingModify& ) const;
351
354 { return static_cast<SwFrameFormat*>(SwEditShell::GetFormatFromPool( nId )); }
356 { return static_cast<SwCharFormat*>(SwEditShell::GetFormatFromPool( nId )); }
357
358 void SetClassification(const OUString& rName, SfxClassificationPolicyType eType);
359 void ApplyAdvancedClassification(std::vector<svx::ClassificationResult> const & rResult);
360 std::vector<svx::ClassificationResult> CollectAdvancedClassification();
361
362 SfxWatermarkItem GetWatermark() const;
363 void SetWatermark(const SfxWatermarkItem& rText);
364
366 void SignParagraph();
367
369 void ValidateParagraphSignatures(SwTextNode* pNode, bool updateDontRemove);
370
372 void ValidateCurrentParagraphSignatures(bool updateDontRemove);
373
375 void ValidateAllParagraphSignatures(bool updateDontRemove);
376
381 void RestoreMetadataFieldsAndValidateParagraphSignatures();
382
385 void ClassifyDocPerHighestParagraphClass();
386
388 void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
389 std::vector<svx::ClassificationResult> CollectParagraphClassification();
390
393 bool IsCursorInParagraphMetadataField() const;
394
398 bool RemoveParagraphMetadataFieldAtCursor();
399
400 bool InsertField(SwField const &, const bool bForceExpandHints);
401
402 void UpdateOneField(SwField &);
403
404 size_t GetFieldTypeCount(SwFieldIds nResId = SwFieldIds::Unknown) const;
405 SwFieldType* GetFieldType(size_t nField, SwFieldIds nResId = SwFieldIds::Unknown) const;
406 SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName) const;
407
408 void RemoveFieldType(size_t nField);
409 void RemoveFieldType(SwFieldIds nResId, const OUString& rName);
410
411 void FieldToText( SwFieldType const * pType );
412
413 void ChangeAuthorityData(const SwAuthEntry* pNewData);
414
416 SwDBData const & GetDBData() const;
417 void ChgDBData(const SwDBData& SwDBData);
418 void ChangeDBFields( const std::vector<OUString>& rOldNames,
419 const OUString& rNewName );
420 void GetAllUsedDB( std::vector<OUString>& rDBNameList,
421 std::vector<OUString> const * pAllDBNames );
422
423 bool IsAnyDatabaseFieldInDoc()const;
424
426 bool IsFieldDataSourceAvailable(OUString& rUsedDataSource) const;
427 void UpdateExpFields(bool bCloseDB = false);
428 void LockExpFields();
429 void UnlockExpFields();
430 bool IsExpFieldsLocked() const;
431
432 SwFieldUpdateFlags GetFieldUpdateFlags() const;
433 void SetFieldUpdateFlags( SwFieldUpdateFlags eFlags );
434
436 SwDBManager* GetDBManager() const;
437
438 SwFieldType* InsertFieldType(const SwFieldType &);
439
441 bool IsModified() const;
442 void SetModified();
443 void ResetModified();
444 void SetUndoNoResetModified();
445
447 void UpdateDocStat();
448 const SwDocStat &GetUpdatedDocStat();
449
450 void Insert(const SwTOXMark& rMark);
451
452 void DeleteTOXMark(SwTOXMark const * pMark);
453
455 void GetCurTOXMarks(SwTOXMarks& rMarks) const ;
456
458 void InsertTableOf(const SwTOXBase& rTOX,
459 const SfxItemSet* pSet = nullptr);
460 void UpdateTableOf(const SwTOXBase& rTOX,
461 const SfxItemSet* pSet = nullptr);
462 const SwTOXBase* GetCurTOX() const;
463 const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false );
464 void SetDefaultTOXBase(const SwTOXBase& rBase);
465
466 static bool IsTOXBaseReadonly(const SwTOXBase& rTOXBase);
467 void SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly);
468
469 sal_uInt16 GetTOXCount() const;
470 const SwTOXBase* GetTOX( sal_uInt16 nPos ) const;
471 bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes );
472
474 void SetUpdateTOX( bool bFlag );
475 bool IsUpdateTOX() const;
476
478 sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const;
479 const SwTOXType* GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const;
480 void InsertTOXType(const SwTOXType& rTyp);
481
483 OUString const & GetTOIAutoMarkURL() const;
484 void SetTOIAutoMarkURL(const OUString& rSet);
485 void ApplyAutoMark();
486
488 void GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
489
490 void SetOutlineNumRule(const SwNumRule&);
491 const SwNumRule* GetOutlineNumRule() const;
492
493 bool OutlineUpDown( short nOffset = 1 );
494
495 bool MoveOutlinePara( SwOutlineNodes::difference_type nOffset );
496
497 bool IsProtectedOutlinePara() const;
498
499 const SwNumRule* GetNumRuleAtCurrCursorPos() const;
500
503 const SwNumRule* GetNumRuleAtCurrentSelection() const;
504
513 void SetCurNumRule( const SwNumRule&,
514 const bool bCreateNewList /*= false*/,
515 const OUString& sContinuedListId = OUString(),
516 const bool bResetIndentAttrs = false );
517
519 void NoNum();
520
522 void DelNumRules();
523
524 void NumUpDown( bool bDown = true );
525
526 bool MoveParagraph( SwNodeOffset nOffset = SwNodeOffset(1));
527 bool MoveNumParas( bool bUpperLower, bool bUpperLeft );
528
530 bool NumOrNoNum(bool bDelete = false, bool bChkStart = true);
531
532 // #i23726#
533 // #i90078#
535 // Adjust method name and parameter name
536 void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
537 // Adjust method name
538 void SetIndent(short nIndent, const SwPosition & rPos);
539 bool IsFirstOfNumRuleAtCursorPos() const;
540
541 bool IsNoNum( bool bChkStart = true ) const;
542
545 sal_uInt8 GetNumLevel() const;
546
548 void GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower );
549
551 int GetCurrentParaOutlineLevel( ) const;
552
553 // i29560
554 bool HasNumber() const;
555 bool HasBullet() const;
556
557 bool SelectionHasNumber() const;
558 bool SelectionHasBullet() const;
559
560 OUString GetUniqueNumRuleName() const;
561 void ChgNumRuleFormats( const SwNumRule& rRule );
562
564 void SetNumRuleStart( bool bFlag, SwPaM* pCursor );
565 bool IsNumRuleStart( SwPaM* pPaM = nullptr ) const;
566 void SetNodeNumStart( sal_uInt16 nStt );
567
568 sal_uInt16 GetNodeNumStart( SwPaM* pPaM ) const;
569
570 void ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule );
571
575 const SwNumRule * SearchNumRule(const bool bNum,
576 OUString& sListId );
577
581 void DoUndo( bool bOn = true );
582 bool DoesUndo() const;
583 void DoGroupUndo( bool bUn );
584 bool DoesGroupUndo() const;
585 void DelAllUndoObj();
586
588 SwUndoId StartUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
589
591 SwUndoId EndUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
592
593 bool GetLastUndoInfo(OUString *const o_pStr,
594 SwUndoId *const o_pId,
595 const SwView* pView = nullptr) const;
596 bool GetFirstRedoInfo(OUString *const o_pStr,
597 SwUndoId *const o_pId,
598 const SwView* pView = nullptr) const;
599 SwUndoId GetRepeatInfo(OUString *const o_pStr) const;
600
602 bool CursorsLocked() const;
605 void HandleUndoRedoContext(::sw::UndoRedoContext & rContext);
606
607 void Undo(sal_uInt16 const nCount = 1, sal_uInt16 nOffset = 0);
608 void Redo(sal_uInt16 const nCount = 1);
609 void Repeat(sal_uInt16 const nCount);
610
612 void StartAllAction();
613 void EndAllAction();
614
616 virtual void CalcLayout() override;
617
619 sal_uInt16 GetCntType() const;
620
622 bool HasOtherCnt() const;
623
625 virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
626
628 virtual void InfoReadOnlyDialog(bool /*bAsync*/) const
629 {
630 // override in SwWrtShell
631 }
632
634 virtual bool WarnHiddenSectionDialog() const
635 {
636 // override in SwWrtShell
637 return true;
638 }
639
641 virtual bool WarnSwitchToDesignModeDialog() const
642 {
643 // override in SwWrtShell
644 return false;
645 }
646
648 void GetSelectedText( OUString &rBuf,
649 ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
650
654 const Graphic* GetGraphic( bool bWait = true ) const;
655 const GraphicObject* GetGraphicObj() const;
656 const GraphicAttr* GetGraphicAttr( GraphicAttr& rGA ) const;
657
658 bool IsLinkedGrfSwapOut() const;
659 GraphicType GetGraphicType() const;
660
661 const tools::PolyPolygon *GetGraphicPolygon() const;
662 void SetGraphicPolygon( const tools::PolyPolygon *pPoly );
663
666 void ClearAutomaticContour();
667
669 bool GetGrfSize(Size&) const;
670
674 void GetGrfNms( OUString* pGrfName, OUString* pFltName,
675 const SwFlyFrameFormat* = nullptr ) const;
676
678 void ReRead( const OUString& rGrfName, const OUString& rFltName,
679 const Graphic* pGraphic = nullptr );
680
682 void *GetIMapInventor() const;
683
684 // #i73788#
686 Graphic GetIMapGraphic() const;
687 const SwFlyFrameFormat* FindFlyByName( const OUString& rName ) const;
688
692 svt::EmbeddedObjectRef& GetOLEObject() const;
693
695 bool HasOLEObj( std::u16string_view rName ) const;
696
698 void SetChartName( const OUString &rName );
699
701 void UpdateCharts( const OUString& rName );
702
703 OUString GetCurWord() const;
704
707 void InsertGlossary( SwTextBlocks& rGlossary, const OUString& );
708
711 sal_uInt16 MakeGlossary( SwTextBlocks& rToFill, const OUString& rName,
712 const OUString& rShortName, bool bSaveRelFile,
713 const OUString* pOnlyText );
714
716 sal_uInt16 SaveGlossaryDoc( SwTextBlocks& rGlossary, const OUString& rName,
717 const OUString& rShortName,
718 bool bSaveRelFile,
719 bool bOnlyText );
720
721 // Linguistics...
723 void HyphStart( SwDocPositions eStart, SwDocPositions eEnd );
724
726 void HyphEnd();
727 css::uno::Reference< css::uno::XInterface>
728 HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
729
730 void HyphIgnore();
731
733 static void InsertSoftHyph( const sal_Int32 nHyphPos );
734
740 const SwTable& InsertTable( const SwInsertTableOptions& rInsTableOpts,
741 sal_uInt16 nRows, sal_uInt16 nCols,
742 const SwTableAutoFormat* pTAFormat = nullptr );
743
744 void InsertDDETable( const SwInsertTableOptions& rInsTableOpts,
745 SwDDEFieldType* pDDEType,
746 sal_uInt16 nRows, sal_uInt16 nCols );
747
748 void UpdateTable();
749 void SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName );
750
751 SwFrameFormat *GetTableFormat();
752 bool TextToTable( const SwInsertTableOptions& rInsTableOpts,
753 sal_Unicode cCh,
754 const SwTableAutoFormat* pTAFormat = nullptr );
755 bool TableToText( sal_Unicode cCh );
756 bool IsTextToTableAvailable() const;
757
758 bool GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const;
759 void SetTableBoxFormulaAttrs( const SfxItemSet& rSet );
760
761 bool IsTableBoxTextFormat() const;
762 OUString GetTableBoxText() const;
763
764 TableChgMode GetTableChgMode() const;
765 void SetTableChgMode( TableChgMode eMode );
766
768 void SplitTable( SplitTable_HeadlineOption eMode );
769
774 bool CanMergeTable( bool bWithPrev = true, bool* pChkNxtPrv = nullptr ) const;
775 bool MergeTable( bool bWithPrev );
776
778 void AppendUndoForInsertFromDB( bool bIsTable );
779
781
783 void SpellStart( SwDocPositions eStart, SwDocPositions eEnd,
784 SwDocPositions eCurr, SwConversionArgs *pConvArgs = nullptr );
785
787 void SpellEnd( SwConversionArgs const *pConvArgs = nullptr, bool bRestoreSelection = true );
788 css::uno::Any SpellContinue(
789 sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
790 SwConversionArgs const *pConvArgs );
791
794 bool SpellSentence(svx::SpellPortions& rToFill, bool bIsGrammarCheck );
795
797 static void PutSpellingToSentenceStart();
798
800 static void MoveContinuationPosToEndOfCheckedSentence();
801
803 void ApplyChangedSentence(const svx::SpellPortions& rNewPortions, bool bRecheck);
804
806 static bool HasLastSentenceGotGrammarChecked();
807
809 static bool HasConvIter();
810
812 static bool HasHyphIter();
813
814 void HandleCorrectionError(const OUString& aText, SwPosition aPos, sal_Int32 nBegin,
815 sal_Int32 nLen, const Point* pPt,
816 SwRect& rSelectRect);
817 css::uno::Reference< css::linguistic2::XSpellAlternatives >
818 GetCorrection( const Point* pPt, SwRect& rSelectRect );
819
820 bool GetGrammarCorrection( css::linguistic2::ProofreadingResult /*out*/ &rResult,
821 sal_Int32 /*out*/ &rErrorPosInText,
822 sal_Int32 /*out*/ &rErrorIndexInResult,
823 css::uno::Sequence< OUString > /*out*/ &rSuggestions,
824 const Point* pPt, SwRect& rSelectRect );
825
826 static void IgnoreGrammarErrorAt( SwPaM& rErrorPosition );
827 void SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd );
828
830 const SwFormatRefMark* GetRefMark( std::u16string_view rName ) const;
831
834 sal_uInt16 GetRefMarks( std::vector<OUString>* = nullptr ) const;
835
837 void AutoCorrect( SvxAutoCorrect& rACorr, bool bInsertMode,
838 sal_Unicode cChar );
839 OUString GetPrevAutoCorrWord(SvxAutoCorrect& rACorr);
840
841 // We consider no more than 9 characters before the cursor, and they must not start in the
842 // middle of a word (leading spaces are OK)
843 std::vector<OUString> GetChunkForAutoText();
844
846 void AutoFormat( const SvxSwAutoFormatFlags* pAFlags );
847
848 static SvxSwAutoFormatFlags* GetAutoFormatFlags();
849 static void SetAutoFormatFlags(SvxSwAutoFormatFlags const *);
850
852 OUString Calculate();
853
854 bool InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr,
855 bool bKeepSelection = false );
856 void GetINetAttrs(SwGetINetAttrs& rArr , bool bIncludeInToxContent = true);
857
858 OUString GetDropText( const sal_Int32 nChars ) const;
859 void ReplaceDropText( const OUString &rStr, SwPaM* pPaM = nullptr );
860
863 bool IsOutlineMovable( SwOutlineNodes::size_type nIdx ) const;
864 bool IsOutlineCopyable( SwOutlineNodes::size_type nIdx ) const;
865
866 sal_Int32 GetLineCount();
867
869 bool GetCurFootnote( SwFormatFootnote* pToFillFootnote = nullptr );
870 bool SetCurFootnote( const SwFormatFootnote& rFillFootnote );
871 bool HasFootnotes( bool bEndNotes = false ) const;
872
873 size_t GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes = false );
875
876 SwSection const* InsertSection(
877 SwSectionData & rNewData, SfxItemSet const*const = nullptr );
878 bool IsInsRegionAvailable() const;
879 const SwSection* GetCurrSection() const;
880
886 SwSection* GetAnySection( bool bOutOfTab = false, const Point* pPt = nullptr );
887
888 size_t GetSectionFormatCount() const;
889 size_t GetSectionFormatPos(const SwSectionFormat&) const;
890 const SwSectionFormat& GetSectionFormat(size_t nFormat) const;
891 void DelSectionFormat( size_t nFormat);
892 void UpdateSection( size_t const nSect, SwSectionData &,
893 SfxItemSet const*const = nullptr);
894 bool IsAnySectionInDoc() const;
895
896 OUString GetUniqueSectionName( const OUString* pChkStr = nullptr ) const;
897
899 void SetSectionAttr(const SfxItemSet& rSet, SwSectionFormat* pSectFormat = nullptr);
900
904 sal_uInt16 GetFullSelectedSectionCount() const;
905
911 void DoSpecialInsert();
912 bool CanSpecialInsert() const;
913
915 void SetNewDoc();
916
917 sfx2::LinkManager& GetLinkManager();
918 inline const sfx2::LinkManager& GetLinkManager() const;
919
923 bool IsMoveLeftMargin( bool bRight, bool bModulus = true ) const;
924 void MoveLeftMargin( bool bRight, bool bModulus = true );
925
927 SvNumberFormatter* GetNumberFormatter();
929 { return const_cast<SwEditShell*>(this)->GetNumberFormatter(); }
930
932 bool IsGlobalDoc() const;
933 void SetGlblDocSaveLinks( bool bFlag );
934 bool IsGlblDocSaveLinks() const;
935 void GetGlobalDocContent( SwGlblDocContents& rArr ) const;
936 void InsertGlobalDocContent( const SwGlblDocContent& rPos,
937 SwSectionData & rNew );
938 bool InsertGlobalDocContent( const SwGlblDocContent& rPos,
939 const SwTOXBase& rTOX );
940 bool InsertGlobalDocContent( const SwGlblDocContent& rPos );
941 void DeleteGlobalDocContent( const SwGlblDocContents& rArr,
942 size_t nPos );
943 bool MoveGlobalDocContent( const SwGlblDocContents& rArr ,
944 size_t nFromPos, size_t nToPos,
945 size_t nNewPos );
946 void GotoGlobalDocContent( const SwGlblDocContent& rPos );
947
950 void SetRedlineFlags( RedlineFlags eMode );
951 bool IsRedlineOn() const;
952 SwRedlineTable::size_type GetRedlineCount() const;
953 const SwRangeRedline& GetRedline( SwRedlineTable::size_type nPos ) const;
954 bool AcceptRedline( SwRedlineTable::size_type nPos );
955 bool RejectRedline( SwRedlineTable::size_type nPos );
956 bool AcceptRedlinesInSelection();
957 bool RejectRedlinesInSelection();
958
961 SwRedlineTable::size_type FindRedlineOfData( const SwRedlineData& ) const;
962
964 bool SetRedlineComment( const OUString& rS );
965 const SwRangeRedline* GetCurrRedline() const;
966
968 void UpdateRedlineAttr();
969
971 tools::Long CompareDoc( const SwDoc& rDoc );
972
974 tools::Long MergeDoc( const SwDoc& rDoc );
975
977 const SwFootnoteInfo& GetFootnoteInfo() const;
978 void SetFootnoteInfo(const SwFootnoteInfo& rInfo);
979 const SwEndNoteInfo& GetEndNoteInfo() const;
980 void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
981
982 const SwLineNumberInfo &GetLineNumberInfo() const;
983 void SetLineNumberInfo( const SwLineNumberInfo& rInfo);
984
986 void SetLabelDoc( bool bFlag );
987 bool IsLabelDoc() const;
988
990 void CreateExtTextInput(LanguageType eInputLanguage);
991 OUString DeleteExtTextInput( bool bInsText = true);
992 void SetExtTextInputData( const CommandExtTextInputData& );
993
995 bool IsParagraphSignatureValidationEnabled() const { return m_bDoParagraphSignatureValidation; }
997 bool SetParagraphSignatureValidation(const bool bEnable)
998 {
999 const bool bOldFlag = m_bDoParagraphSignatureValidation;
1000 m_bDoParagraphSignatureValidation = bEnable;
1001 return bOldFlag;
1002 }
1003
1005 static SwAutoCompleteWord& GetAutoCompleteWords();
1006
1009 sal_uInt16 GetScalingOfSelectedText() const;
1010
1011 bool IsNbspRunNext() const { return m_bNbspRunNext; }
1012
1014 SwEditShell( SwDoc&, vcl::Window*, const SwViewOption *pOpt );
1015
1018 virtual ~SwEditShell() override;
1019
1020private:
1021 SwEditShell(const SwEditShell &) = delete;
1022 const SwEditShell &operator=(const SwEditShell &) = delete;
1023
1024 /* TODO: this flag may have to be invalidated / reset to false at various
1025 * places if it was true and the edit cursor position changes. It's somehow
1026 * overkill though because it can only be true if a NO-BREAK SPACE was
1027 * inserted by the last DoAutoCorrect() call (in French language), any
1028 * subsequent call will reset it anyway and just if the cursor is
1029 * positioned behind "x :" and the next character inserted is not a space
1030 * the existing nb-space will be removed. Bear this in mind if that problem
1031 * arises. */
1034};
1035
1037{ return const_cast<SwEditShell*>(this)->GetLinkManager(); }
1038
1042public:
1043 SwActContext(SwEditShell *pShell);
1044 ~SwActContext() COVERITY_NOEXCEPT_FALSE;
1045};
1046
1050public:
1051 SwMvContext(SwEditShell *pShell);
1052 ~SwMvContext() COVERITY_NOEXCEPT_FALSE;
1053};
1054
1055#endif
1056
1057/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static SwTOXBase & GetTOX(SwDoc &rDoc, SwNodeOffset const nNodeIndex)
static void EndUndo(SwWrtShell &rSh)
Definition: basesh.cxx:3011
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1040
SwActContext(SwEditShell *pShell)
Definition: edws.cxx:161
~SwActContext() COVERITY_NOEXCEPT_FALSE
Definition: edws.cxx:167
SwEditShell & m_rShell
Definition: editsh.hxx:1041
Represents the style of a text portion.
Definition: charfmt.hxx:27
Definition: doc.hxx:197
virtual bool WarnSwitchToDesignModeDialog() const
Switch to Design mode for Forms.
Definition: editsh.hxx:641
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:127
bool IsNbspRunNext() const
Definition: editsh.hxx:1011
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:355
SwEditShell(const SwEditShell &)=delete
bool m_bNbspRunNext
NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect()
Definition: editsh.hxx:1032
const T & GetDefault(TypedWhichId< T > nWhich) const
Definition: editsh.hxx:270
const SvNumberFormatter * GetNumberFormatter() const
Definition: editsh.hxx:928
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
Definition: editsh.hxx:997
bool m_bDoParagraphSignatureValidation
Prevent nested calls of ValidateParagraphSignatures.
Definition: editsh.hxx:1033
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
Definition: editsh.hxx:995
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:592
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:353
static SvxSwAutoFormatFlags * s_pAutoFormatFlags
Definition: editsh.hxx:142
virtual bool WarnHiddenSectionDialog() const
Selected area has hidden content.
Definition: editsh.hxx:634
const SwEditShell & operator=(const SwEditShell &)=delete
virtual void InfoReadOnlyDialog(bool) const
Selected area has readonly content.
Definition: editsh.hxx:628
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
Base class of all fields.
Definition: fldbas.hxx:296
SfxPoolItem subclass for footnotes and endnotes, stored in the anchor text node.
Definition: fmtftn.hxx:47
Base class for various Writer styles.
Definition: format.hxx:47
Style of a layout element.
Definition: frmfmt.hxx:72
< 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:1048
SwEditShell & m_rShell
Definition: editsh.hxx:1049
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
vector_type::size_type size_type
Definition: docary.hxx:223
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
SwTextAttr subclass that tracks the location of the wrapped SwFormatURL.
Definition: txtinet.hxx:30
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
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:120
virtual void Undo() override
Definition: undobj.cxx:209
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2205
virtual void CalcLayout()
Definition: viewsh.cxx:1075
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
Definition: viewsh.cxx:722
Definition: view.hxx:146
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
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:128
ParaBreakType
Definition: editsh.hxx:113
SwFieldIds
Definition: fldbas.hxx:49
SwFieldUpdateFlags
Definition: fldupde.hxx:23
GraphicType
void InitCore()
Definition: init.cxx:459
void FinitCore()
Definition: init.cxx:684
SvtScriptType
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:634
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:120
OUString sText
Definition: editsh.hxx:121
SwGetINetAttr(OUString aText, const SwTextINetFormat &rAttr)
Definition: editsh.hxx:124
const SwTextINetFormat & rINetAttr
Definition: editsh.hxx:122
Marks a position in the document model.
Definition: pam.hxx:38
#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