19 #ifndef INCLUDED_SW_INC_EDITSH_HXX
20 #define INCLUDED_SW_INC_EDITSH_HXX
36 namespace tools {
class PolyPolygon; }
108 class UndoRedoContext;
123 : sText( rText ), rINetAttr( rAttr )
129 #define CNT_TXT 0x0001
130 #define CNT_GRF 0x0002
131 #define CNT_OLE 0x0010
134 #define CNT_HasText(USH) ((USH)&CNT_TXT)
135 #define CNT_HasGrf(USH) ((USH)&CNT_GRF)
136 #define CNT_HasOLE(USH) ((USH)&CNT_OLE)
151 SAL_DLLPRIVATE
SwGrfNode *GetGrfNode_()
const ;
153 SAL_DLLPRIVATE
void DeleteSel(
SwPaM& rPam,
bool* pUndo =
nullptr );
163 void Insert2(
const OUString &,
const bool bForceExpandHints =
false );
164 void Overwrite(
const OUString & );
171 bool Replace(
const OUString& rNewStr,
bool bRegExpRplc );
184 void CountWords(
SwDocStat& rStat )
const;
187 bool ConvertFieldsToText();
190 void SetNumberingRestart();
193 sal_uInt16 GetLinkUpdMode()
const;
194 void SetLinkUpdMode( sal_uInt16 nMode );
203 bool CopySelToDoc(
SwDoc& rInsDoc );
205 void SplitNode(
bool bAutoFormat =
false,
bool bCheckTableStart =
true );
206 bool AppendTextNode();
207 void AutoFormatBySplitNode();
211 void DelINetAttrWithText();
215 bool DontExpandFormat();
227 const bool bMergeIndentValuesOfNumRule =
false )
const;
229 const bool bMergeIndentValuesOfNumRule =
false )
const;
231 const bool bParagraphSetting =
false );
233 SwPaM* pCursor =
nullptr,
const bool bParagraphSetting =
false );
239 std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM>>> GetItemWithPaM( sal_uInt16 nWhich );
267 const SfxPoolItem& GetDefault( sal_uInt16 nFormatHint )
const;
270 return static_cast<const T&
>(GetDefault(sal_uInt16(nWhich)));
283 size_t GetTableFrameFormatCount(
bool bUsed =
false )
const;
284 SwFrameFormat& GetTableFrameFormat(
size_t nFormat,
bool bUsed =
false )
const;
285 OUString GetUniqueTableName()
const;
288 sal_uInt16 GetCharFormatCount()
const;
293 SwCharFormat* FindCharFormatByName(
const OUString& rName )
const;
307 sal_uInt16 GetTextFormatCollCount()
const;
342 SwFormat* GetFormatFromPool( sal_uInt16 nId );
345 SwPageDesc* GetPageDescFromPool( sal_uInt16 nId );
357 void ApplyAdvancedClassification(std::vector<svx::ClassificationResult>
const & rResult);
358 std::vector<svx::ClassificationResult> CollectAdvancedClassification();
364 void SignParagraph();
367 void ValidateParagraphSignatures(
SwTextNode* pNode,
bool updateDontRemove);
370 void ValidateCurrentParagraphSignatures(
bool updateDontRemove);
373 void ValidateAllParagraphSignatures(
bool updateDontRemove);
379 void RestoreMetadataFieldsAndValidateParagraphSignatures();
383 void ClassifyDocPerHighestParagraphClass();
386 void ApplyParagraphClassification(std::vector<svx::ClassificationResult> aResult);
387 std::vector<svx::ClassificationResult> CollectParagraphClassification();
391 bool IsCursorInParagraphMetadataField()
const;
396 bool RemoveParagraphMetadataFieldAtCursor();
400 void UpdateOneField(
SwField &);
406 void RemoveFieldType(
size_t nField);
407 void RemoveFieldType(
SwFieldIds nResId,
const OUString& rName);
411 void ChangeAuthorityData(
const SwAuthEntry* pNewData);
416 void ChangeDBFields(
const std::vector<OUString>& rOldNames,
417 const OUString& rNewName );
418 void GetAllUsedDB( std::vector<OUString>& rDBNameList,
419 std::vector<OUString>
const * pAllDBNames );
421 bool IsAnyDatabaseFieldInDoc()
const;
424 bool IsFieldDataSourceAvailable(OUString& rUsedDataSource)
const;
425 void UpdateExpFields(
bool bCloseDB =
false);
426 void LockExpFields();
427 void UnlockExpFields();
428 bool IsExpFieldsLocked()
const;
439 bool IsModified()
const;
441 void ResetModified();
442 void SetUndoNoResetModified();
445 void UpdateDocStat();
450 void DeleteTOXMark(
SwTOXMark const * pMark);
453 void GetCurTOXMarks(
SwTOXMarks& rMarks)
const ;
456 void InsertTableOf(
const SwTOXBase& rTOX,
458 void UpdateTableOf(
const SwTOXBase& rTOX,
462 void SetDefaultTOXBase(
const SwTOXBase& rBase);
464 static bool IsTOXBaseReadonly(
const SwTOXBase& rTOXBase);
465 void SetTOXBaseReadonly(
const SwTOXBase& rTOXBase,
bool bReadonly);
467 sal_uInt16 GetTOXCount()
const;
469 bool DeleteTOX(
const SwTOXBase& rTOXBase,
bool bDelNodes );
472 void SetUpdateTOX(
bool bFlag );
473 bool IsUpdateTOX()
const;
476 sal_uInt16 GetTOXTypeCount(
TOXTypes eTyp)
const;
478 void InsertTOXType(
const SwTOXType& rTyp);
481 OUString
const & GetTOIAutoMarkURL()
const;
482 void SetTOIAutoMarkURL(
const OUString& rSet);
483 void ApplyAutoMark();
486 void GetTOIKeys(
SwTOIKeyType eTyp, std::vector<OUString>& rArr )
const;
488 void SetOutlineNumRule(
const SwNumRule&);
489 const SwNumRule* GetOutlineNumRule()
const;
491 bool OutlineUpDown(
short nOffset = 1 );
495 bool IsProtectedOutlinePara()
const;
497 const SwNumRule* GetNumRuleAtCurrCursorPos()
const;
501 const SwNumRule* GetNumRuleAtCurrentSelection()
const;
512 const bool bCreateNewList ,
513 const OUString& sContinuedListId = OUString(),
514 const bool bResetIndentAttrs =
false );
522 void NumUpDown(
bool bDown =
true );
525 bool MoveNumParas(
bool bUpperLower,
bool bUpperLeft );
528 bool NumOrNoNum(
bool bDelete =
false,
bool bChkStart =
true);
534 void ChangeIndentOfAllListLevels( sal_Int32 nDiff );
536 void SetIndent(
short nIndent,
const SwPosition & rPos);
537 bool IsFirstOfNumRuleAtCursorPos()
const;
539 bool IsNoNum(
bool bChkStart =
true )
const;
549 int GetCurrentParaOutlineLevel( )
const;
552 bool HasNumber()
const;
553 bool HasBullet()
const;
555 bool SelectionHasNumber()
const;
556 bool SelectionHasBullet()
const;
558 OUString GetUniqueNumRuleName()
const;
559 void ChgNumRuleFormats(
const SwNumRule& rRule );
562 void SetNumRuleStart(
bool bFlag,
SwPaM* pCursor );
563 bool IsNumRuleStart(
SwPaM* pPaM =
nullptr )
const;
564 void SetNodeNumStart( sal_uInt16 nStt );
566 sal_uInt16 GetNodeNumStart(
SwPaM* pPaM )
const;
568 void ReplaceNumRule(
const OUString& rOldRule,
const OUString& rNewRule );
573 const SwNumRule * SearchNumRule(
const bool bNum,
579 void DoUndo(
bool bOn =
true );
580 bool DoesUndo()
const;
581 void DoGroupUndo(
bool bUn );
582 bool DoesGroupUndo()
const;
583 void DelAllUndoObj();
591 bool GetLastUndoInfo(OUString *
const o_pStr,
593 const SwView* pView =
nullptr)
const;
594 bool GetFirstRedoInfo(OUString *
const o_pStr,
596 const SwView* pView =
nullptr)
const;
597 SwUndoId GetRepeatInfo(OUString *
const o_pStr)
const;
600 bool CursorsLocked()
const;
605 void Undo(sal_uInt16
const nCount = 1, sal_uInt16 nOffset = 0);
606 void Redo(sal_uInt16
const nCount = 1);
607 void Repeat(sal_uInt16
const nCount);
610 void StartAllAction();
617 sal_uInt16 GetCntType()
const;
620 bool HasOtherCnt()
const;
626 void GetSelectedText( OUString &rBuf,
632 const Graphic* GetGraphic(
bool bWait =
true )
const;
636 bool IsLinkedGrfSwapOut()
const;
644 void ClearAutomaticContour();
647 bool GetGrfSize(
Size&)
const;
652 void GetGrfNms( OUString* pGrfName, OUString* pFltName,
656 void ReRead(
const OUString& rGrfName,
const OUString& rFltName,
657 const Graphic* pGraphic =
nullptr );
660 void *GetIMapInventor()
const;
664 Graphic GetIMapGraphic()
const;
673 bool HasOLEObj( std::u16string_view rName )
const;
676 void SetChartName(
const OUString &rName );
679 void UpdateCharts(
const OUString& rName );
681 OUString GetCurWord()
const;
685 void InsertGlossary(
SwTextBlocks& rGlossary,
const OUString& );
689 sal_uInt16 MakeGlossary(
SwTextBlocks& rToFill,
const OUString& rName,
690 const OUString& rShortName,
bool bSaveRelFile,
691 const OUString* pOnlyText );
694 sal_uInt16 SaveGlossaryDoc(
SwTextBlocks& rGlossary,
const OUString& rName,
695 const OUString& rShortName,
705 css::uno::Reference< css::uno::XInterface>
706 HyphContinue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt );
711 static void InsertSoftHyph(
const sal_Int32 nHyphPos );
719 sal_uInt16 nRows, sal_uInt16 nCols,
724 sal_uInt16 nRows, sal_uInt16 nCols );
727 void SetTableName(
SwFrameFormat& rTableFormat,
const OUString &rNewName );
734 bool IsTextToTableAvailable()
const;
736 bool GetTableBoxFormulaAttrs(
SfxItemSet& rSet )
const;
737 void SetTableBoxFormulaAttrs(
const SfxItemSet& rSet );
739 bool IsTableBoxTextFormat()
const;
740 OUString GetTableBoxText()
const;
752 bool CanMergeTable(
bool bWithPrev =
true,
bool* pChkNxtPrv =
nullptr )
const;
753 bool MergeTable(
bool bWithPrev );
756 void AppendUndoForInsertFromDB(
bool bIsTable );
765 void SpellEnd(
SwConversionArgs const *pConvArgs =
nullptr,
bool bRestoreSelection =
true );
766 css::uno::Any SpellContinue(
767 sal_uInt16* pPageCnt, sal_uInt16* pPageSt,
775 static void PutSpellingToSentenceStart();
778 static void MoveContinuationPosToEndOfCheckedSentence();
784 static bool HasLastSentenceGotGrammarChecked();
787 static bool HasConvIter();
790 static bool HasHyphIter();
792 void HandleCorrectionError(
const OUString& aText,
SwPosition aPos, sal_Int32 nBegin,
793 sal_Int32 nLen,
const Point* pPt,
795 css::uno::Reference< css::linguistic2::XSpellAlternatives >
796 GetCorrection(
const Point* pPt,
SwRect& rSelectRect );
798 bool GetGrammarCorrection( css::linguistic2::ProofreadingResult &rResult,
799 sal_Int32 &rErrorPosInText,
800 sal_Int32 &rErrorIndexInResult,
801 css::uno::Sequence< OUString > &rSuggestions,
802 const Point* pPt,
SwRect& rSelectRect );
804 static void IgnoreGrammarErrorAt(
SwPaM& rErrorPosition );
812 sal_uInt16 GetRefMarks( std::vector<OUString>* =
nullptr )
const;
821 std::vector<OUString> GetChunkForAutoText();
830 OUString Calculate();
833 bool bKeepSelection =
false );
834 void GetINetAttrs(
SwGetINetAttrs& rArr ,
bool bIncludeInToxContent =
true);
836 OUString GetDropText(
const sal_Int32 nChars )
const;
837 void ReplaceDropText(
const OUString &rStr,
SwPaM* pPaM =
nullptr );
844 sal_uInt16 GetLineCount();
849 bool HasFootnotes(
bool bEndNotes =
false )
const;
851 size_t GetSeqFootnoteList(
SwSeqFieldList& rList,
bool bEndNotes =
false );
856 bool IsInsRegionAvailable()
const;
864 SwSection* GetAnySection(
bool bOutOfTab =
false,
const Point* pPt =
nullptr );
866 size_t GetSectionFormatCount()
const;
869 void DelSectionFormat(
size_t nFormat);
872 bool IsAnySectionInDoc()
const;
874 OUString GetUniqueSectionName(
const OUString* pChkStr =
nullptr )
const;
882 sal_uInt16 GetFullSelectedSectionCount()
const;
889 void DoSpecialInsert();
890 bool CanSpecialInsert()
const;
901 bool IsMoveLeftMargin(
bool bRight,
bool bModulus =
true )
const;
902 void MoveLeftMargin(
bool bRight,
bool bModulus =
true );
907 {
return const_cast<SwEditShell*
>(
this)->GetNumberFormatter(); }
910 bool IsGlobalDoc()
const;
911 void SetGlblDocSaveLinks(
bool bFlag );
912 bool IsGlblDocSaveLinks()
const;
922 size_t nFromPos,
size_t nToPos,
929 bool IsRedlineOn()
const;
934 bool AcceptRedlinesInSelection();
935 bool RejectRedlinesInSelection();
942 bool SetRedlineComment(
const OUString& rS );
946 void UpdateRedlineAttr();
964 void SetLabelDoc(
bool bFlag );
965 bool IsLabelDoc()
const;
969 OUString DeleteExtTextInput(
bool bInsText =
true);
977 const bool bOldFlag = m_bDoParagraphSignatureValidation;
978 m_bDoParagraphSignatureValidation = bEnable;
987 sal_uInt16 GetScalingOfSelectedText()
const;
1030 ~SwMvContext() COVERITY_NOEXCEPT_FALSE;
BroadcasterMixin & operator=(const BroadcasterMixin &)
Instances of SwFields and those derived from it occur 0 to n times.
Represents the style of a paragraph.
virtual void ApplyViewOptions(const SwViewOption &rOpt)
Marks a position in the document model.
static SwTOXBase & GetTOX(SwDoc &rDoc, SwNodeOffset const nNodeIndex)
bool IsNbspRunNext() const
sfx2::LinkManager & GetLinkManager()
virtual void CalcLayout()
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
std::vector< SwNode * >::difference_type difference_type
virtual void Repeat(SfxRepeatTarget &) override
std::vector< SwTOXMark * > SwTOXMarks
Base class of all fields.
void SetRedlineFlags(RedlineFlags eMode)
const T & GetDefault(TypedWhichId< T > nWhich) const
SwGetINetAttr(const OUString &rText, const SwTextINetFormat &rAttr)
Dialog to specify the properties of date form field.
Of course Writer needs its own rectangles.
bool SetParagraphSignatureValidation(const bool bEnable)
Enable/Disable paragraph signature validation and return the previous value.
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
virtual bool GetInfo(SfxPoolItem &) const override
bool m_bDoParagraphSignatureValidation
Prevent nested calls of ValidateParagraphSignatures.
std::vector< SwGetINetAttr > SwGetINetAttrs
RedlineFlags GetRedlineFlags() const
PaM is Point and Mark: a selection of the document model.
Class for automated call of Start- and EndAction().
static void EndUndo(SwWrtShell &rSh)
bool IsParagraphSignatureValidationEnabled() const
Returns true iff paragraph signature validation is enabled.
void UpdateFields(bool bCloseDB=false)
Forces update of each field.
SfxClassificationPolicyType
const SwTextINetFormat & rINetAttr
vector_type::size_type size_type
SplitTable_HeadlineOption
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
const SvNumberFormatter * GetNumberFormatter() const
SwTable is one table in the document model, containing rows (which contain cells).
< purpose of derivation from SwClient: character style for displaying the numbers.
static SvxSwAutoFormatFlags * s_pAutoFormatFlags
Class for automated call of Start- and EndCursorMove().
SwTextNode is a paragraph in the document model.
For querying the INet-attributes for Navigator.
~SwActContext() COVERITY_NOEXCEPT_FALSE
SwFormat * GetFormatFromPool(sal_uInt16 nId)
return the requested automatic format - base-class !
virtual void Redo() override
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
bool m_bNbspRunNext
NO-BREAK SPACE state flag passed to and maintained by SvxAutoCorrect::DoAutoCorrect() ...
virtual void Undo() override
std::vector< SpellPortion > SpellPortions
std::vector< SwNode * >::size_type size_type
virtual void Insert(SotClipboardFormatId nFormat, const OUString &rFormatName) override
SwActContext(SwEditShell *pShell)