19#ifndef INCLUDED_SW_INC_EDITSH_HXX
20#define INCLUDED_SW_INC_EDITSH_HXX
37namespace tools {
class PolyPolygon; }
109 class UndoRedoContext;
130#define CNT_TXT 0x0001
131#define CNT_GRF 0x0002
132#define CNT_OLE 0x0010
135#define CNT_HasText(USH) ((USH)&CNT_TXT)
136#define CNT_HasGrf(USH) ((USH)&CNT_GRF)
137#define CNT_HasOLE(USH) ((USH)&CNT_OLE)
152 SAL_DLLPRIVATE
SwGrfNode *GetGrfNode_()
const ;
154 SAL_DLLPRIVATE
void DeleteSel(
SwPaM& rPam,
bool isArtificialSelection,
bool* pUndo =
nullptr);
159 using sw::BroadcastingModify::GetInfo;
164 void Insert2(
const OUString &,
const bool bForceExpandHints =
false );
165 void Overwrite(
const OUString & );
172 bool Replace(
const OUString& rNewStr,
bool bRegExpRplc );
176 bool Delete(
bool isArtificialSelection =
false);
185 void CountWords(
SwDocStat& rStat )
const;
188 bool ConvertFieldsToText();
191 void SetNumberingRestart();
194 sal_uInt16 GetLinkUpdMode()
const;
195 void SetLinkUpdMode( sal_uInt16 nMode );
204 bool CopySelToDoc(
SwDoc& rInsDoc );
206 void SplitNode(
bool bAutoFormat =
false,
bool bCheckTableStart =
true );
207 bool AppendTextNode();
208 void AutoFormatBySplitNode();
212 void DelINetAttrWithText();
216 bool DontExpandFormat();
228 const bool bMergeIndentValuesOfNumRule =
false )
const;
230 const bool bMergeIndentValuesOfNumRule =
false )
const;
232 const bool bParagraphSetting =
false );
234 SwPaM* pCursor =
nullptr,
const bool bParagraphSetting =
false );
240 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
268 const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint )
const;
271 return static_cast<const T&
>(GetDefault(sal_uInt16(nWhich)));
284 size_t GetTableFrameFormatCount(
bool bUsed =
false )
const;
285 SwFrameFormat& GetTableFrameFormat(
size_t nFormat,
bool bUsed =
false )
const;
286 OUString GetUniqueTableName()
const;
289 sal_uInt16 GetCharFormatCount()
const;
294 SwCharFormat* FindCharFormatByName(
const OUString& rName )
const;
308 sal_uInt16 GetTextFormatCollCount()
const;
343 SwFormat* GetFormatFromPool( sal_uInt16 nId );
346 SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
349 bool IsUsed(
const sw::BroadcastingModify& )
const;
358 void ApplyAdvancedClassification(std::vector<svx::ClassificationResult>
const & rResult);
359 std::vector<svx::ClassificationResult> CollectAdvancedClassification();
365 void SignParagraph();
368 void ValidateParagraphSignatures(
SwTextNode* pNode,
bool updateDontRemove);
371 void ValidateCurrentParagraphSignatures(
bool updateDontRemove);
374 void ValidateAllParagraphSignatures(
bool updateDontRemove);
380 void RestoreMetadataFieldsAndValidateParagraphSignatures();
384 void ClassifyDocPerHighestParagraphClass();
387 void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
388 std::vector<svx::ClassificationResult> CollectParagraphClassification();
392 bool IsCursorInParagraphMetadataField()
const;
397 bool RemoveParagraphMetadataFieldAtCursor();
401 void UpdateOneField(
SwField &);
407 void RemoveFieldType(
size_t nField);
408 void RemoveFieldType(
SwFieldIds nResId,
const OUString& rName);
412 void ChangeAuthorityData(
const SwAuthEntry* pNewData);
417 void ChangeDBFields(
const std::vector<OUString>& rOldNames,
418 const OUString& rNewName );
419 void GetAllUsedDB( std::vector<OUString>& rDBNameList,
420 std::vector<OUString>
const * pAllDBNames );
422 bool IsAnyDatabaseFieldInDoc()
const;
425 bool IsFieldDataSourceAvailable(OUString& rUsedDataSource)
const;
426 void UpdateExpFields(
bool bCloseDB =
false);
427 void LockExpFields();
428 void UnlockExpFields();
429 bool IsExpFieldsLocked()
const;
440 bool IsModified()
const;
442 void ResetModified();
443 void SetUndoNoResetModified();
446 void UpdateDocStat();
451 void DeleteTOXMark(
SwTOXMark const * pMark);
454 void GetCurTOXMarks(
SwTOXMarks& rMarks)
const ;
457 void InsertTableOf(
const SwTOXBase& rTOX,
459 void UpdateTableOf(
const SwTOXBase& rTOX,
463 void SetDefaultTOXBase(
const SwTOXBase& rBase);
465 static bool IsTOXBaseReadonly(
const SwTOXBase& rTOXBase);
466 void SetTOXBaseReadonly(
const SwTOXBase& rTOXBase,
bool bReadonly);
468 sal_uInt16 GetTOXCount()
const;
470 bool DeleteTOX(
const SwTOXBase& rTOXBase,
bool bDelNodes );
473 void SetUpdateTOX(
bool bFlag );
474 bool IsUpdateTOX()
const;
477 sal_uInt16 GetTOXTypeCount(
TOXTypes eTyp)
const;
479 void InsertTOXType(
const SwTOXType& rTyp);
482 OUString
const & GetTOIAutoMarkURL()
const;
483 void SetTOIAutoMarkURL(
const OUString& rSet);
484 void ApplyAutoMark();
487 void GetTOIKeys(
SwTOIKeyType eTyp, std::vector<OUString>& rArr )
const;
489 void SetOutlineNumRule(
const SwNumRule&);
490 const SwNumRule* GetOutlineNumRule()
const;
492 bool OutlineUpDown(
short nOffset = 1 );
496 bool IsProtectedOutlinePara()
const;
498 const SwNumRule* GetNumRuleAtCurrCursorPos()
const;
502 const SwNumRule* GetNumRuleAtCurrentSelection()
const;
513 const bool bCreateNewList ,
514 const OUString& sContinuedListId = OUString(),
515 const bool bResetIndentAttrs =
false );
523 void NumUpDown(
bool bDown =
true );
526 bool MoveNumParas(
bool bUpperLower,
bool bUpperLeft );
529 bool NumOrNoNum(
bool bDelete =
false,
bool bChkStart =
true);
535 void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
537 void SetIndent(
short nIndent,
const SwPosition & rPos);
538 bool IsFirstOfNumRuleAtCursorPos()
const;
540 bool IsNoNum(
bool bChkStart =
true )
const;
550 int GetCurrentParaOutlineLevel( )
const;
553 bool HasNumber()
const;
554 bool HasBullet()
const;
556 bool SelectionHasNumber()
const;
557 bool SelectionHasBullet()
const;
559 OUString GetUniqueNumRuleName()
const;
560 void ChgNumRuleFormats(
const SwNumRule& rRule );
563 void SetNumRuleStart(
bool bFlag,
SwPaM* pCursor );
564 bool IsNumRuleStart(
SwPaM* pPaM =
nullptr )
const;
565 void SetNodeNumStart( sal_uInt16 nStt );
567 sal_uInt16 GetNodeNumStart(
SwPaM* pPaM )
const;
569 void ReplaceNumRule(
const OUString& rOldRule,
const OUString& rNewRule );
574 const SwNumRule * SearchNumRule(
const bool bNum,
580 void DoUndo(
bool bOn =
true );
581 bool DoesUndo()
const;
582 void DoGroupUndo(
bool bUn );
583 bool DoesGroupUndo()
const;
584 void DelAllUndoObj();
592 bool GetLastUndoInfo(OUString *
const o_pStr,
594 const SwView* pView =
nullptr)
const;
595 bool GetFirstRedoInfo(OUString *
const o_pStr,
597 const SwView* pView =
nullptr)
const;
598 SwUndoId GetRepeatInfo(OUString *
const o_pStr)
const;
601 bool CursorsLocked()
const;
606 void Undo(sal_uInt16
const nCount = 1, sal_uInt16 nOffset = 0);
607 void Redo(sal_uInt16
const nCount = 1);
608 void Repeat(sal_uInt16
const nCount);
611 void StartAllAction();
618 sal_uInt16 GetCntType()
const;
621 bool HasOtherCnt()
const;
627 void GetSelectedText( OUString &rBuf,
633 const Graphic* GetGraphic(
bool bWait =
true )
const;
637 bool IsLinkedGrfSwapOut()
const;
645 void ClearAutomaticContour();
648 bool GetGrfSize(
Size&)
const;
653 void GetGrfNms( OUString* pGrfName, OUString* pFltName,
657 void ReRead(
const OUString& rGrfName,
const OUString& rFltName,
658 const Graphic* pGraphic =
nullptr );
661 void *GetIMapInventor()
const;
665 Graphic GetIMapGraphic()
const;
674 bool HasOLEObj( std::u16string_view rName )
const;
677 void SetChartName(
const OUString &rName );
680 void UpdateCharts(
const OUString& rName );
682 OUString GetCurWord()
const;
686 void InsertGlossary(
SwTextBlocks& rGlossary,
const OUString& );
690 sal_uInt16 MakeGlossary(
SwTextBlocks& rToFill,
const OUString& rName,
691 const OUString& rShortName,
bool bSaveRelFile,
692 const OUString* pOnlyText );
695 sal_uInt16 SaveGlossaryDoc(
SwTextBlocks& rGlossary,
const OUString& rName,
696 const OUString& rShortName,
706 css::uno::Reference< css::uno::XInterface>
707 HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
712 static void InsertSoftHyph(
const sal_Int32 nHyphPos );
720 sal_uInt16 nRows, sal_uInt16 nCols,
725 sal_uInt16 nRows, sal_uInt16 nCols );
728 void SetTableName(
SwFrameFormat& rTableFormat,
const OUString &rNewName );
735 bool IsTextToTableAvailable()
const;
737 bool GetTableBoxFormulaAttrs(
SfxItemSet& rSet )
const;
738 void SetTableBoxFormulaAttrs(
const SfxItemSet& rSet );
740 bool IsTableBoxTextFormat()
const;
741 OUString GetTableBoxText()
const;
753 bool CanMergeTable(
bool bWithPrev =
true,
bool* pChkNxtPrv =
nullptr )
const;
754 bool MergeTable(
bool bWithPrev );
757 void AppendUndoForInsertFromDB(
bool bIsTable );
766 void SpellEnd(
SwConversionArgs const *pConvArgs =
nullptr,
bool bRestoreSelection =
true );
767 css::uno::Any SpellContinue(
768 sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
776 static void PutSpellingToSentenceStart();
779 static void MoveContinuationPosToEndOfCheckedSentence();
785 static bool HasLastSentenceGotGrammarChecked();
788 static bool HasConvIter();
791 static bool HasHyphIter();
793 void HandleCorrectionError(
const OUString& aText,
SwPosition aPos, sal_Int32 nBegin,
794 sal_Int32 nLen,
const Point* pPt,
796 css::uno::Reference< css::linguistic2::XSpellAlternatives >
797 GetCorrection(
const Point* pPt,
SwRect& rSelectRect );
799 bool GetGrammarCorrection( css::linguistic2::ProofreadingResult &rResult,
800 sal_Int32 &rErrorPosInText,
801 sal_Int32 &rErrorIndexInResult,
802 css::uno::Sequence< OUString > &rSuggestions,
803 const Point* pPt,
SwRect& rSelectRect );
805 static void IgnoreGrammarErrorAt(
SwPaM& rErrorPosition );
813 sal_uInt16 GetRefMarks( std::vector<OUString>* =
nullptr )
const;
822 std::vector<OUString> GetChunkForAutoText();
834 bool bKeepSelection =
false );
835 void GetINetAttrs(
SwGetINetAttrs& rArr ,
bool bIncludeInToxContent =
true);
837 OUString GetDropText(
const sal_Int32 nChars )
const;
838 void ReplaceDropText(
const OUString &rStr,
SwPaM* pPaM =
nullptr );
845 sal_uInt16 GetLineCount();
850 bool HasFootnotes(
bool bEndNotes =
false )
const;
852 size_t GetSeqFootnoteList(
SwSeqFieldList& rList,
bool bEndNotes =
false );
857 bool IsInsRegionAvailable()
const;
865 SwSection* GetAnySection(
bool bOutOfTab =
false,
const Point* pPt =
nullptr );
867 size_t GetSectionFormatCount()
const;
870 void DelSectionFormat(
size_t nFormat);
873 bool IsAnySectionInDoc()
const;
875 OUString GetUniqueSectionName(
const OUString* pChkStr =
nullptr )
const;
883 sal_uInt16 GetFullSelectedSectionCount()
const;
890 void DoSpecialInsert();
891 bool CanSpecialInsert()
const;
902 bool IsMoveLeftMargin(
bool bRight,
bool bModulus =
true )
const;
903 void MoveLeftMargin(
bool bRight,
bool bModulus =
true );
908 {
return const_cast<SwEditShell*
>(
this)->GetNumberFormatter(); }
911 bool IsGlobalDoc()
const;
912 void SetGlblDocSaveLinks(
bool bFlag );
913 bool IsGlblDocSaveLinks()
const;
923 size_t nFromPos,
size_t nToPos,
930 bool IsRedlineOn()
const;
935 bool AcceptRedlinesInSelection();
936 bool RejectRedlinesInSelection();
943 bool SetRedlineComment(
const OUString& rS );
947 void UpdateRedlineAttr();
965 void SetLabelDoc(
bool bFlag );
966 bool IsLabelDoc()
const;
970 OUString DeleteExtTextInput(
bool bInsText =
true);
978 const bool bOldFlag = m_bDoParagraphSignatureValidation;
979 m_bDoParagraphSignatureValidation = bEnable;
988 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
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
const SwEditShell & operator=(const SwEditShell &)=delete
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.
SwTextNode is a paragraph in the document model.
void SetRedlineFlags(RedlineFlags eMode)
virtual void Repeat(SfxRepeatTarget &) override
virtual void Redo() 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.
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