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
 
virtual OUString GetFieldname () const =0
 
virtual OUString GetFieldHelptext () const =0
 
virtual parameter_map_tGetParameters ()=0
 
virtual const parameter_map_tGetParameters () const =0
 
virtual void SetFieldname (const OUString &rFieldname)=0
 
virtual void SetFieldHelptext (const OUString &rFieldHelptext)=0
 
virtual void Invalidate ()=0
 
virtual OUString GetContent () const
 
virtual void ReplaceContent (const OUString &)
 
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
 
- Public Member Functions inherited from sw::BroadcastingModify
virtual void CallSwClientNotify (const SfxHint &rHint) const override
 
- Public Member Functions inherited from SwModify
 SwModify ()
 
virtual void CallSwClientNotify (const SfxHint &rHint) const
 
virtual ~SwModify () override
 
void Add (SwClient *pDepend)
 
SwClientRemove (SwClient *pDepend)
 
bool HasWriterListeners () const
 
bool HasOnlyOneListener () const
 
virtual bool GetInfo (SfxPoolItem &) const override
 
void LockModify ()
 
void UnlockModify ()
 
bool IsModifyLocked () const
 
- Public Member Functions inherited from SwClient
 SwClient ()
 
 SwClient (SwClient &&) noexcept
 
virtual ~SwClient () override
 
std::optional< sw::ModifyChangedHintCheckRegistration (const SfxPoolItem *pOldValue)
 
void CheckRegistrationFormat (SwFormat &rOld)
 
const SwModifyGetRegisteredIn () const
 
SwModifyGetRegisteredIn ()
 
void EndListeningAll ()
 
void StartListeningToSameModifyAs (const SwClient &)
 
virtual bool GetInfo (SfxPoolItem &) const
 
- Public Member Functions inherited from sw::WriterListener
bool IsLast () const
 
virtual const SwCellFrameDynCastCellFrame () const
 
virtual const SwTabFrameDynCastTabFrame () const
 
virtual const SwRowFrameDynCastRowFrame () const
 
virtual const SwTableDynCastTable () const
 
- Public Member Functions inherited from sw::BroadcasterMixin
 BroadcasterMixin ()=default
 
 BroadcasterMixin (BroadcasterMixin const &)=default
 
BroadcasterMixinoperator= (const BroadcasterMixin &)
 
SvtBroadcasterGetNotifier ()
 
- 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_tGetParameters () override
 
const IFieldmark::parameter_map_tGetParameters () 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)
 

Static Public Member Functions

static void SendLOKHideMessage (const SfxViewShell *pViewShell)
 

Private Attributes

SwRect m_aPortionPaintArea
 

Additional Inherited Members

- Public Types inherited from sw::mark::IFieldmark
typedef std::map< OUString, css::uno::Any > parameter_map_t
 
- Protected Member Functions inherited from sw::mark::IDropdownFieldmark
 IDropdownFieldmark ()=default
 
- Protected Member Functions inherited from sw::mark::IFieldmark
 IFieldmark ()=default
 
- Protected Member Functions inherited from sw::mark::IMark
 IMark ()=default
 
virtual void SwClientNotify (const SwModify &, const SfxHint &rHint) override
 
- Protected Member Functions inherited from SwClient
 SwClient (SwModify *pToRegisterIn)
 
SwModifyGetRegisteredInNonConst () const
 
virtual void SwClientNotify (const SwModify &, const SfxHint &rHint) override
 
- Protected Member Functions inherited from sw::WriterListener
 WriterListener ()
 
virtual ~WriterListener () COVERITY_NOEXCEPT_FALSE
 
virtual void SwClientNotify (const SwModify &, const SfxHint &rHint)=0
 
- Protected Member Functions inherited from sw::mark::MarkBase
void SwClientNotify (const SwModify &, const SfxHint &) override
 
 MarkBase (const SwPaM &rPaM, OUString aName)
 
- 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 292 of file core/inc/bookmark.hxx.

Constructor & Destructor Documentation

◆ DropDownFieldmark()

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

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

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

◆ ~DropDownFieldmark()

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

Definition at line 733 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 795 of file core/crsr/bookmark.cxx.

References aSeq, comphelper::containerToSequence(), comphelper::findValue(), sw::mark::IFieldmark::GetParameters(), sw::mark::IFieldmark::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 897 of file core/crsr/bookmark.cxx.

References aSeq, sw::mark::IFieldmark::GetParameters(), sw::mark::IFieldmark::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 783 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 759 of file core/crsr/bookmark.cxx.

References aSeq, sw::mark::IFieldmark::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 888 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 847 of file core/crsr/bookmark.cxx.

References aSeq, comphelper::containerToSequence(), comphelper::findValue(), sw::mark::IFieldmark::GetParameters(), sw::mark::IFieldmark::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 316 of file core/inc/bookmark.hxx.

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


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