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 <vector>
34 #include <set>
35 
36 namespace tools { class PolyPolygon; }
37 class SwDoc;
39 
40 class SvNumberFormatter;
41 class SfxPoolItem;
42 class SfxItemSet;
43 class SfxWatermarkItem;
44 class SvxAutoCorrect;
45 
46 class SwDDEFieldType;
47 class SwDBManager;
48 
49 struct SwDocStat;
50 class SwAutoCompleteWord;
51 
52 class SwFormatRefMark;
53 
54 class SwNumRule;
55 
56 class SwTextFormatColl;
57 class SwGrfNode;
58 
59 class Graphic;
60 class GraphicObject;
61 class GraphicAttr;
62 class SwFormatINetFormat;
63 class SwTable;
64 class SwTextBlocks;
65 class SwFormatFootnote;
66 class SwSection;
67 class SwSectionData;
68 class SwSectionFormat;
69 class SwTableAutoFormat;
70 class SwPageDesc;
71 class SwTextINetFormat;
72 class SwSeqFieldList;
73 class SwGlblDocContent;
74 class SwGlblDocContents;
75 class SwRangeRedline;
76 class SwRedlineData;
77 class SwFootnoteInfo;
78 class SwEndNoteInfo;
79 class SwLineNumberInfo;
80 class SwAuthEntry;
81 class SwRewriter;
82 class SwView;
83 struct SwConversionArgs;
86 struct SwDBData;
87 enum class SvtScriptType;
89 enum class RedlineFlags;
90 enum class TransliterationFlags;
91 enum class GraphicType;
92 
93 namespace com { namespace sun { namespace star { namespace uno {
94  template < class > class Sequence;
95 }}}}
96 namespace com { namespace sun { namespace star { namespace linguistic2 { class XSpellAlternatives; } } } }
97 namespace com { namespace sun { namespace star { namespace linguistic2 { struct ProofreadingResult; } } } }
98 
99 namespace svx{
100  struct SpellPortion;
101  typedef std::vector<SpellPortion> SpellPortions;
102  class ClassificationResult;
103 }
104 
105 namespace sfx2{
106  class LinkManager;
107 }
108 
109 namespace sw {
110  class UndoRedoContext;
111 }
112 
113 enum class ParaBreakType {
114  ToBlank = 0,
115  ToOnlyCR = 2
116 };
117 
120 {
121  OUString const sText;
123 
124  SwGetINetAttr( const OUString& rText, const SwTextINetFormat& rAttr )
125  : sText( rText ), rINetAttr( rAttr )
126  {}
127 };
128 typedef 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* pUndo = nullptr );
156 
157  SAL_DLLPRIVATE void SetSectionAttr_( SwSectionFormat& rSectFormat, const SfxItemSet& rSet );
158 
160  using SwModify::GetInfo;
161 
162 public:
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();
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* pDestShell );
200 
205  bool CopySelToDoc( SwDoc* pInsDoc );
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;
266  bool GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const;
267 
269  void SetDefault( const SfxPoolItem& );
270 
272  const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint ) const;
273  template<class T> const T& GetDefault( TypedWhichId<T> nWhich ) const
274  {
275  return static_cast<const T&>(GetDefault(sal_uInt16(nWhich)));
276  }
277 
278  void ResetAttr( const std::set<sal_uInt16> &attrs = std::set<sal_uInt16>(), SwPaM* pCursor = nullptr );
279  void GCAttr();
280 
282  SvtScriptType GetScriptType() const;
283 
285  LanguageType GetCurLang() const;
286 
288  size_t GetTableFrameFormatCount( bool bUsed = false ) const;
289  SwFrameFormat& GetTableFrameFormat(size_t nFormat, bool bUsed = false ) const;
290  OUString GetUniqueTableName() const;
291 
293  sal_uInt16 GetCharFormatCount() const;
294  SwCharFormat& GetCharFormat(sal_uInt16 nFormat) const;
295  SwCharFormat* GetCurCharFormat() const;
296  void FillByEx(SwCharFormat*);
297  SwCharFormat* MakeCharFormat( const OUString& rName );
298  SwCharFormat* FindCharFormatByName( const OUString& rName ) const;
299 
300  /* FormatCollections (new) - Explaining the general naming pattern:
301  * GetXXXCount() returns the count of xxx in the document.
302  * GetXXX(i) returns i-th xxx (ERR_RAISE if beyond range!).
303  * DelXXX(i) deletes i-th xxx (ERR_RAISE if beyond range!).
304  * GetCurXXX() returns xxx that is valid at cursor or in ranges.
305  * returns 0, if not unanimous.
306  * SetXXX() sets xxx at cursor or in ranges.
307  * MakeXXX() makes a xxx, derived from pDerivedFrom.
308  */
309 
310  // TXT
311  SwTextFormatColl& GetDfltTextFormatColl() const;
312  sal_uInt16 GetTextFormatCollCount() const;
313  SwTextFormatColl& GetTextFormatColl( sal_uInt16 nTextFormatColl) const;
333  SwTextFormatColl* GetPaMTextFormatColl( SwPaM* pPaM ) const;
334 
335  // #i62675#
337  void SetTextFormatColl(SwTextFormatColl*, const bool bResetListAttrs = false);
338  SwTextFormatColl *MakeTextFormatColl(const OUString &rFormatCollName,
339  SwTextFormatColl *pDerivedFrom = nullptr);
340  void FillByEx(SwTextFormatColl*);
341  SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const;
342 
344  SwTextFormatColl* GetTextCollFromPool( sal_uInt16 nId );
345 
347  SwFormat* GetFormatFromPool( sal_uInt16 nId );
348 
350  SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
351 
353  bool IsUsed( const SwModify& ) const;
354 
357  { return static_cast<SwFrameFormat*>(SwEditShell::GetFormatFromPool( nId )); }
359  { return static_cast<SwCharFormat*>(SwEditShell::GetFormatFromPool( nId )); }
360 
361  void SetClassification(const OUString& rName, SfxClassificationPolicyType eType);
362  void ApplyAdvancedClassification(std::vector<svx::ClassificationResult> const & rResult);
363  std::vector<svx::ClassificationResult> CollectAdvancedClassification();
364 
365  SfxWatermarkItem GetWatermark();
366  void SetWatermark(const SfxWatermarkItem& rText);
367 
369  void SignParagraph();
370 
372  void ValidateParagraphSignatures(SwTextNode* pNode, bool updateDontRemove);
373 
375  void ValidateCurrentParagraphSignatures(bool updateDontRemove);
376 
378  void ValidateAllParagraphSignatures(bool updateDontRemove);
379 
384  void RestoreMetadataFieldsAndValidateParagraphSignatures();
385 
388  void ClassifyDocPerHighestParagraphClass();
389 
391  void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
392  std::vector<svx::ClassificationResult> CollectParagraphClassification();
393 
396  bool IsCursorInParagraphMetadataField() const;
397 
401  bool RemoveParagraphMetadataFieldAtCursor();
402 
403  void Insert2(SwField const &, const bool bForceExpandHints);
404 
405  void UpdateOneField(SwField &);
406 
407  size_t GetFieldTypeCount(SwFieldIds nResId = SwFieldIds::Unknown) const;
408  SwFieldType* GetFieldType(size_t nField, SwFieldIds nResId = SwFieldIds::Unknown) const;
409  SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName) const;
410 
411  void RemoveFieldType(size_t nField);
412  void RemoveFieldType(SwFieldIds nResId, const OUString& rName);
413 
414  void FieldToText( SwFieldType const * pType );
415 
416  void ChangeAuthorityData(const SwAuthEntry* pNewData);
417 
419  SwDBData const & GetDBData() const;
420  const SwDBData& GetDBDesc() const;
421  void ChgDBData(const SwDBData& SwDBData);
422  void ChangeDBFields( const std::vector<OUString>& rOldNames,
423  const OUString& rNewName );
424  void GetAllUsedDB( std::vector<OUString>& rDBNameList,
425  std::vector<OUString> const * pAllDBNames );
426 
427  bool IsAnyDatabaseFieldInDoc()const;
428 
430  bool IsFieldDataSourceAvailable(OUString& rUsedDataSource) const;
431  void UpdateExpFields(bool bCloseDB = false);
432  void LockExpFields();
433  void UnlockExpFields();
434  bool IsExpFieldsLocked() const;
435 
436  SwFieldUpdateFlags GetFieldUpdateFlags() const;
437  void SetFieldUpdateFlags( SwFieldUpdateFlags eFlags );
438 
440  SwDBManager* GetDBManager() const;
441 
442  SwFieldType* InsertFieldType(const SwFieldType &);
443 
445  bool IsModified() const;
446  void SetModified();
447  void ResetModified();
448  void SetUndoNoResetModified();
449 
451  void UpdateDocStat();
452  const SwDocStat &GetUpdatedDocStat();
453 
454  void Insert(const SwTOXMark& rMark);
455 
456  void DeleteTOXMark(SwTOXMark const * pMark);
457 
459  void GetCurTOXMarks(SwTOXMarks& rMarks) const ;
460 
462  void InsertTableOf(const SwTOXBase& rTOX,
463  const SfxItemSet* pSet = nullptr);
464  void UpdateTableOf(const SwTOXBase& rTOX,
465  const SfxItemSet* pSet = nullptr);
466  const SwTOXBase* GetCurTOX() const;
467  const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false );
468  void SetDefaultTOXBase(const SwTOXBase& rBase);
469 
470  static bool IsTOXBaseReadonly(const SwTOXBase& rTOXBase);
471  void SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly);
472 
473  sal_uInt16 GetTOXCount() const;
474  const SwTOXBase* GetTOX( sal_uInt16 nPos ) const;
475  bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes );
476 
478  void SetUpdateTOX( bool bFlag );
479  bool IsUpdateTOX() const;
480 
482  sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const;
483  const SwTOXType* GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const;
484  void InsertTOXType(const SwTOXType& rTyp);
485 
487  OUString const & GetTOIAutoMarkURL() const;
488  void SetTOIAutoMarkURL(const OUString& rSet);
489  void ApplyAutoMark();
490 
492  void GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
493 
494  void SetOutlineNumRule(const SwNumRule&);
495  const SwNumRule* GetOutlineNumRule() const;
496 
497  bool OutlineUpDown( short nOffset = 1 );
498 
499  bool MoveOutlinePara( SwOutlineNodes::difference_type nOffset );
500 
501  bool IsProtectedOutlinePara() const;
502 
503  const SwNumRule* GetNumRuleAtCurrCursorPos() const;
504 
507  const SwNumRule* GetNumRuleAtCurrentSelection() const;
508 
517  void SetCurNumRule( const SwNumRule&,
518  const bool bCreateNewList /*= false*/,
519  const OUString& sContinuedListId = OUString(),
520  const bool bResetIndentAttrs = false );
521 
523  void NoNum();
524 
526  void DelNumRules();
527 
528  void NumUpDown( bool bDown = true );
529 
530  bool MoveParagraph( long nOffset = 1);
531  bool MoveNumParas( bool bUpperLower, bool bUpperLeft );
532 
534  bool NumOrNoNum(bool bDelete = false, bool bChkStart = true);
535 
536  // #i23726#
537  // #i90078#
539  // Adjust method name and parameter name
540  void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
541  // Adjust method name
542  void SetIndent(short nIndent, const SwPosition & rPos);
543  bool IsFirstOfNumRuleAtCursorPos() const;
544 
545  bool IsNoNum( bool bChkStart = true ) const;
546 
550  sal_uInt8 GetNumLevel() const;
551 
553  void GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower );
554 
556  int GetCurrentParaOutlineLevel( ) const;
557 
558  // i29560
559  bool HasNumber() const;
560  bool HasBullet() const;
561 
562  bool SelectionHasNumber() const;
563  bool SelectionHasBullet() const;
564 
565  OUString GetUniqueNumRuleName() const;
566  void ChgNumRuleFormats( const SwNumRule& rRule );
567 
569  void SetNumRuleStart( bool bFlag, SwPaM* pCursor );
570  bool IsNumRuleStart( SwPaM* pPaM = nullptr ) const;
571  void SetNodeNumStart( sal_uInt16 nStt );
572 
573  sal_uInt16 GetNodeNumStart( SwPaM* pPaM ) const;
574 
575  void ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule );
576 
580  const SwNumRule * SearchNumRule(const bool bNum,
581  OUString& sListId );
582 
586  void DoUndo( bool bOn = true );
587  bool DoesUndo() const;
588  void DoGroupUndo( bool bUn );
589  bool DoesGroupUndo() const;
590  void DelAllUndoObj();
591 
593  SwUndoId StartUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
594 
596  SwUndoId EndUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
597 
598  bool GetLastUndoInfo(OUString *const o_pStr,
599  SwUndoId *const o_pId,
600  const SwView* pView = nullptr) const;
601  bool GetFirstRedoInfo(OUString *const o_pStr,
602  SwUndoId *const o_pId,
603  const SwView* pView = nullptr) const;
604  SwUndoId GetRepeatInfo(OUString *const o_pStr) const;
605 
607  bool CursorsLocked() const;
610  void HandleUndoRedoContext(::sw::UndoRedoContext & rContext);
611 
612  void Undo(sal_uInt16 const nCount = 1);
613  void Redo(sal_uInt16 const nCount = 1);
614  void Repeat(sal_uInt16 const nCount);
615 
617  void StartAllAction();
618  void EndAllAction();
619 
621  virtual void CalcLayout() override;
622 
624  sal_uInt16 GetCntType() const;
625 
627  bool HasOtherCnt() const;
628 
630  virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
631 
633  void GetSelectedText( OUString &rBuf,
634  ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
635 
639  const Graphic* GetGraphic( bool bWait = true ) const;
640  const GraphicObject* GetGraphicObj() const;
641  const GraphicAttr* GetGraphicAttr( GraphicAttr& rGA ) const;
642 
643  bool IsLinkedGrfSwapOut() const;
644  GraphicType GetGraphicType() const;
645 
646  const tools::PolyPolygon *GetGraphicPolygon() const;
647  void SetGraphicPolygon( const tools::PolyPolygon *pPoly );
648 
651  void ClearAutomaticContour();
652 
654  bool GetGrfSize(Size&) const;
655 
659  void GetGrfNms( OUString* pGrfName, OUString* pFltName,
660  const SwFlyFrameFormat* = nullptr ) const;
661 
663  void ReRead( const OUString& rGrfName, const OUString& rFltName,
664  const Graphic* pGraphic = nullptr );
665 
667  void *GetIMapInventor() const;
668 
669  // #i73788#
671  Graphic GetIMapGraphic() const;
672  const SwFlyFrameFormat* FindFlyByName( const OUString& rName ) const;
673 
677  svt::EmbeddedObjectRef& GetOLEObject() const;
678 
680  bool HasOLEObj( const OUString &rName ) const;
681 
683  void SetChartName( const OUString &rName );
684 
686  void UpdateCharts( const OUString &rName );
687 
688  OUString GetCurWord();
689 
692  void InsertGlossary( SwTextBlocks& rGlossary, const OUString& );
693 
696  sal_uInt16 MakeGlossary( SwTextBlocks& rToFill, const OUString& rName,
697  const OUString& rShortName, bool bSaveRelFile,
698  const OUString* pOnlyText );
699 
701  sal_uInt16 SaveGlossaryDoc( SwTextBlocks& rGlossary, const OUString& rName,
702  const OUString& rShortName,
703  bool bSaveRelFile,
704  bool bOnlyText );
705 
706  // Linguistics...
708  void HyphStart( SwDocPositions eStart, SwDocPositions eEnd );
709 
711  void HyphEnd();
712  css::uno::Reference< css::uno::XInterface>
713  HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
714 
715  void HyphIgnore();
716 
718  static void InsertSoftHyph( const sal_Int32 nHyphPos );
719 
720  const SwTable& InsertTable( const SwInsertTableOptions& rInsTableOpts,
721  sal_uInt16 nRows, sal_uInt16 nCols,
722  const SwTableAutoFormat* pTAFormat = nullptr );
723 
724  void InsertDDETable( const SwInsertTableOptions& rInsTableOpts,
725  SwDDEFieldType* pDDEType,
726  sal_uInt16 nRows, sal_uInt16 nCols );
727 
728  void UpdateTable();
729  void SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName );
730 
731  SwFrameFormat *GetTableFormat();
732  bool TextToTable( const SwInsertTableOptions& rInsTableOpts,
733  sal_Unicode cCh,
734  const SwTableAutoFormat* pTAFormat = nullptr );
735  bool TableToText( sal_Unicode cCh );
736  bool IsTextToTableAvailable() const;
737 
738  bool GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const;
739  void SetTableBoxFormulaAttrs( const SfxItemSet& rSet );
740 
741  bool IsTableBoxTextFormat() const;
742  OUString GetTableBoxText() const;
743 
744  TableChgMode GetTableChgMode() const;
745  void SetTableChgMode( TableChgMode eMode );
746 
748  void SplitTable( SplitTable_HeadlineOption eMode );
749 
754  bool CanMergeTable( bool bWithPrev = true, bool* pChkNxtPrv = nullptr ) const;
755  bool MergeTable( bool bWithPrev );
756 
758  void AppendUndoForInsertFromDB( bool bIsTable );
759 
761 
763  void SpellStart( SwDocPositions eStart, SwDocPositions eEnd,
764  SwDocPositions eCurr, SwConversionArgs *pConvArgs = nullptr );
765 
767  void SpellEnd( SwConversionArgs const *pConvArgs = nullptr, bool bRestoreSelection = true );
768  css::uno::Any SpellContinue(
769  sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
770  SwConversionArgs const *pConvArgs );
771 
774  bool SpellSentence(svx::SpellPortions& rToFill, bool bIsGrammarCheck );
775 
777  static void PutSpellingToSentenceStart();
778 
780  static void MoveContinuationPosToEndOfCheckedSentence();
781 
783  void ApplyChangedSentence(const svx::SpellPortions& rNewPortions, bool bRecheck);
784 
786  static bool HasLastSentenceGotGrammarChecked();
787 
789  static bool HasConvIter();
790 
792  static bool HasHyphIter();
793 
794  void HandleCorrectionError(const OUString& aText, SwPosition aPos, sal_Int32 nBegin,
795  sal_Int32 nLen, const Point* pPt,
796  SwRect& rSelectRect);
797  css::uno::Reference< css::linguistic2::XSpellAlternatives >
798  GetCorrection( const Point* pPt, SwRect& rSelectRect );
799 
800  bool GetGrammarCorrection( css::linguistic2::ProofreadingResult /*out*/ &rResult,
801  sal_Int32 /*out*/ &rErrorPosInText,
802  sal_Int32 /*out*/ &rErrorIndexInResult,
803  css::uno::Sequence< OUString > /*out*/ &rSuggestions,
804  const Point* pPt, SwRect& rSelectRect );
805 
806  static void IgnoreGrammarErrorAt( SwPaM& rErrorPosition );
807  void SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd );
808 
810  const SwFormatRefMark* GetRefMark( const OUString& rName ) const;
811 
814  sal_uInt16 GetRefMarks( std::vector<OUString>* = nullptr ) const;
815 
817  void AutoCorrect( SvxAutoCorrect& rACorr, bool bInsertMode,
818  sal_Unicode cChar );
819  bool GetPrevAutoCorrWord( SvxAutoCorrect const & rACorr, OUString& rWord );
820 
822  void AutoFormat( const SvxSwAutoFormatFlags* pAFlags );
823 
824  static SvxSwAutoFormatFlags* GetAutoFormatFlags();
825  static void SetAutoFormatFlags(SvxSwAutoFormatFlags const *);
826 
828  OUString Calculate();
829 
830  bool InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr,
831  bool bKeepSelection = false );
832  void GetINetAttrs( SwGetINetAttrs& rArr );
833 
834  OUString GetDropText( const sal_Int32 nChars ) const;
835  void ReplaceDropText( const OUString &rStr, SwPaM* pPaM = nullptr );
836 
839  bool IsOutlineMovable( SwOutlineNodes::size_type nIdx ) const;
840  bool IsOutlineCopyable( SwOutlineNodes::size_type nIdx ) const;
841 
842  sal_uInt16 GetLineCount();
843 
845  bool GetCurFootnote( SwFormatFootnote* pToFillFootnote = nullptr );
846  bool SetCurFootnote( const SwFormatFootnote& rFillFootnote );
847  bool HasFootnotes( bool bEndNotes = false ) const;
848 
849  size_t GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes = false );
851 
852  SwSection const* InsertSection(
853  SwSectionData & rNewData, SfxItemSet const*const = nullptr );
854  bool IsInsRegionAvailable() const;
855  const SwSection* GetCurrSection() const;
856 
862  SwSection* GetAnySection( bool bOutOfTab = false, const Point* pPt = nullptr );
863 
864  size_t GetSectionFormatCount() const;
865  size_t GetSectionFormatPos(const SwSectionFormat&) const;
866  const SwSectionFormat& GetSectionFormat(size_t nFormat) const;
867  void DelSectionFormat( size_t nFormat);
868  void UpdateSection( size_t const nSect, SwSectionData &,
869  SfxItemSet const*const = nullptr);
870  bool IsAnySectionInDoc() const;
871 
872  OUString GetUniqueSectionName( const OUString* pChkStr = nullptr ) const;
873 
875  void SetSectionAttr(const SfxItemSet& rSet, SwSectionFormat* pSectFormat = nullptr);
876 
880  sal_uInt16 GetFullSelectedSectionCount() const;
881 
887  void DoSpecialInsert();
888  bool CanSpecialInsert() const;
889 
891  void SetNewDoc();
892 
893  sfx2::LinkManager& GetLinkManager();
894  inline const sfx2::LinkManager& GetLinkManager() const;
895 
899  bool IsMoveLeftMargin( bool bRight, bool bModulus = true ) const;
900  void MoveLeftMargin( bool bRight, bool bModulus = true );
901 
903  SvNumberFormatter* GetNumberFormatter();
905  { return const_cast<SwEditShell*>(this)->GetNumberFormatter(); }
906 
908  bool IsGlobalDoc() const;
909  void SetGlblDocSaveLinks( bool bFlag );
910  bool IsGlblDocSaveLinks() const;
911  void GetGlobalDocContent( SwGlblDocContents& rArr ) const;
912  void InsertGlobalDocContent( const SwGlblDocContent& rPos,
913  SwSectionData & rNew );
914  bool InsertGlobalDocContent( const SwGlblDocContent& rPos,
915  const SwTOXBase& rTOX );
916  bool InsertGlobalDocContent( const SwGlblDocContent& rPos );
917  void DeleteGlobalDocContent( const SwGlblDocContents& rArr,
918  size_t nPos );
919  bool MoveGlobalDocContent( const SwGlblDocContents& rArr ,
920  size_t nFromPos, size_t nToPos,
921  size_t nNewPos );
922  void GotoGlobalDocContent( const SwGlblDocContent& rPos );
923 
926  void SetRedlineFlags( RedlineFlags eMode );
927  bool IsRedlineOn() const;
928  SwRedlineTable::size_type GetRedlineCount() const;
929  const SwRangeRedline& GetRedline( SwRedlineTable::size_type nPos ) const;
930  bool AcceptRedline( SwRedlineTable::size_type nPos );
931  bool RejectRedline( SwRedlineTable::size_type nPos );
932  bool AcceptRedlinesInSelection();
933  bool RejectRedlinesInSelection();
934 
937  SwRedlineTable::size_type FindRedlineOfData( const SwRedlineData& ) const;
938 
940  bool SetRedlineComment( const OUString& rS );
941  const SwRangeRedline* GetCurrRedline() const;
942 
944  void UpdateRedlineAttr();
945 
947  long CompareDoc( const SwDoc& rDoc );
948 
950  long MergeDoc( const SwDoc& rDoc );
951 
953  const SwFootnoteInfo& GetFootnoteInfo() const;
954  void SetFootnoteInfo(const SwFootnoteInfo& rInfo);
955  const SwEndNoteInfo& GetEndNoteInfo() const;
956  void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
957 
958  const SwLineNumberInfo &GetLineNumberInfo() const;
959  void SetLineNumberInfo( const SwLineNumberInfo& rInfo);
960 
962  void SetLabelDoc( bool bFlag );
963  bool IsLabelDoc() const;
964 
966  void CreateExtTextInput(LanguageType eInputLanguage);
967  OUString DeleteExtTextInput( bool bInsText = true);
968  void SetExtTextInputData( const CommandExtTextInputData& );
969 
971  bool IsParagraphSignatureValidationEnabled() const { return m_bDoParagraphSignatureValidation; }
973  bool SetParagraphSignatureValidation(const bool bEnable)
974  {
975  const bool bOldFlag = m_bDoParagraphSignatureValidation;
976  m_bDoParagraphSignatureValidation = bEnable;
977  return bOldFlag;
978  }
979 
981  static SwAutoCompleteWord& GetAutoCompleteWords();
982 
985  sal_uInt16 GetScalingOfSelectedText() const;
986 
987  bool IsNbspRunNext() const { return m_bNbspRunNext; }
988 
990  SwEditShell( SwDoc&, vcl::Window*, const SwViewOption *pOpt );
991 
994  virtual ~SwEditShell() override;
995 
996 private:
997  SwEditShell(const SwEditShell &) = delete;
998  const SwEditShell &operator=(const SwEditShell &) = delete;
999 
1000  /* TODO: this flag may have to be invalidated / reset to false at various
1001  * places if it was true and the edit cursor position changes. It's somehow
1002  * overkill though because it can only be true if a NO-BREAK SPACE was
1003  * inserted by the last DoAutoCorrect() call (in French language), any
1004  * subsequent call will reset it anyway and just if the cursor is
1005  * positioned behind "x :" and the next character inserted is not a space
1006  * the existing nb-space will be removed. Bear this in mind if that problem
1007  * arises. */
1010 };
1011 
1013 { return const_cast<SwEditShell*>(this)->GetLinkManager(); }
1014 
1018 public:
1019  SwActContext(SwEditShell *pShell);
1020  ~SwActContext() COVERITY_NOEXCEPT_FALSE;
1021 };
1022 
1026 public:
1027  SwMvContext(SwEditShell *pShell);
1028  ~SwMvContext() COVERITY_NOEXCEPT_FALSE;
1029 };
1030 
1031 #endif
1032 
1033 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:233
TOXTypes
Definition: toxe.hxx:39
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2114
Marks a position in the document model.
Definition: pam.hxx:35
SwFieldUpdateFlags
Definition: fldupde.hxx:22
bool IsNbspRunNext() const
Definition: editsh.hxx:987
SwUndoId
Definition: swundo.hxx:29
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:598
virtual void CalcLayout()
Definition: viewsh.cxx:983
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:358
std::vector< SwNode * >::difference_type difference_type
virtual void Repeat(SfxRepeatTarget &) override
Definition: undobj.cxx:241
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:44
Base class of all fields.
Definition: fldbas.hxx:279
GraphicType
Definition: doc.hxx:185
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:118
const T & GetDefault(TypedWhichId< T > nWhich) const
Definition: editsh.hxx:273
SwGetINetAttr(const OUString &rText, const SwTextINetFormat &rAttr)
Definition: editsh.hxx:124
Dialog to specify the properties of drop-down form field.
Definition: accframe.hxx:34
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
Definition: editsh.hxx:973
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:356
virtual bool GetInfo(SfxPoolItem &) const override
Definition: calbck.cxx:206
SwDocPositions
Definition: cshtyp.hxx:103
sal_uInt16 sal_Unicode
bool m_bDoParagraphSignatureValidation
Prevent nested calls of ValidateParagraphSignatures.
Definition: editsh.hxx:1009
std::vector< SwGetINetAttr > SwGetINetAttrs
Definition: editsh.hxx:128
SwTOIKeyType
Definition: toxe.hxx:30
SwEditShell & m_rShell
Definition: editsh.hxx:1017
static SwTOXBase & GetTOX(SwDoc &rDoc, sal_uLong const nNodeIndex)
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:117
TransliterationFlags
Base class for various Writer styles.
Definition: format.hxx:43
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
Class for automated call of Start- and EndAction().
Definition: editsh.hxx:1016
SvtScriptType
Style of a layout element.
Definition: frmfmt.hxx:57
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
Definition: editsh.hxx:971
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
Definition: viewsh.cxx:650
SfxClassificationPolicyType
const SwTextINetFormat & rINetAttr
Definition: editsh.hxx:122
void FinitCore()
Definition: init.cxx:665
SetAttrMode
Definition: swtypes.hxx:143
vector_type::size_type size_type
Definition: docary.hxx:331
SplitTable_HeadlineOption
Definition: tblenum.hxx:53
SwFieldIds
Definition: fldbas.hxx:38
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
OUString const sText
Definition: editsh.hxx:121
SwEditShell & m_rShell
Definition: editsh.hxx:1025
const SvNumberFormatter * GetNumberFormatter() const
Definition: editsh.hxx:904
SwModify & operator=(const SwModify &)=delete
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
static SvxSwAutoFormatFlags * s_pAutoFormatFlags
Definition: editsh.hxx:142
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1024
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void InitCore()
Definition: init.cxx:449
For querying the INet-attributes for Navigator.
Definition: editsh.hxx:119
~SwActContext() COVERITY_NOEXCEPT_FALSE
Definition: edws.cxx:166
unsigned char sal_uInt8
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:131
virtual void Redo() override
Definition: undobj.cxx:218
ParaBreakType
Definition: editsh.hxx:113
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:612
bool m_bNbspRunNext
NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect() ...
Definition: editsh.hxx:1008
virtual void Undo() override
Definition: undobj.cxx:213
TableChgMode
Definition: tblenum.hxx:46
std::vector< SpellPortion > SpellPortions
std::vector< SwNode * >::size_type size_type
SwActContext(SwEditShell *pShell)
Definition: edws.cxx:160
Definition: view.hxx:146