LibreOffice Module sw (master) 1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
IDocumentMarkAccess Class Referenceabstract

Provides access to the marks of a document. More...

#include <IDocumentMarkAccess.hxx>

Inheritance diagram for IDocumentMarkAccess:
[legend]

Classes

struct  ILazyDeleter
 To avoid recursive calls of deleteMark, the removal of dummy characters of fieldmarks has to be delayed; this is the baseclass that can be subclassed for that purpose. More...
 
class  iterator
 wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances can be retrieved directly. More...
 

Public Types

enum class  MarkType {
  UNO_BOOKMARK ,
  DDE_BOOKMARK ,
  BOOKMARK ,
  CROSSREF_HEADING_BOOKMARK ,
  CROSSREF_NUMITEM_BOOKMARK ,
  ANNOTATIONMARK ,
  TEXT_FIELDMARK ,
  CHECKBOX_FIELDMARK ,
  DROPDOWN_FIELDMARK ,
  DATE_FIELDMARK ,
  NAVIGATOR_REMINDER
}
 
typedef iterator const_iterator_t
 

Public Member Functions

virtual ::sw::mark::IMarkmakeMark (const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark, ::sw::mark::InsertMode eMode, SwPosition const *pSepPos=nullptr)=0
 Generates a new mark in the document for a certain selection. More...
 
virtual sw::mark::IFieldmark * makeFieldBookmark (const SwPaM &rPaM, const OUString &rName, const OUString &rType, SwPosition const *pSepPos=nullptr)=0
 
virtual sw::mark::IFieldmark * makeNoTextFieldBookmark (const SwPaM &rPaM, const OUString &rName, const OUString &rType)=0
 
virtual sw::mark::IMarkmakeAnnotationMark (const SwPaM &rPaM, const OUString &rName)=0
 
virtual ::sw::mark::IMarkgetMarkForTextNode (const SwTextNode &rTextNode, MarkType eMark)=0
 Returns a mark in the document for a paragraph. More...
 
virtual void repositionMark (::sw::mark::IMark *io_pMark, const SwPaM &rPaM)=0
 Moves an existing mark to a new selection and performs needed updates. More...
 
virtual bool renameMark (::sw::mark::IMark *io_pMark, const OUString &rNewName)=0
 Renames an existing Mark, if possible. More...
 
virtual void correctMarksAbsolute (const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)=0
 Corrects marks (absolute) This method ignores the previous position of the mark in the paragraph. More...
 
virtual void correctMarksRelative (const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)=0
 Corrects marks (relative) This method uses the previous position of the mark in the paragraph as offset. More...
 
virtual void deleteMarks (const SwNode &rStt, const SwNode &rEnd, std::vector< ::sw::mark::SaveBookmark > *pSaveBkmk, std::optional< sal_Int32 > oStartContentIdx, std::optional< sal_Int32 > oEndContentIdx)=0
 Deletes marks in a range. More...
 
virtual std::unique_ptr< ILazyDeleterdeleteMark (const IDocumentMarkAccess::const_iterator_t &ppMark, bool isMoveNodes)=0
 Deletes a mark. More...
 
virtual void deleteMark (const ::sw::mark::IMark *const pMark)=0
 Deletes a mark. More...
 
virtual void clearAllMarks ()=0
 Clear (deletes) all marks. More...
 
virtual void assureSortedMarkContainers () const =0
 
virtual const_iterator_t getAllMarksBegin () const =0
 returns a STL-like random access iterator to the begin of the sequence of marks. More...
 
virtual const_iterator_t getAllMarksEnd () const =0
 returns a STL-like random access iterator to the end of the sequence of marks. More...
 
virtual sal_Int32 getAllMarksCount () const =0
 returns the number of marks. More...
 
virtual const_iterator_t findMark (const OUString &rMark) const =0
 Finds a mark by name. More...
 
virtual bool isBookmarkDeleted (SwPaM const &rPaM, bool isReplace) const =0
 check if the selection would delete a BOOKMARK More...
 
virtual const_iterator_t getBookmarksBegin () const =0
 returns a STL-like random access iterator to the begin of the sequence the IBookmarks. More...
 
virtual const_iterator_t getBookmarksEnd () const =0
 returns a STL-like random access iterator to the end of the sequence of IBookmarks. More...
 
virtual sal_Int32 getBookmarksCount () const =0
 returns the number of IBookmarks. More...
 
virtual const_iterator_t findBookmark (const OUString &rMark) const =0
 Finds a bookmark by name. More...
 
virtual const_iterator_t findFirstBookmarkStartsAfter (const SwPosition &rPos) const =0
 Finds the first mark that is starting after. More...
 
virtual sw::mark::IMarkgetOneInnermostBookmarkFor (const SwPosition &rPos) const =0
 Get the innermost bookmark that contains rPos. More...
 
virtual const_iterator_t getFieldmarksBegin () const =0
 returns a STL-like random access iterator to the begin of the sequence of fieldmarks. More...
 
virtual const_iterator_t getFieldmarksEnd () const =0
 returns a STL-like random access iterator to the end of the sequence of fieldmarks. More...
 
virtual sal_Int32 getFieldmarksCount () const =0
 returns the number of IFieldmarks. More...
 
virtual ::sw::mark::IFieldmark * getFieldmarkAt (const SwPosition &rPos) const =0
 get Fieldmark for CH_TXT_ATR_FIELDSTART/CH_TXT_ATR_FIELDEND at rPos More...
 
virtual sw::mark::IFieldmark * getInnerFieldmarkFor (const SwPosition &pos) const =0
 
virtual sw::mark::IFieldmark * getFieldmarkBefore (const SwPosition &pos, bool bLoop) const =0
 
virtual sw::mark::IFieldmark * getFieldmarkAfter (const SwPosition &pos, bool bLoop) const =0
 
virtual ::sw::mark::IFieldmark * getDropDownFor (const SwPosition &pos) const =0
 
virtual std::vector<::sw::mark::IFieldmark * > getNoTextFieldmarksIn (const SwPaM &rPaM) const =0
 
virtual void deleteFieldmarkAt (const SwPosition &rPos)=0
 
virtual ::sw::mark::IFieldmark * changeFormFieldmarkType (::sw::mark::IFieldmark *pFieldmark, const OUString &rNewType)=0
 
virtual void NotifyCursorUpdate (const SwCursorShell &rCursorShell)=0
 
virtual void ClearFieldActivation ()=0
 
virtual const_iterator_t getAnnotationMarksBegin () const =0
 
virtual const_iterator_t getAnnotationMarksEnd () const =0
 
virtual sal_Int32 getAnnotationMarksCount () const =0
 
virtual const_iterator_t findAnnotationMark (const OUString &rName) const =0
 
virtual sw::mark::IMarkgetAnnotationMarkFor (const SwPosition &rPosition) const =0
 
virtual ::sw::mark::IMarkmakeAnnotationBookmark (const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark, ::sw::mark::InsertMode eMode, SwPosition const *pSepPos=nullptr)=0
 
virtual const_iterator_t findAnnotationBookmark (const OUString &rName) const =0
 
virtual void restoreAnnotationMarks (bool bDelete=true)=0
 
virtual const_iterator_t findFirstAnnotationStartsAfter (const SwPosition &rPos) const =0
 Finds the first mark that is starting after. More...
 

Static Public Member Functions

static SW_DLLPUBLIC MarkType GetType (const ::sw::mark::IMark &rMark)
 Returns the MarkType used to create the mark. More...
 
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix ()
 
static SW_DLLPUBLIC bool IsLegalPaMForCrossRefHeadingBookmark (const SwPaM &rPaM)
 
static void DeleteFieldmarkCommand (::sw::mark::IFieldmark const &rMark)
 

Protected Member Functions

virtual ~IDocumentMarkAccess ()
 

Detailed Description

Provides access to the marks of a document.

Definition at line 39 of file IDocumentMarkAccess.hxx.

Member Typedef Documentation

◆ const_iterator_t

Definition at line 108 of file IDocumentMarkAccess.hxx.

Member Enumeration Documentation

◆ MarkType

enum class IDocumentMarkAccess::MarkType
strong
Enumerator
UNO_BOOKMARK 
DDE_BOOKMARK 
BOOKMARK 
CROSSREF_HEADING_BOOKMARK 
CROSSREF_NUMITEM_BOOKMARK 
ANNOTATIONMARK 
TEXT_FIELDMARK 
CHECKBOX_FIELDMARK 
DROPDOWN_FIELDMARK 
DATE_FIELDMARK 
NAVIGATOR_REMINDER 

Definition at line 42 of file IDocumentMarkAccess.hxx.

Constructor & Destructor Documentation

◆ ~IDocumentMarkAccess()

virtual IDocumentMarkAccess::~IDocumentMarkAccess ( )
inlineprotectedvirtual

Definition at line 375 of file IDocumentMarkAccess.hxx.

Member Function Documentation

◆ assureSortedMarkContainers()

virtual void IDocumentMarkAccess::assureSortedMarkContainers ( ) const
pure virtual

◆ changeFormFieldmarkType()

virtual ::sw::mark::IFieldmark * IDocumentMarkAccess::changeFormFieldmarkType ( ::sw::mark::IFieldmark *  pFieldmark,
const OUString &  rNewType 
)
pure virtual

Implemented in sw::mark::MarkManager.

◆ clearAllMarks()

virtual void IDocumentMarkAccess::clearAllMarks ( )
pure virtual

Clear (deletes) all marks.

Implemented in sw::mark::MarkManager.

◆ ClearFieldActivation()

virtual void IDocumentMarkAccess::ClearFieldActivation ( )
pure virtual

◆ correctMarksAbsolute()

virtual void IDocumentMarkAccess::correctMarksAbsolute ( const SwNode rOldNode,
const SwPosition rNewPos,
const sal_Int32  nOffset 
)
pure virtual

Corrects marks (absolute) This method ignores the previous position of the mark in the paragraph.

Parameters
rOldNode[in] the node from which nodes should be moved
rNewPos[in] new position to which marks will be moved, if nOffset == 0
nOffset[in] the offset by which the mark gets positioned of rNewPos

Implemented in sw::mark::MarkManager.

Referenced by SwDoc::CorrAbs().

◆ correctMarksRelative()

virtual void IDocumentMarkAccess::correctMarksRelative ( const SwNode rOldNode,
const SwPosition rNewPos,
const sal_Int32  nOffset 
)
pure virtual

Corrects marks (relative) This method uses the previous position of the mark in the paragraph as offset.

Parameters
rOldNode[in] the node from which nodes should be moved
rNewPos[in] new position to which marks from the start of the paragraph will be moved, if nOffset == 0
nOffset[in] the offset by which the mark gets positioned of rNewPos in addition to its old position in the paragraph

Implemented in sw::mark::MarkManager.

Referenced by SwDoc::CorrRel().

◆ deleteFieldmarkAt()

virtual void IDocumentMarkAccess::deleteFieldmarkAt ( const SwPosition rPos)
pure virtual

◆ DeleteFieldmarkCommand()

void IDocumentMarkAccess::DeleteFieldmarkCommand ( ::sw::mark::IFieldmark const &  rMark)
static

◆ deleteMark() [1/2]

virtual void IDocumentMarkAccess::deleteMark ( const ::sw::mark::IMark *const  pMark)
pure virtual

Deletes a mark.

Parameters
ppMark[in] the name of the mark to be deleted.

Implemented in sw::mark::MarkManager.

◆ deleteMark() [2/2]

virtual std::unique_ptr< ILazyDeleter > IDocumentMarkAccess::deleteMark ( const IDocumentMarkAccess::const_iterator_t ppMark,
bool  isMoveNodes 
)
pure virtual

◆ deleteMarks()

virtual void IDocumentMarkAccess::deleteMarks ( const SwNode rStt,
const SwNode rEnd,
std::vector< ::sw::mark::SaveBookmark > *  pSaveBkmk,
std::optional< sal_Int32 >  oStartContentIdx,
std::optional< sal_Int32 >  oEndContentIdx 
)
pure virtual

Deletes marks in a range.

Note: navigator reminders are excluded

Implemented in sw::mark::MarkManager.

Referenced by DelBookmarks().

◆ findAnnotationBookmark()

virtual const_iterator_t IDocumentMarkAccess::findAnnotationBookmark ( const OUString &  rName) const
pure virtual

◆ findAnnotationMark()

virtual const_iterator_t IDocumentMarkAccess::findAnnotationMark ( const OUString &  rName) const
pure virtual

◆ findBookmark()

virtual const_iterator_t IDocumentMarkAccess::findBookmark ( const OUString &  rMark) const
pure virtual

Finds a bookmark by name.

Parameters
rName[in] the name of the bookmark to find.
Returns
an iterator pointing to the bookmark, or getBookmarksEnd() if nothing was found.

Implemented in sw::mark::MarkManager.

Referenced by SwContentTree::BringBookmarksToAttention(), SwWW8ImplReader::CoreLoad(), SwXBookmarks::getByName(), SwXBookmarks::hasByName(), and SwEditWin::RequestHelp().

◆ findFirstAnnotationStartsAfter()

virtual const_iterator_t IDocumentMarkAccess::findFirstAnnotationStartsAfter ( const SwPosition rPos) const
pure virtual

Finds the first mark that is starting after.

Returns
an iterator pointing to the mark, or pointing to getAnnotationMarksEnd() if nothing was found.

Implemented in sw::mark::MarkManager.

◆ findFirstBookmarkStartsAfter()

virtual const_iterator_t IDocumentMarkAccess::findFirstBookmarkStartsAfter ( const SwPosition rPos) const
pure virtual

Finds the first mark that is starting after.

Returns
an iterator pointing to the mark, or pointing to getBookmarksEnd() if nothing was found.

Implemented in sw::mark::MarkManager.

Referenced by Writer::FindPos_Bkmk(), SwCursorShell::GoNextBookmark(), and SwCursorShell::GoPrevBookmark().

◆ findMark()

virtual const_iterator_t IDocumentMarkAccess::findMark ( const OUString &  rMark) const
pure virtual

◆ getAllMarksBegin()

virtual const_iterator_t IDocumentMarkAccess::getAllMarksBegin ( ) const
pure virtual

◆ getAllMarksCount()

virtual sal_Int32 IDocumentMarkAccess::getAllMarksCount ( ) const
pure virtual

◆ getAllMarksEnd()

virtual const_iterator_t IDocumentMarkAccess::getAllMarksEnd ( ) const
pure virtual

◆ getAnnotationMarkFor()

virtual sw::mark::IMark * IDocumentMarkAccess::getAnnotationMarkFor ( const SwPosition rPosition) const
pure virtual

Implemented in sw::mark::MarkManager.

Referenced by SwCursor::SelectWordWT().

◆ getAnnotationMarksBegin()

virtual const_iterator_t IDocumentMarkAccess::getAnnotationMarksBegin ( ) const
pure virtual

◆ getAnnotationMarksCount()

virtual sal_Int32 IDocumentMarkAccess::getAnnotationMarksCount ( ) const
pure virtual

◆ getAnnotationMarksEnd()

virtual const_iterator_t IDocumentMarkAccess::getAnnotationMarksEnd ( ) const
pure virtual

◆ getBookmarksBegin()

virtual const_iterator_t IDocumentMarkAccess::getBookmarksBegin ( ) const
pure virtual

◆ getBookmarksCount()

virtual sal_Int32 IDocumentMarkAccess::getBookmarksCount ( ) const
pure virtual

◆ getBookmarksEnd()

virtual const_iterator_t IDocumentMarkAccess::getBookmarksEnd ( ) const
pure virtual

◆ GetCrossRefHeadingBookmarkNamePrefix()

OUString IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix ( )
static

◆ getDropDownFor()

virtual ::sw::mark::IFieldmark * IDocumentMarkAccess::getDropDownFor ( const SwPosition pos) const
pure virtual

Implemented in sw::mark::MarkManager.

◆ getFieldmarkAfter()

virtual sw::mark::IFieldmark * IDocumentMarkAccess::getFieldmarkAfter ( const SwPosition pos,
bool  bLoop 
) const
pure virtual

◆ getFieldmarkAt()

virtual ::sw::mark::IFieldmark * IDocumentMarkAccess::getFieldmarkAt ( const SwPosition rPos) const
pure virtual

◆ getFieldmarkBefore()

virtual sw::mark::IFieldmark * IDocumentMarkAccess::getFieldmarkBefore ( const SwPosition pos,
bool  bLoop 
) const
pure virtual

◆ getFieldmarksBegin()

virtual const_iterator_t IDocumentMarkAccess::getFieldmarksBegin ( ) const
pure virtual

◆ getFieldmarksCount()

virtual sal_Int32 IDocumentMarkAccess::getFieldmarksCount ( ) const
pure virtual

returns the number of IFieldmarks.

Implemented in sw::mark::MarkManager.

◆ getFieldmarksEnd()

virtual const_iterator_t IDocumentMarkAccess::getFieldmarksEnd ( ) const
pure virtual

◆ getInnerFieldmarkFor()

virtual sw::mark::IFieldmark * IDocumentMarkAccess::getInnerFieldmarkFor ( const SwPosition pos) const
pure virtual

◆ getMarkForTextNode()

virtual ::sw::mark::IMark * IDocumentMarkAccess::getMarkForTextNode ( const SwTextNode rTextNode,
MarkType  eMark 
)
pure virtual

Returns a mark in the document for a paragraph.

If there is none, a mark will be created.

Parameters
rTextNode[in] the paragraph being marked (a selection over the paragraph is marked)
eMark[in] the type of the new mark.
Returns
a pointer to the new mark (name might have changed).

Implemented in sw::mark::MarkManager.

Referenced by SwFieldRefPage::FillItemSet(), SwTOXPara::GetURL(), and SwTOXPara::SwTOXPara().

◆ getNoTextFieldmarksIn()

virtual std::vector<::sw::mark::IFieldmark * > IDocumentMarkAccess::getNoTextFieldmarksIn ( const SwPaM rPaM) const
pure virtual

◆ getOneInnermostBookmarkFor()

virtual sw::mark::IMark * IDocumentMarkAccess::getOneInnermostBookmarkFor ( const SwPosition rPos) const
pure virtual

Get the innermost bookmark that contains rPos.

Implemented in sw::mark::MarkManager.

◆ GetType()

IDocumentMarkAccess::MarkType IDocumentMarkAccess::GetType ( const ::sw::mark::IMark rMark)
static

◆ isBookmarkDeleted()

virtual bool IDocumentMarkAccess::isBookmarkDeleted ( SwPaM const &  rPaM,
bool  isReplace 
) const
pure virtual

check if the selection would delete a BOOKMARK

Implemented in sw::mark::MarkManager.

Referenced by SwPaM::HasReadonlySel().

◆ IsLegalPaMForCrossRefHeadingBookmark()

bool IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark ( const SwPaM rPaM)
static

◆ makeAnnotationBookmark()

virtual ::sw::mark::IMark * IDocumentMarkAccess::makeAnnotationBookmark ( const SwPaM rPaM,
const OUString &  rProposedName,
MarkType  eMark,
::sw::mark::InsertMode  eMode,
SwPosition const *  pSepPos = nullptr 
)
pure virtual

◆ makeAnnotationMark()

virtual sw::mark::IMark * IDocumentMarkAccess::makeAnnotationMark ( const SwPaM rPaM,
const OUString &  rName 
)
pure virtual

◆ makeFieldBookmark()

virtual sw::mark::IFieldmark * IDocumentMarkAccess::makeFieldBookmark ( const SwPaM rPaM,
const OUString &  rName,
const OUString &  rType,
SwPosition const *  pSepPos = nullptr 
)
pure virtual

◆ makeMark()

virtual ::sw::mark::IMark * IDocumentMarkAccess::makeMark ( const SwPaM rPaM,
const OUString &  rProposedName,
MarkType  eMark,
::sw::mark::InsertMode  eMode,
SwPosition const *  pSepPos = nullptr 
)
pure virtual

Generates a new mark in the document for a certain selection.

Parameters
rPaM[in] the selection being marked.
rProposedName[in] the proposed name of the new mark.
eMark[in] the type of the new mark.
eMode[in] is the new mark part of a text copy operation
Returns
a pointer to the new mark (name might have changed).

Referenced by sw::CopyBookmarks(), SwTextShell::ExecField(), sw::DocumentContentOperationsManager::ReplaceRangeImpl(), SwHTMLParser::SetAttr_(), SwFltControlStack::SetAttrInDoc(), SwCursorShell::SetBookmark(), SwCursorShell::SetBookmark2(), SwHistoryBookmark::SetInDoc(), sw::mark::SaveBookmark::SetInDoc(), and SwXTextRange::SetPositions().

◆ makeNoTextFieldBookmark()

virtual sw::mark::IFieldmark * IDocumentMarkAccess::makeNoTextFieldBookmark ( const SwPaM rPaM,
const OUString &  rName,
const OUString &  rType 
)
pure virtual

◆ NotifyCursorUpdate()

virtual void IDocumentMarkAccess::NotifyCursorUpdate ( const SwCursorShell rCursorShell)
pure virtual

Implemented in sw::mark::MarkManager.

Referenced by SwCursorShell::UpdateCursor().

◆ renameMark()

virtual bool IDocumentMarkAccess::renameMark ( ::sw::mark::IMark io_pMark,
const OUString &  rNewName 
)
pure virtual

Renames an existing Mark, if possible.

Parameters
io_pMark[in/out] the mark to be renamed
rNewName[in] new name for the mark
Returns
false, if renaming failed (because the name is already in use)

Implemented in sw::mark::MarkManager.

Referenced by sw::CopyBookmarks(), SwUndoRenameBookmark::Rename(), and SwXBookmark::setName().

◆ repositionMark()

virtual void IDocumentMarkAccess::repositionMark ( ::sw::mark::IMark io_pMark,
const SwPaM rPaM 
)
pure virtual

Moves an existing mark to a new selection and performs needed updates.

Parameters
io_pMark[in/out] the mark to be moved
rPaM[in] new selection to be marked

Implemented in sw::mark::MarkManager.

Referenced by SwDoc::AppendDoc(), and SwHTMLParser::StripTrailingPara().

◆ restoreAnnotationMarks()

virtual void IDocumentMarkAccess::restoreAnnotationMarks ( bool  bDelete = true)
pure virtual

The documentation for this class was generated from the following files: