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::sun::star::uno { template < class > class Sequence; }
94 namespace com::sun::star::linguistic2 { class XSpellAlternatives; }
95 namespace com::sun::star::linguistic2 { struct ProofreadingResult; }
96 
97 namespace svx{
98  struct SpellPortion;
99  typedef std::vector<SpellPortion> SpellPortions;
100  class ClassificationResult;
101 }
102 
103 namespace sfx2{
104  class LinkManager;
105 }
106 
107 namespace sw {
108  class UndoRedoContext;
109 }
110 
111 enum class ParaBreakType {
112  ToBlank = 0,
113  ToOnlyCR = 2
114 };
115 
118 {
119  OUString sText;
121 
122  SwGetINetAttr( const OUString& rText, const SwTextINetFormat& rAttr )
123  : sText( rText ), rINetAttr( rAttr )
124  {}
125 };
126 typedef std::vector<SwGetINetAttr> SwGetINetAttrs;
127 
128 // Types of forms of content.
129 #define CNT_TXT 0x0001
130 #define CNT_GRF 0x0002
131 #define CNT_OLE 0x0010
132 
133 // Test USHORT for a defined form of content.
134 #define CNT_HasText(USH) ((USH)&CNT_TXT)
135 #define CNT_HasGrf(USH) ((USH)&CNT_GRF)
136 #define CNT_HasOLE(USH) ((USH)&CNT_OLE)
137 
139 {
141 
143  friend class SwAutoFormat;
144  friend void InitCore();
145  friend void FinitCore();
147  friend class SwUndo;
148 
151  SAL_DLLPRIVATE SwGrfNode *GetGrfNode_() const ;
152 
153  SAL_DLLPRIVATE void DeleteSel( SwPaM& rPam, bool* pUndo = nullptr );
154 
155  SAL_DLLPRIVATE void SetSectionAttr_( SwSectionFormat& rSectFormat, const SfxItemSet& rSet );
156 
158  using SwModify::GetInfo;
159 
160 public:
162  void Insert( sal_Unicode, bool bOnlyCurrCursor = false );
163  void Insert2( const OUString &, const bool bForceExpandHints = false );
164  void Overwrite( const OUString & );
165 
171  bool Replace( const OUString& rNewStr, bool bRegExpRplc );
172 
175  bool Delete();
176 
178  bool DelFullPara();
179 
181  void TransliterateText( TransliterationFlags nType );
182 
184  void CountWords( SwDocStat& rStat ) const;
185 
187  bool ConvertFieldsToText();
188 
190  void SetNumberingRestart();
191 
193  sal_uInt16 GetLinkUpdMode() const;
194  void SetLinkUpdMode( sal_uInt16 nMode );
195 
197  bool Copy( SwEditShell* pDestShell );
198 
203  bool CopySelToDoc( SwDoc* pInsDoc );
204 
205  void SplitNode( bool bAutoFormat = false, bool bCheckTableStart = true );
206  bool AppendTextNode();
207  void AutoFormatBySplitNode();
208 
211  void DelINetAttrWithText();
212 
215  bool DontExpandFormat();
216 
226  bool GetPaMAttr( SwPaM* pPaM, SfxItemSet& ,
227  const bool bMergeIndentValuesOfNumRule = false ) const;
228  bool GetCurAttr( SfxItemSet& ,
229  const bool bMergeIndentValuesOfNumRule = false ) const;
230  void SetAttrItem( const SfxPoolItem&, SetAttrMode nFlags = SetAttrMode::DEFAULT,
231  const bool bParagraphSetting = false );
232  void SetAttrSet( const SfxItemSet&, SetAttrMode nFlags = SetAttrMode::DEFAULT,
233  SwPaM* pCursor = nullptr, const bool bParagraphSetting = false );
234 
239  std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
240 
250  void GetCurParAttr( SfxItemSet& rSet ) const;
264  bool GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const;
265 
267  void SetDefault( const SfxPoolItem& );
268 
270  const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint ) const;
271  template<class T> const T& GetDefault( TypedWhichId<T> nWhich ) const
272  {
273  return static_cast<const T&>(GetDefault(sal_uInt16(nWhich)));
274  }
275 
276  void ResetAttr( const std::set<sal_uInt16> &attrs = std::set<sal_uInt16>(), SwPaM* pCursor = nullptr );
277  void GCAttr();
278 
280  SvtScriptType GetScriptType() const;
281 
283  LanguageType GetCurLang() const;
284 
286  size_t GetTableFrameFormatCount( bool bUsed = false ) const;
287  SwFrameFormat& GetTableFrameFormat(size_t nFormat, bool bUsed = false ) const;
288  OUString GetUniqueTableName() const;
289 
291  sal_uInt16 GetCharFormatCount() const;
292  SwCharFormat& GetCharFormat(sal_uInt16 nFormat) const;
293  SwCharFormat* GetCurCharFormat() const;
294  void FillByEx(SwCharFormat*);
295  SwCharFormat* MakeCharFormat( const OUString& rName );
296  SwCharFormat* FindCharFormatByName( const OUString& rName ) const;
297 
298  /* FormatCollections (new) - Explaining the general naming pattern:
299  * GetXXXCount() returns the count of xxx in the document.
300  * GetXXX(i) returns i-th xxx (ERR_RAISE if beyond range!).
301  * DelXXX(i) deletes i-th xxx (ERR_RAISE if beyond range!).
302  * GetCurXXX() returns xxx that is valid at cursor or in ranges.
303  * returns 0, if not unanimous.
304  * SetXXX() sets xxx at cursor or in ranges.
305  * MakeXXX() makes a xxx, derived from pDerivedFrom.
306  */
307 
308  // TXT
309  SwTextFormatColl& GetDfltTextFormatColl() const;
310  sal_uInt16 GetTextFormatCollCount() const;
311  SwTextFormatColl& GetTextFormatColl( sal_uInt16 nTextFormatColl) const;
331  SwTextFormatColl* GetPaMTextFormatColl( SwPaM* pPaM ) const;
332 
333  // #i62675#
335  void SetTextFormatColl(SwTextFormatColl*, const bool bResetListAttrs = false);
336  SwTextFormatColl *MakeTextFormatColl(const OUString &rFormatCollName,
337  SwTextFormatColl *pDerivedFrom = nullptr);
338  void FillByEx(SwTextFormatColl*);
339  SwTextFormatColl* FindTextFormatCollByName( const OUString& rName ) const;
340 
342  SwTextFormatColl* GetTextCollFromPool( sal_uInt16 nId );
343 
345  SwFormat* GetFormatFromPool( sal_uInt16 nId );
346 
348  SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
349 
351  bool IsUsed( const SwModify& ) const;
352 
355  { return static_cast<SwFrameFormat*>(SwEditShell::GetFormatFromPool( nId )); }
357  { return static_cast<SwCharFormat*>(SwEditShell::GetFormatFromPool( nId )); }
358 
359  void SetClassification(const OUString& rName, SfxClassificationPolicyType eType);
360  void ApplyAdvancedClassification(std::vector<svx::ClassificationResult> const & rResult);
361  std::vector<svx::ClassificationResult> CollectAdvancedClassification();
362 
363  SfxWatermarkItem GetWatermark() const;
364  void SetWatermark(const SfxWatermarkItem& rText);
365 
367  void SignParagraph();
368 
370  void ValidateParagraphSignatures(SwTextNode* pNode, bool updateDontRemove);
371 
373  void ValidateCurrentParagraphSignatures(bool updateDontRemove);
374 
376  void ValidateAllParagraphSignatures(bool updateDontRemove);
377 
382  void RestoreMetadataFieldsAndValidateParagraphSignatures();
383 
386  void ClassifyDocPerHighestParagraphClass();
387 
389  void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
390  std::vector<svx::ClassificationResult> CollectParagraphClassification();
391 
394  bool IsCursorInParagraphMetadataField() const;
395 
399  bool RemoveParagraphMetadataFieldAtCursor();
400 
401  void Insert2(SwField const &, const bool bForceExpandHints);
402 
403  void UpdateOneField(SwField &);
404 
405  size_t GetFieldTypeCount(SwFieldIds nResId = SwFieldIds::Unknown) const;
406  SwFieldType* GetFieldType(size_t nField, SwFieldIds nResId = SwFieldIds::Unknown) const;
407  SwFieldType* GetFieldType(SwFieldIds nResId, const OUString& rName) const;
408 
409  void RemoveFieldType(size_t nField);
410  void RemoveFieldType(SwFieldIds nResId, const OUString& rName);
411 
412  void FieldToText( SwFieldType const * pType );
413 
414  void ChangeAuthorityData(const SwAuthEntry* pNewData);
415 
417  SwDBData const & GetDBData() const;
418  const SwDBData& GetDBDesc() const;
419  void ChgDBData(const SwDBData& SwDBData);
420  void ChangeDBFields( const std::vector<OUString>& rOldNames,
421  const OUString& rNewName );
422  void GetAllUsedDB( std::vector<OUString>& rDBNameList,
423  std::vector<OUString> const * pAllDBNames );
424 
425  bool IsAnyDatabaseFieldInDoc()const;
426 
428  bool IsFieldDataSourceAvailable(OUString& rUsedDataSource) const;
429  void UpdateExpFields(bool bCloseDB = false);
430  void LockExpFields();
431  void UnlockExpFields();
432  bool IsExpFieldsLocked() const;
433 
434  SwFieldUpdateFlags GetFieldUpdateFlags() const;
435  void SetFieldUpdateFlags( SwFieldUpdateFlags eFlags );
436 
438  SwDBManager* GetDBManager() const;
439 
440  SwFieldType* InsertFieldType(const SwFieldType &);
441 
443  bool IsModified() const;
444  void SetModified();
445  void ResetModified();
446  void SetUndoNoResetModified();
447 
449  void UpdateDocStat();
450  const SwDocStat &GetUpdatedDocStat();
451 
452  void Insert(const SwTOXMark& rMark);
453 
454  void DeleteTOXMark(SwTOXMark const * pMark);
455 
457  void GetCurTOXMarks(SwTOXMarks& rMarks) const ;
458 
460  void InsertTableOf(const SwTOXBase& rTOX,
461  const SfxItemSet* pSet = nullptr);
462  void UpdateTableOf(const SwTOXBase& rTOX,
463  const SfxItemSet* pSet = nullptr);
464  const SwTOXBase* GetCurTOX() const;
465  const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false );
466  void SetDefaultTOXBase(const SwTOXBase& rBase);
467 
468  static bool IsTOXBaseReadonly(const SwTOXBase& rTOXBase);
469  void SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly);
470 
471  sal_uInt16 GetTOXCount() const;
472  const SwTOXBase* GetTOX( sal_uInt16 nPos ) const;
473  bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes );
474 
476  void SetUpdateTOX( bool bFlag );
477  bool IsUpdateTOX() const;
478 
480  sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const;
481  const SwTOXType* GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const;
482  void InsertTOXType(const SwTOXType& rTyp);
483 
485  OUString const & GetTOIAutoMarkURL() const;
486  void SetTOIAutoMarkURL(const OUString& rSet);
487  void ApplyAutoMark();
488 
490  void GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) const;
491 
492  void SetOutlineNumRule(const SwNumRule&);
493  const SwNumRule* GetOutlineNumRule() const;
494 
495  bool OutlineUpDown( short nOffset = 1 );
496 
497  bool MoveOutlinePara( SwOutlineNodes::difference_type nOffset );
498 
499  bool IsProtectedOutlinePara() const;
500 
501  const SwNumRule* GetNumRuleAtCurrCursorPos() const;
502 
505  const SwNumRule* GetNumRuleAtCurrentSelection() const;
506 
515  void SetCurNumRule( const SwNumRule&,
516  const bool bCreateNewList /*= false*/,
517  const OUString& sContinuedListId = OUString(),
518  const bool bResetIndentAttrs = false );
519 
521  void NoNum();
522 
524  void DelNumRules();
525 
526  void NumUpDown( bool bDown = true );
527 
528  bool MoveParagraph( long nOffset = 1);
529  bool MoveNumParas( bool bUpperLower, bool bUpperLeft );
530 
532  bool NumOrNoNum(bool bDelete = false, bool bChkStart = true);
533 
534  // #i23726#
535  // #i90078#
537  // Adjust method name and parameter name
538  void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
539  // Adjust method name
540  void SetIndent(short nIndent, const SwPosition & rPos);
541  bool IsFirstOfNumRuleAtCursorPos() const;
542 
543  bool IsNoNum( bool bChkStart = true ) const;
544 
548  sal_uInt8 GetNumLevel() const;
549 
551  void GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower );
552 
554  int GetCurrentParaOutlineLevel( ) const;
555 
556  // i29560
557  bool HasNumber() const;
558  bool HasBullet() const;
559 
560  bool SelectionHasNumber() const;
561  bool SelectionHasBullet() const;
562 
563  OUString GetUniqueNumRuleName() const;
564  void ChgNumRuleFormats( const SwNumRule& rRule );
565 
567  void SetNumRuleStart( bool bFlag, SwPaM* pCursor );
568  bool IsNumRuleStart( SwPaM* pPaM = nullptr ) const;
569  void SetNodeNumStart( sal_uInt16 nStt );
570 
571  sal_uInt16 GetNodeNumStart( SwPaM* pPaM ) const;
572 
573  void ReplaceNumRule( const OUString& rOldRule, const OUString& rNewRule );
574 
578  const SwNumRule * SearchNumRule(const bool bNum,
579  OUString& sListId );
580 
584  void DoUndo( bool bOn = true );
585  bool DoesUndo() const;
586  void DoGroupUndo( bool bUn );
587  bool DoesGroupUndo() const;
588  void DelAllUndoObj();
589 
591  SwUndoId StartUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
592 
594  SwUndoId EndUndo( SwUndoId eUndoId = SwUndoId::EMPTY, const SwRewriter * pRewriter = nullptr );
595 
596  bool GetLastUndoInfo(OUString *const o_pStr,
597  SwUndoId *const o_pId,
598  const SwView* pView = nullptr) const;
599  bool GetFirstRedoInfo(OUString *const o_pStr,
600  SwUndoId *const o_pId,
601  const SwView* pView = nullptr) const;
602  SwUndoId GetRepeatInfo(OUString *const o_pStr) const;
603 
605  bool CursorsLocked() const;
608  void HandleUndoRedoContext(::sw::UndoRedoContext & rContext);
609 
610  void Undo(sal_uInt16 const nCount = 1);
611  void Redo(sal_uInt16 const nCount = 1);
612  void Repeat(sal_uInt16 const nCount);
613 
615  void StartAllAction();
616  void EndAllAction();
617 
619  virtual void CalcLayout() override;
620 
622  sal_uInt16 GetCntType() const;
623 
625  bool HasOtherCnt() const;
626 
628  virtual void ApplyViewOptions( const SwViewOption &rOpt ) override;
629 
631  void GetSelectedText( OUString &rBuf,
632  ParaBreakType nHndlParaBreak = ParaBreakType::ToBlank );
633 
637  const Graphic* GetGraphic( bool bWait = true ) const;
638  const GraphicObject* GetGraphicObj() const;
639  const GraphicAttr* GetGraphicAttr( GraphicAttr& rGA ) const;
640 
641  bool IsLinkedGrfSwapOut() const;
642  GraphicType GetGraphicType() const;
643 
644  const tools::PolyPolygon *GetGraphicPolygon() const;
645  void SetGraphicPolygon( const tools::PolyPolygon *pPoly );
646 
649  void ClearAutomaticContour();
650 
652  bool GetGrfSize(Size&) const;
653 
657  void GetGrfNms( OUString* pGrfName, OUString* pFltName,
658  const SwFlyFrameFormat* = nullptr ) const;
659 
661  void ReRead( const OUString& rGrfName, const OUString& rFltName,
662  const Graphic* pGraphic = nullptr );
663 
665  void *GetIMapInventor() const;
666 
667  // #i73788#
669  Graphic GetIMapGraphic() const;
670  const SwFlyFrameFormat* FindFlyByName( const OUString& rName ) const;
671 
675  svt::EmbeddedObjectRef& GetOLEObject() const;
676 
678  bool HasOLEObj( const OUString &rName ) const;
679 
681  void SetChartName( const OUString &rName );
682 
684  void UpdateCharts( const OUString &rName );
685 
686  OUString GetCurWord() const;
687 
690  void InsertGlossary( SwTextBlocks& rGlossary, const OUString& );
691 
694  sal_uInt16 MakeGlossary( SwTextBlocks& rToFill, const OUString& rName,
695  const OUString& rShortName, bool bSaveRelFile,
696  const OUString* pOnlyText );
697 
699  sal_uInt16 SaveGlossaryDoc( SwTextBlocks& rGlossary, const OUString& rName,
700  const OUString& rShortName,
701  bool bSaveRelFile,
702  bool bOnlyText );
703 
704  // Linguistics...
706  void HyphStart( SwDocPositions eStart, SwDocPositions eEnd );
707 
709  void HyphEnd();
710  css::uno::Reference< css::uno::XInterface>
711  HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
712 
713  void HyphIgnore();
714 
716  static void InsertSoftHyph( const sal_Int32 nHyphPos );
717 
718  const SwTable& InsertTable( const SwInsertTableOptions& rInsTableOpts,
719  sal_uInt16 nRows, sal_uInt16 nCols,
720  const SwTableAutoFormat* pTAFormat = nullptr );
721 
722  void InsertDDETable( const SwInsertTableOptions& rInsTableOpts,
723  SwDDEFieldType* pDDEType,
724  sal_uInt16 nRows, sal_uInt16 nCols );
725 
726  void UpdateTable();
727  void SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName );
728 
729  SwFrameFormat *GetTableFormat();
730  bool TextToTable( const SwInsertTableOptions& rInsTableOpts,
731  sal_Unicode cCh,
732  const SwTableAutoFormat* pTAFormat = nullptr );
733  bool TableToText( sal_Unicode cCh );
734  bool IsTextToTableAvailable() const;
735 
736  bool GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const;
737  void SetTableBoxFormulaAttrs( const SfxItemSet& rSet );
738 
739  bool IsTableBoxTextFormat() const;
740  OUString GetTableBoxText() const;
741 
742  TableChgMode GetTableChgMode() const;
743  void SetTableChgMode( TableChgMode eMode );
744 
746  void SplitTable( SplitTable_HeadlineOption eMode );
747 
752  bool CanMergeTable( bool bWithPrev = true, bool* pChkNxtPrv = nullptr ) const;
753  bool MergeTable( bool bWithPrev );
754 
756  void AppendUndoForInsertFromDB( bool bIsTable );
757 
759 
761  void SpellStart( SwDocPositions eStart, SwDocPositions eEnd,
762  SwDocPositions eCurr, SwConversionArgs *pConvArgs = nullptr );
763 
765  void SpellEnd( SwConversionArgs const *pConvArgs = nullptr, bool bRestoreSelection = true );
766  css::uno::Any SpellContinue(
767  sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
768  SwConversionArgs const *pConvArgs );
769 
772  bool SpellSentence(svx::SpellPortions& rToFill, bool bIsGrammarCheck );
773 
775  static void PutSpellingToSentenceStart();
776 
778  static void MoveContinuationPosToEndOfCheckedSentence();
779 
781  void ApplyChangedSentence(const svx::SpellPortions& rNewPortions, bool bRecheck);
782 
784  static bool HasLastSentenceGotGrammarChecked();
785 
787  static bool HasConvIter();
788 
790  static bool HasHyphIter();
791 
792  void HandleCorrectionError(const OUString& aText, SwPosition aPos, sal_Int32 nBegin,
793  sal_Int32 nLen, const Point* pPt,
794  SwRect& rSelectRect);
795  css::uno::Reference< css::linguistic2::XSpellAlternatives >
796  GetCorrection( const Point* pPt, SwRect& rSelectRect );
797 
798  bool GetGrammarCorrection( css::linguistic2::ProofreadingResult /*out*/ &rResult,
799  sal_Int32 /*out*/ &rErrorPosInText,
800  sal_Int32 /*out*/ &rErrorIndexInResult,
801  css::uno::Sequence< OUString > /*out*/ &rSuggestions,
802  const Point* pPt, SwRect& rSelectRect );
803 
804  static void IgnoreGrammarErrorAt( SwPaM& rErrorPosition );
805  void SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd );
806 
808  const SwFormatRefMark* GetRefMark( const OUString& rName ) const;
809 
812  sal_uInt16 GetRefMarks( std::vector<OUString>* = nullptr ) const;
813 
815  void AutoCorrect( SvxAutoCorrect& rACorr, bool bInsertMode,
816  sal_Unicode cChar );
817  OUString GetPrevAutoCorrWord(SvxAutoCorrect& rACorr);
818 
819  // We consider no more than 9 characters before the cursor, and they must not start in the
820  // middle of a word (leading spaces are OK)
821  std::vector<OUString> GetChunkForAutoText();
822 
824  void AutoFormat( const SvxSwAutoFormatFlags* pAFlags );
825 
826  static SvxSwAutoFormatFlags* GetAutoFormatFlags();
827  static void SetAutoFormatFlags(SvxSwAutoFormatFlags const *);
828 
830  OUString Calculate();
831 
832  bool InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr,
833  bool bKeepSelection = false );
834  void GetINetAttrs( SwGetINetAttrs& rArr );
835 
836  OUString GetDropText( const sal_Int32 nChars ) const;
837  void ReplaceDropText( const OUString &rStr, SwPaM* pPaM = nullptr );
838 
841  bool IsOutlineMovable( SwOutlineNodes::size_type nIdx ) const;
842  bool IsOutlineCopyable( SwOutlineNodes::size_type nIdx ) const;
843 
844  sal_uInt16 GetLineCount();
845 
847  bool GetCurFootnote( SwFormatFootnote* pToFillFootnote = nullptr );
848  bool SetCurFootnote( const SwFormatFootnote& rFillFootnote );
849  bool HasFootnotes( bool bEndNotes = false ) const;
850 
851  size_t GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes = false );
853 
854  SwSection const* InsertSection(
855  SwSectionData & rNewData, SfxItemSet const*const = nullptr );
856  bool IsInsRegionAvailable() const;
857  const SwSection* GetCurrSection() const;
858 
864  SwSection* GetAnySection( bool bOutOfTab = false, const Point* pPt = nullptr );
865 
866  size_t GetSectionFormatCount() const;
867  size_t GetSectionFormatPos(const SwSectionFormat&) const;
868  const SwSectionFormat& GetSectionFormat(size_t nFormat) const;
869  void DelSectionFormat( size_t nFormat);
870  void UpdateSection( size_t const nSect, SwSectionData &,
871  SfxItemSet const*const = nullptr);
872  bool IsAnySectionInDoc() const;
873 
874  OUString GetUniqueSectionName( const OUString* pChkStr = nullptr ) const;
875 
877  void SetSectionAttr(const SfxItemSet& rSet, SwSectionFormat* pSectFormat = nullptr);
878 
882  sal_uInt16 GetFullSelectedSectionCount() const;
883 
889  void DoSpecialInsert();
890  bool CanSpecialInsert() const;
891 
893  void SetNewDoc();
894 
895  sfx2::LinkManager& GetLinkManager();
896  inline const sfx2::LinkManager& GetLinkManager() const;
897 
901  bool IsMoveLeftMargin( bool bRight, bool bModulus = true ) const;
902  void MoveLeftMargin( bool bRight, bool bModulus = true );
903 
905  SvNumberFormatter* GetNumberFormatter();
907  { return const_cast<SwEditShell*>(this)->GetNumberFormatter(); }
908 
910  bool IsGlobalDoc() const;
911  void SetGlblDocSaveLinks( bool bFlag );
912  bool IsGlblDocSaveLinks() const;
913  void GetGlobalDocContent( SwGlblDocContents& rArr ) const;
914  void InsertGlobalDocContent( const SwGlblDocContent& rPos,
915  SwSectionData & rNew );
916  bool InsertGlobalDocContent( const SwGlblDocContent& rPos,
917  const SwTOXBase& rTOX );
918  bool InsertGlobalDocContent( const SwGlblDocContent& rPos );
919  void DeleteGlobalDocContent( const SwGlblDocContents& rArr,
920  size_t nPos );
921  bool MoveGlobalDocContent( const SwGlblDocContents& rArr ,
922  size_t nFromPos, size_t nToPos,
923  size_t nNewPos );
924  void GotoGlobalDocContent( const SwGlblDocContent& rPos );
925 
928  void SetRedlineFlags( RedlineFlags eMode );
929  bool IsRedlineOn() const;
930  SwRedlineTable::size_type GetRedlineCount() const;
931  const SwRangeRedline& GetRedline( SwRedlineTable::size_type nPos ) const;
932  bool AcceptRedline( SwRedlineTable::size_type nPos );
933  bool RejectRedline( SwRedlineTable::size_type nPos );
934  bool AcceptRedlinesInSelection();
935  bool RejectRedlinesInSelection();
936 
939  SwRedlineTable::size_type FindRedlineOfData( const SwRedlineData& ) const;
940 
942  bool SetRedlineComment( const OUString& rS );
943  const SwRangeRedline* GetCurrRedline() const;
944 
946  void UpdateRedlineAttr();
947 
949  long CompareDoc( const SwDoc& rDoc );
950 
952  long MergeDoc( const SwDoc& rDoc );
953 
955  const SwFootnoteInfo& GetFootnoteInfo() const;
956  void SetFootnoteInfo(const SwFootnoteInfo& rInfo);
957  const SwEndNoteInfo& GetEndNoteInfo() const;
958  void SetEndNoteInfo(const SwEndNoteInfo& rInfo);
959 
960  const SwLineNumberInfo &GetLineNumberInfo() const;
961  void SetLineNumberInfo( const SwLineNumberInfo& rInfo);
962 
964  void SetLabelDoc( bool bFlag );
965  bool IsLabelDoc() const;
966 
968  void CreateExtTextInput(LanguageType eInputLanguage);
969  OUString DeleteExtTextInput( bool bInsText = true);
970  void SetExtTextInputData( const CommandExtTextInputData& );
971 
973  bool IsParagraphSignatureValidationEnabled() const { return m_bDoParagraphSignatureValidation; }
975  bool SetParagraphSignatureValidation(const bool bEnable)
976  {
977  const bool bOldFlag = m_bDoParagraphSignatureValidation;
978  m_bDoParagraphSignatureValidation = bEnable;
979  return bOldFlag;
980  }
981 
983  static SwAutoCompleteWord& GetAutoCompleteWords();
984 
987  sal_uInt16 GetScalingOfSelectedText() const;
988 
989  bool IsNbspRunNext() const { return m_bNbspRunNext; }
990 
992  SwEditShell( SwDoc&, vcl::Window*, const SwViewOption *pOpt );
993 
996  virtual ~SwEditShell() override;
997 
998 private:
999  SwEditShell(const SwEditShell &) = delete;
1000  const SwEditShell &operator=(const SwEditShell &) = delete;
1001 
1002  /* TODO: this flag may have to be invalidated / reset to false at various
1003  * places if it was true and the edit cursor position changes. It's somehow
1004  * overkill though because it can only be true if a NO-BREAK SPACE was
1005  * inserted by the last DoAutoCorrect() call (in French language), any
1006  * subsequent call will reset it anyway and just if the cursor is
1007  * positioned behind "x :" and the next character inserted is not a space
1008  * the existing nb-space will be removed. Bear this in mind if that problem
1009  * arises. */
1012 };
1013 
1015 { return const_cast<SwEditShell*>(this)->GetLinkManager(); }
1016 
1020 public:
1021  SwActContext(SwEditShell *pShell);
1022  ~SwActContext() COVERITY_NOEXCEPT_FALSE;
1023 };
1024 
1028 public:
1029  SwMvContext(SwEditShell *pShell);
1030  ~SwMvContext() COVERITY_NOEXCEPT_FALSE;
1031 };
1032 
1033 #endif
1034 
1035 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:240
TOXTypes
Definition: toxe.hxx:39
OUString sText
Definition: editsh.hxx:119
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Definition: viewsh.cxx:2111
Marks a position in the document model.
Definition: pam.hxx:35
SwFieldUpdateFlags
Definition: fldupde.hxx:22
bool IsNbspRunNext() const
Definition: editsh.hxx:989
SwUndoId
Definition: swundo.hxx:29
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:592
virtual void CalcLayout()
Definition: viewsh.cxx:973
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:356
std::vector< SwNode * >::difference_type difference_type
virtual void Repeat(SfxRepeatTarget &) override
Definition: undobj.cxx:247
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:45
Base class of all fields.
Definition: fldbas.hxx:293
GraphicType
Definition: doc.hxx:184
void SetRedlineFlags(RedlineFlags eMode)
Definition: undobj.hxx:120
const T & GetDefault(TypedWhichId< T > nWhich) const
Definition: editsh.hxx:271
SwGetINetAttr(const OUString &rText, const SwTextINetFormat &rAttr)
Definition: editsh.hxx:122
Dialog to specify the properties of date form field.
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
Definition: editsh.hxx:975
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:354
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:1011
std::vector< SwGetINetAttr > SwGetINetAttrs
Definition: editsh.hxx:126
SwTOIKeyType
Definition: toxe.hxx:30
SwEditShell & m_rShell
Definition: editsh.hxx:1019
static SwTOXBase & GetTOX(SwDoc &rDoc, sal_uLong const nNodeIndex)
RedlineFlags GetRedlineFlags() const
Definition: undobj.hxx:119
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:1018
static void EndUndo(SwWrtShell &rSh)
Definition: basesh.cxx:2690
SvtScriptType
Style of a layout element.
Definition: frmfmt.hxx:57
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
Definition: editsh.hxx:973
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
Definition: viewsh.cxx:640
SfxClassificationPolicyType
const SwTextINetFormat & rINetAttr
Definition: editsh.hxx:120
void FinitCore()
Definition: init.cxx:671
SetAttrMode
Definition: swtypes.hxx:139
vector_type::size_type size_type
Definition: docary.hxx:228
SplitTable_HeadlineOption
Definition: tblenum.hxx:53
SwFieldIds
Definition: fldbas.hxx:44
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
SwEditShell & m_rShell
Definition: editsh.hxx:1027
const SvNumberFormatter * GetNumberFormatter() const
Definition: editsh.hxx:906
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:140
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1026
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
void InitCore()
Definition: init.cxx:454
For querying the INet-attributes for Navigator.
Definition: editsh.hxx:117
~SwActContext() COVERITY_NOEXCEPT_FALSE
Definition: edws.cxx:167
unsigned char sal_uInt8
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
Definition: edfmt.cxx:129
virtual void Redo() override
Definition: undobj.cxx:224
ParaBreakType
Definition: editsh.hxx:111
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
Definition: unoobj.cxx:607
bool m_bNbspRunNext
NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect() ...
Definition: editsh.hxx:1010
virtual void Undo() override
Definition: undobj.cxx:219
TableChgMode
Definition: tblenum.hxx:46
std::vector< SpellPortion > SpellPortions
std::vector< SwNode * >::size_type size_type
SwActContext(SwEditShell *pShell)
Definition: edws.cxx:161
Definition: view.hxx:144