19#ifndef INCLUDED_SW_INC_EDITSH_HXX
20#define INCLUDED_SW_INC_EDITSH_HXX
37namespace tools {
class PolyPolygon; }
110 class UndoRedoContext;
131#define CNT_TXT 0x0001
132#define CNT_GRF 0x0002
133#define CNT_OLE 0x0010
136#define CNT_HasText(USH) ((USH)&CNT_TXT)
137#define CNT_HasGrf(USH) ((USH)&CNT_GRF)
138#define CNT_HasOLE(USH) ((USH)&CNT_OLE)
153 SAL_DLLPRIVATE
SwGrfNode *GetGrfNode_()
const ;
155 SAL_DLLPRIVATE
void DeleteSel(
SwPaM& rPam,
bool isArtificialSelection,
bool* pUndo =
nullptr);
160 using sw::BroadcastingModify::GetInfo;
165 void Insert2(
const OUString &,
const bool bForceExpandHints =
false );
166 void Overwrite(
const OUString & );
173 bool Replace(
const OUString& rNewStr,
bool bRegExpRplc );
177 bool Delete(
bool isArtificialSelection =
false);
186 void CountWords(
SwDocStat& rStat )
const;
189 bool ConvertFieldsToText();
192 void SetNumberingRestart();
195 sal_uInt16 GetLinkUpdMode()
const;
196 void SetLinkUpdMode( sal_uInt16 nMode );
205 bool CopySelToDoc(
SwDoc& rInsDoc );
207 void SplitNode(
bool bAutoFormat =
false,
bool bCheckTableStart =
true );
208 bool AppendTextNode();
209 void AutoFormatBySplitNode();
213 void DelINetAttrWithText();
217 bool DontExpandFormat();
229 const bool bMergeIndentValuesOfNumRule =
false )
const;
231 const bool bMergeIndentValuesOfNumRule =
false )
const;
233 const bool bParagraphSetting =
false );
235 SwPaM* pCursor =
nullptr,
const bool bParagraphSetting =
false );
241 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
269 const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint )
const;
272 return static_cast<const T&
>(GetDefault(sal_uInt16(nWhich)));
285 size_t GetTableFrameFormatCount(
bool bUsed =
false )
const;
286 SwFrameFormat& GetTableFrameFormat(
size_t nFormat,
bool bUsed =
false )
const;
287 OUString GetUniqueTableName()
const;
290 sal_uInt16 GetCharFormatCount()
const;
295 SwCharFormat* FindCharFormatByName(
const OUString& rName )
const;
309 sal_uInt16 GetTextFormatCollCount()
const;
344 SwFormat* GetFormatFromPool( sal_uInt16 nId );
347 SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
350 bool IsUsed(
const sw::BroadcastingModify& )
const;
359 void ApplyAdvancedClassification(std::vector<svx::ClassificationResult>
const & rResult);
360 std::vector<svx::ClassificationResult> CollectAdvancedClassification();
366 void SignParagraph();
369 void ValidateParagraphSignatures(
SwTextNode* pNode,
bool updateDontRemove);
372 void ValidateCurrentParagraphSignatures(
bool updateDontRemove);
375 void ValidateAllParagraphSignatures(
bool updateDontRemove);
381 void RestoreMetadataFieldsAndValidateParagraphSignatures();
385 void ClassifyDocPerHighestParagraphClass();
388 void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
389 std::vector<svx::ClassificationResult> CollectParagraphClassification();
393 bool IsCursorInParagraphMetadataField()
const;
398 bool RemoveParagraphMetadataFieldAtCursor();
402 void UpdateOneField(
SwField &);
408 void RemoveFieldType(
size_t nField);
409 void RemoveFieldType(
SwFieldIds nResId,
const OUString& rName);
413 void ChangeAuthorityData(
const SwAuthEntry* pNewData);
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 );
423 bool IsAnyDatabaseFieldInDoc()
const;
426 bool IsFieldDataSourceAvailable(OUString& rUsedDataSource)
const;
427 void UpdateExpFields(
bool bCloseDB =
false);
428 void LockExpFields();
429 void UnlockExpFields();
430 bool IsExpFieldsLocked()
const;
441 bool IsModified()
const;
443 void ResetModified();
444 void SetUndoNoResetModified();
447 void UpdateDocStat();
452 void DeleteTOXMark(
SwTOXMark const * pMark);
455 void GetCurTOXMarks(
SwTOXMarks& rMarks)
const ;
458 void InsertTableOf(
const SwTOXBase& rTOX,
460 void UpdateTableOf(
const SwTOXBase& rTOX,
464 void SetDefaultTOXBase(
const SwTOXBase& rBase);
466 static bool IsTOXBaseReadonly(
const SwTOXBase& rTOXBase);
467 void SetTOXBaseReadonly(
const SwTOXBase& rTOXBase,
bool bReadonly);
469 sal_uInt16 GetTOXCount()
const;
471 bool DeleteTOX(
const SwTOXBase& rTOXBase,
bool bDelNodes );
474 void SetUpdateTOX(
bool bFlag );
475 bool IsUpdateTOX()
const;
478 sal_uInt16 GetTOXTypeCount(
TOXTypes eTyp)
const;
480 void InsertTOXType(
const SwTOXType& rTyp);
483 OUString
const & GetTOIAutoMarkURL()
const;
484 void SetTOIAutoMarkURL(
const OUString& rSet);
485 void ApplyAutoMark();
488 void GetTOIKeys(
SwTOIKeyType eTyp, std::vector<OUString>& rArr )
const;
490 void SetOutlineNumRule(
const SwNumRule&);
491 const SwNumRule* GetOutlineNumRule()
const;
493 bool OutlineUpDown(
short nOffset = 1 );
497 bool IsProtectedOutlinePara()
const;
499 const SwNumRule* GetNumRuleAtCurrCursorPos()
const;
503 const SwNumRule* GetNumRuleAtCurrentSelection()
const;
514 const bool bCreateNewList ,
515 const OUString& sContinuedListId = OUString(),
516 const bool bResetIndentAttrs =
false );
524 void NumUpDown(
bool bDown =
true );
527 bool MoveNumParas(
bool bUpperLower,
bool bUpperLeft );
530 bool NumOrNoNum(
bool bDelete =
false,
bool bChkStart =
true);
536 void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
538 void SetIndent(
short nIndent,
const SwPosition & rPos);
539 bool IsFirstOfNumRuleAtCursorPos()
const;
541 bool IsNoNum(
bool bChkStart =
true )
const;
551 int GetCurrentParaOutlineLevel( )
const;
554 bool HasNumber()
const;
555 bool HasBullet()
const;
557 bool SelectionHasNumber()
const;
558 bool SelectionHasBullet()
const;
560 OUString GetUniqueNumRuleName()
const;
561 void ChgNumRuleFormats(
const SwNumRule& rRule );
564 void SetNumRuleStart(
bool bFlag,
SwPaM* pCursor );
565 bool IsNumRuleStart(
SwPaM* pPaM =
nullptr )
const;
566 void SetNodeNumStart( sal_uInt16 nStt );
568 sal_uInt16 GetNodeNumStart(
SwPaM* pPaM )
const;
570 void ReplaceNumRule(
const OUString& rOldRule,
const OUString& rNewRule );
575 const SwNumRule * SearchNumRule(
const bool bNum,
581 void DoUndo(
bool bOn =
true );
582 bool DoesUndo()
const;
583 void DoGroupUndo(
bool bUn );
584 bool DoesGroupUndo()
const;
585 void DelAllUndoObj();
593 bool GetLastUndoInfo(OUString *
const o_pStr,
595 const SwView* pView =
nullptr)
const;
596 bool GetFirstRedoInfo(OUString *
const o_pStr,
598 const SwView* pView =
nullptr)
const;
599 SwUndoId GetRepeatInfo(OUString *
const o_pStr)
const;
602 bool CursorsLocked()
const;
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);
612 void StartAllAction();
619 sal_uInt16 GetCntType()
const;
622 bool HasOtherCnt()
const;
648 void GetSelectedText( OUString &rBuf,
654 const Graphic* GetGraphic(
bool bWait =
true )
const;
658 bool IsLinkedGrfSwapOut()
const;
666 void ClearAutomaticContour();
669 bool GetGrfSize(
Size&)
const;
674 void GetGrfNms( OUString* pGrfName, OUString* pFltName,
678 void ReRead(
const OUString& rGrfName,
const OUString& rFltName,
679 const Graphic* pGraphic =
nullptr );
682 void *GetIMapInventor()
const;
686 Graphic GetIMapGraphic()
const;
695 bool HasOLEObj( std::u16string_view rName )
const;
698 void SetChartName(
const OUString &rName );
701 void UpdateCharts(
const OUString& rName );
703 OUString GetCurWord()
const;
707 void InsertGlossary(
SwTextBlocks& rGlossary,
const OUString& );
711 sal_uInt16 MakeGlossary(
SwTextBlocks& rToFill,
const OUString& rName,
712 const OUString& rShortName,
bool bSaveRelFile,
713 const OUString* pOnlyText );
716 sal_uInt16 SaveGlossaryDoc(
SwTextBlocks& rGlossary,
const OUString& rName,
717 const OUString& rShortName,
727 css::uno::Reference< css::uno::XInterface>
728 HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
733 static void InsertSoftHyph(
const sal_Int32 nHyphPos );
741 sal_uInt16 nRows, sal_uInt16 nCols,
746 sal_uInt16 nRows, sal_uInt16 nCols );
749 void SetTableName(
SwFrameFormat& rTableFormat,
const OUString &rNewName );
756 bool IsTextToTableAvailable()
const;
758 bool GetTableBoxFormulaAttrs(
SfxItemSet& rSet )
const;
759 void SetTableBoxFormulaAttrs(
const SfxItemSet& rSet );
761 bool IsTableBoxTextFormat()
const;
762 OUString GetTableBoxText()
const;
774 bool CanMergeTable(
bool bWithPrev =
true,
bool* pChkNxtPrv =
nullptr )
const;
775 bool MergeTable(
bool bWithPrev );
778 void AppendUndoForInsertFromDB(
bool bIsTable );
787 void SpellEnd(
SwConversionArgs const *pConvArgs =
nullptr,
bool bRestoreSelection =
true );
788 css::uno::Any SpellContinue(
789 sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
797 static void PutSpellingToSentenceStart();
800 static void MoveContinuationPosToEndOfCheckedSentence();
806 static bool HasLastSentenceGotGrammarChecked();
809 static bool HasConvIter();
812 static bool HasHyphIter();
814 void HandleCorrectionError(
const OUString& aText,
SwPosition aPos, sal_Int32 nBegin,
815 sal_Int32 nLen,
const Point* pPt,
817 css::uno::Reference< css::linguistic2::XSpellAlternatives >
818 GetCorrection(
const Point* pPt,
SwRect& rSelectRect );
820 bool GetGrammarCorrection( css::linguistic2::ProofreadingResult &rResult,
821 sal_Int32 &rErrorPosInText,
822 sal_Int32 &rErrorIndexInResult,
823 css::uno::Sequence< OUString > &rSuggestions,
826 static void IgnoreGrammarErrorAt(
SwPaM& rErrorPosition );
834 sal_uInt16 GetRefMarks( std::vector<OUString>* =
nullptr )
const;
843 std::vector<OUString> GetChunkForAutoText();
855 bool bKeepSelection =
false );
856 void GetINetAttrs(
SwGetINetAttrs& rArr ,
bool bIncludeInToxContent =
true);
858 OUString GetDropText(
const sal_Int32 nChars )
const;
859 void ReplaceDropText(
const OUString &rStr,
SwPaM* pPaM =
nullptr );
866 sal_Int32 GetLineCount();
871 bool HasFootnotes(
bool bEndNotes =
false )
const;
873 size_t GetSeqFootnoteList(
SwSeqFieldList& rList,
bool bEndNotes =
false );
878 bool IsInsRegionAvailable()
const;
886 SwSection* GetAnySection(
bool bOutOfTab =
false,
const Point* pPt =
nullptr );
888 size_t GetSectionFormatCount()
const;
891 void DelSectionFormat(
size_t nFormat);
894 bool IsAnySectionInDoc()
const;
896 OUString GetUniqueSectionName(
const OUString* pChkStr =
nullptr )
const;
904 sal_uInt16 GetFullSelectedSectionCount()
const;
911 void DoSpecialInsert();
912 bool CanSpecialInsert()
const;
923 bool IsMoveLeftMargin(
bool bRight,
bool bModulus =
true )
const;
924 void MoveLeftMargin(
bool bRight,
bool bModulus =
true );
929 {
return const_cast<SwEditShell*
>(
this)->GetNumberFormatter(); }
932 bool IsGlobalDoc()
const;
933 void SetGlblDocSaveLinks(
bool bFlag );
934 bool IsGlblDocSaveLinks()
const;
944 size_t nFromPos,
size_t nToPos,
951 bool IsRedlineOn()
const;
956 bool AcceptRedlinesInSelection();
957 bool RejectRedlinesInSelection();
964 bool SetRedlineComment(
const OUString& rS );
968 void UpdateRedlineAttr();
986 void SetLabelDoc(
bool bFlag );
987 bool IsLabelDoc()
const;
991 OUString DeleteExtTextInput(
bool bInsText =
true);
999 const bool bOldFlag = m_bDoParagraphSignatureValidation;
1000 m_bDoParagraphSignatureValidation = bEnable;
1009 sal_uInt16 GetScalingOfSelectedText()
const;
static SwTOXBase & GetTOX(SwDoc &rDoc, SwNodeOffset const nNodeIndex)
static void EndUndo(SwWrtShell &rSh)
Class for automated call of Start- and EndAction().
SwActContext(SwEditShell *pShell)
~SwActContext() COVERITY_NOEXCEPT_FALSE
virtual bool WarnSwitchToDesignModeDialog() const
Switch to Design mode for Forms.
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
bool IsNbspRunNext() const
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
SwEditShell(const SwEditShell &)=delete
bool m_bNbspRunNext
NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect()
const T & GetDefault(TypedWhichId< T > nWhich) const
const SvNumberFormatter * GetNumberFormatter() const
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
bool m_bDoParagraphSignatureValidation
Prevent nested calls of ValidateParagraphSignatures.
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
sfx2::LinkManager & GetLinkManager()
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
static SvxSwAutoFormatFlags * s_pAutoFormatFlags
virtual bool WarnHiddenSectionDialog() const
Selected area has hidden content.
const SwEditShell & operator=(const SwEditShell &)=delete
virtual void InfoReadOnlyDialog(bool) const
Selected area has readonly content.
Instances of SwFields and those derived from it occur 0 to n times.
Base class of all fields.
< purpose of derivation from SwClient: character style for displaying the numbers.
Class for automated call of Start- and EndCursorMove().
PaM is Point and Mark: a selection of the document model.
Of course Writer needs its own rectangles.
vector_type::size_type size_type
SwTable is one table in the document model, containing rows (which contain cells).
Represents the style of a paragraph.
SwTextAttr subclass that tracks the location of the wrapped SwFormatURL.
SwTextNode is a paragraph in the document model.
void SetRedlineFlags(RedlineFlags eMode)
virtual void Repeat(SfxRepeatTarget &) override
RedlineFlags GetRedlineFlags() const
virtual void Undo() override
virtual void ApplyViewOptions(const SwViewOption &rOpt)
virtual void CalcLayout()
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
Used by the UI to modify the document model.
SfxClassificationPolicyType
std::vector< Value >::difference_type difference_type
std::vector< Value >::size_type size_type
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
std::vector< SwGetINetAttr > SwGetINetAttrs
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
std::vector< SpellPortion > SpellPortions
Dialog to specify the properties of date form field.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
For querying the INet-attributes for Navigator.
SwGetINetAttr(OUString aText, const SwTextINetFormat &rAttr)
const SwTextINetFormat & rINetAttr
Marks a position in the document model.
SplitTable_HeadlineOption
std::vector< SwTOXMark * > SwTOXMarks