LibreOffice Module sw (master) 1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
sw::mark::DropDownFieldmark Class Referencefinal

Fieldmark representing a drop-down form field. More...

#include <bookmark.hxx>

Inheritance diagram for sw::mark::DropDownFieldmark:
[legend]
Collaboration diagram for sw::mark::DropDownFieldmark:
[legend]

Public Member Functions

 DropDownFieldmark (const SwPaM &rPaM, const OUString &rName)
 
 ~DropDownFieldmark () override
 
void ShowButton (SwEditWin *pEditWin) override
 
void RemoveButton () override
 
OUString GetContent (sal_Int32 *pIndex) const override
 GetContent. More...
 
OUString GetContent () const override
 
void AddContent (const OUString &rText, sal_Int32 *pIndex=nullptr) override
 AddContent : INSERTS a new choice. More...
 
void DelContent (sal_Int32 nDelIndex=-1) override
 Remove everything if the given index is negative, else remove the given index (if valid). More...
 
void ReplaceContent (const OUString *pText, sal_Int32 *pIndex) override
 ReplaceContent : changes the list result index or renames the existing choices. More...
 
void ReplaceContent (const OUString &sNewContent) override
 
void SetPortionPaintArea (const SwRect &rPortionPaintArea)
 
void SendLOKShowMessage (const SfxViewShell *pViewShell)
 
virtual OUString GetContent (sal_Int32 *pIndex) const =0
 
virtual OUString GetContent () const override=0
 
virtual void AddContent (const OUString &rText, sal_Int32 *pIndex=nullptr)=0
 
virtual void DelContent (sal_Int32 nDelIndex=-1)=0
 
virtual void ReplaceContent (const OUString *pText, sal_Int32 *pIndex)=0
 
virtual void ReplaceContent (const OUString &sNewContent) override=0
 
- Public Member Functions inherited from sw::mark::FieldmarkWithDropDownButton
 FieldmarkWithDropDownButton (const SwPaM &rPaM)
 
 ~FieldmarkWithDropDownButton () override
 
virtual void ShowButton (SwEditWin *pEditWin)=0
 
virtual void RemoveButton ()
 
void LaunchPopup ()
 
- Public Member Functions inherited from sw::mark::NonTextFieldmark
 NonTextFieldmark (const SwPaM &rPaM)
 
void InitDoc (SwDoc &io_rDoc, sw::mark::InsertMode eMode, SwPosition const *pSepPos) override
 
void ReleaseDoc (SwDoc &rDoc) override
 
- Public Member Functions inherited from sw::mark::Fieldmark
 Fieldmark (const SwPaM &rPaM)
 
OUString GetFieldname () const override
 
OUString GetFieldHelptext () const override
 
IFieldmark::parameter_map_t * GetParameters () override
 
const IFieldmark::parameter_map_t * GetParameters () const override
 
void SetFieldname (const OUString &aFieldname) override
 
void SetFieldHelptext (const OUString &aFieldHelptext) override
 
virtual void ReleaseDoc (SwDoc &)=0
 
void SetMarkStartPos (const SwPosition &rNewStartPos)
 
void Invalidate () override
 
OUString ToString () const override
 
void dumpAsXml (xmlTextWriterPtr pWriter) const override
 
- Public Member Functions inherited from sw::mark::MarkBase
SwPositionGetMarkPos () const override
 
const OUString & GetName () const override
 
SwPositionGetOtherMarkPos () const override
 
SwPositionGetMarkStart () const override
 
SwPositionGetMarkEnd () const override
 
bool IsCoveringPosition (const SwPosition &rPos) const override
 
bool IsExpanded () const override
 
void SetName (const OUString &rName)
 
virtual void SetMarkPos (const SwPosition &rNewPos)
 
virtual void SetOtherMarkPos (const SwPosition &rNewPos)
 
virtual void ClearOtherMarkPos ()
 
virtual auto InvalidateFrames () -> void
 
OUString ToString () const override
 
void dumpAsXml (xmlTextWriterPtr pWriter) const override
 
void Swap ()
 
virtual void InitDoc (SwDoc &, sw::mark::InsertMode, SwPosition const *)
 
 ~MarkBase () override
 
const unotools::WeakReference< SwXBookmark > & GetXBookmark () const
 
void SetXBookmark (rtl::Reference< SwXBookmark > const &xBkmk)
 
virtual const SwPositionGetMarkPos () const =0
 
virtual const SwPositionGetOtherMarkPos () const =0
 
virtual const SwPositionGetMarkStart () const =0
 
virtual const SwPositionGetMarkEnd () const =0
 
virtual const OUString & GetName () const =0
 
virtual bool IsExpanded () const =0
 
virtual bool IsCoveringPosition (const SwPosition &rPos) const =0
 
virtual OUString ToString () const =0
 
virtual void dumpAsXml (xmlTextWriterPtr pWriter) const =0
 

Static Public Member Functions

static void SendLOKHideMessage (const SfxViewShell *pViewShell)
 

Private Attributes

SwRect m_aPortionPaintArea
 

Additional Inherited Members

- Protected Member Functions inherited from sw::mark::IDropdownFieldmark
 IDropdownFieldmark ()=default
 
- Protected Member Functions inherited from sw::mark::MarkBase
void SwClientNotify (const SwModify &, const SfxHint &) override
 
 MarkBase (const SwPaM &rPaM, OUString aName)
 
- Protected Member Functions inherited from sw::mark::IMark
 IMark ()=default
 
- Static Protected Member Functions inherited from sw::mark::MarkBase
static OUString GenerateNewName (std::u16string_view rPrefix)
 
- Protected Attributes inherited from sw::mark::FieldmarkWithDropDownButton
VclPtr< FormFieldButtonm_pButton
 
- Protected Attributes inherited from sw::mark::MarkBase
std::optional< SwPositionm_oPos1
 
std::optional< SwPositionm_oPos2
 
OUString m_aName
 
unotools::WeakReference< SwXBookmarkm_wXBookmark
 

Detailed Description

Fieldmark representing a drop-down form field.

Definition at line 294 of file core/inc/bookmark.hxx.

Constructor & Destructor Documentation

◆ DropDownFieldmark()

sw::mark::DropDownFieldmark::DropDownFieldmark ( const SwPaM rPaM,
const OUString &  rName 
)

Definition at line 771 of file core/crsr/bookmark.cxx.

References sw::mark::MarkBase::m_aName.

◆ ~DropDownFieldmark()

sw::mark::DropDownFieldmark::~DropDownFieldmark ( )
override

Definition at line 778 of file core/crsr/bookmark.cxx.

Member Function Documentation

◆ AddContent()

void sw::mark::DropDownFieldmark::AddContent ( const OUString &  rText,
sal_Int32 *  pIndex = nullptr 
)
overridevirtual

AddContent : INSERTS a new choice.

Parameters
rTextThe choice to add to the list choices.
pIndex[optional] [in] If pIndex is null or invalid, append to the end of the list. [out] Modified to point to the position of the choice if it already exists.

Implements sw::mark::IDropdownFieldmark.

Definition at line 840 of file core/crsr/bookmark.cxx.

References aSeq, comphelper::containerToSequence(), comphelper::findValue(), sw::mark::Fieldmark::GetParameters(), sw::mark::Fieldmark::Invalidate(), min(), ODF_FORMDROPDOWN_LISTENTRY, and ODF_FORMDROPDOWN_RESULT.

◆ DelContent()

void sw::mark::DropDownFieldmark::DelContent ( sal_Int32  nDelIndex = -1)
overridevirtual

Remove everything if the given index is negative, else remove the given index (if valid).

If deleting the currently selected choice, reset the selection to the first choice.

Implements sw::mark::IDropdownFieldmark.

Definition at line 943 of file core/crsr/bookmark.cxx.

References aSeq, sw::mark::Fieldmark::GetParameters(), sw::mark::Fieldmark::Invalidate(), ODF_FORMDROPDOWN_LISTENTRY, ODF_FORMDROPDOWN_RESULT, and comphelper::removeElementAt().

◆ GetContent() [1/2]

OUString sw::mark::DropDownFieldmark::GetContent ( ) const
overridevirtual

Implements sw::mark::IDropdownFieldmark.

Definition at line 828 of file core/crsr/bookmark.cxx.

References GetContent().

Referenced by GetContent().

◆ GetContent() [2/2]

OUString sw::mark::DropDownFieldmark::GetContent ( sal_Int32 *  pIndex) const
overridevirtual

GetContent.

Parameters
pIndexThe zero-based index to retrieve [in] if pIndex is null or negative, return the listbox's chosen result, else return the indicated entry (or last entry for invalid choice). [out] the index of the returned result or -1 if error

Implements sw::mark::IDropdownFieldmark.

Definition at line 804 of file core/crsr/bookmark.cxx.

References aSeq, sw::mark::Fieldmark::GetParameters(), min(), nIndex, ODF_FORMDROPDOWN_LISTENTRY, and ODF_FORMDROPDOWN_RESULT.

◆ RemoveButton()

void sw::mark::DropDownFieldmark::RemoveButton ( )
overridevirtual

◆ ReplaceContent() [1/2]

void sw::mark::DropDownFieldmark::ReplaceContent ( const OUString &  sNewContent)
overridevirtual

Implements sw::mark::IDropdownFieldmark.

Definition at line 934 of file core/crsr/bookmark.cxx.

References ReplaceContent().

◆ ReplaceContent() [2/2]

void sw::mark::DropDownFieldmark::ReplaceContent ( const OUString *  pText,
sal_Int32 *  pIndex 
)
overridevirtual

ReplaceContent : changes the list result index or renames the existing choices.

Parameters
pText[in] If pIndex is null, change the list result index to this provided choice (but do nothing if pText is an invalid choice) else rename that entry.
pIndex[in] If pText is null, change the list result index to this provided Index (or the last position if it is an invalid choice) else rename this entry (doing nothing for invalid indexes). [out] If pIndex is invalid, it is modified to use the last position.

This function allows duplicate entries - which is also allowed in MS Word.

Implements sw::mark::IDropdownFieldmark.

Definition at line 893 of file core/crsr/bookmark.cxx.

References aSeq, comphelper::containerToSequence(), comphelper::findValue(), sw::mark::Fieldmark::GetParameters(), sw::mark::Fieldmark::Invalidate(), ODF_FORMDROPDOWN_LISTENTRY, and ODF_FORMDROPDOWN_RESULT.

Referenced by ReplaceContent().

◆ SendLOKHideMessage()

void sw::mark::DropDownFieldmark::SendLOKHideMessage ( const SfxViewShell pViewShell)
static

◆ SendLOKShowMessage()

void sw::mark::DropDownFieldmark::SendLOKShowMessage ( const SfxViewShell pViewShell)

◆ SetPortionPaintArea()

void sw::mark::DropDownFieldmark::SetPortionPaintArea ( const SwRect rPortionPaintArea)

◆ ShowButton()

void sw::mark::DropDownFieldmark::ShowButton ( SwEditWin pEditWin)
overridevirtual

Member Data Documentation

◆ m_aPortionPaintArea

SwRect sw::mark::DropDownFieldmark::m_aPortionPaintArea
private

Definition at line 318 of file core/inc/bookmark.hxx.

Referenced by SendLOKShowMessage(), SetPortionPaintArea(), and ShowButton().


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