LibreOffice Module sw (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SwDropDownField Class Reference

Dropdown field. More...

#include <flddropdown.hxx>

Inheritance diagram for SwDropDownField:
[legend]
Collaboration diagram for SwDropDownField:
[legend]

Public Member Functions

 SwDropDownField (SwFieldType *pTyp)
 Constructor. More...
 
 SwDropDownField (const SwDropDownField &rSrc)
 Copy constructor. More...
 
virtual ~SwDropDownField () override
 Destructor. More...
 
virtual OUString GetPar1 () const override
 Returns the selected value. More...
 
virtual OUString GetPar2 () const override
 Returns the name of the field. More...
 
virtual void SetPar1 (const OUString &rStr) override
 Sets the selected value. More...
 
virtual void SetPar2 (const OUString &rStr) override
 Sets the name of the field. More...
 
void SetItems (const std::vector< OUString > &rItems)
 Sets the items of the dropdown box. More...
 
void SetItems (const css::uno::Sequence< OUString > &rItems)
 Sets the items of the dropdown box. More...
 
css::uno::Sequence< OUString > GetItemSequence () const
 Returns the items of the dropdown box. More...
 
const OUString & GetSelectedItem () const
 Returns the selected item. More...
 
const OUString & GetName () const
 Returns the name of the field. More...
 
const OUString & GetHelp () const
 Returns the help text of the field. More...
 
const OUString & GetToolTip () const
 Returns the tool tip of the field. More...
 
void SetSelectedItem (const OUString &rItem)
 Sets the selected item. More...
 
void SetName (const OUString &rName)
 Sets the name of the field. More...
 
void SetHelp (const OUString &rHelp)
 Sets the help text of the field. More...
 
void SetToolTip (const OUString &rToolTip)
 Sets the tool tip of the field. More...
 
virtual bool QueryValue (css::uno::Any &rVal, sal_uInt16 nWhichId) const override
 API: Gets a property value from the dropdown field. More...
 
virtual bool PutValue (const css::uno::Any &rVal, sal_uInt16 nWhichId) override
 API: Sets a property value on the dropdown field. More...
 
- Public Member Functions inherited from SwField
virtual ~SwField ()
 
 SwField (SwField const &)=default
 
 SwField (SwField &&)=default
 
SwFieldoperator= (SwField const &)=default
 
SwFieldoperator= (SwField &&)=default
 
SwFieldTypeGetTyp () const
 
virtual SwFieldTypeChgTyp (SwFieldType *)
 Set new type (used for copying among documents). More...
 
OUString ExpandField (bool bCached, SwRootFrame const *pLayout) const
 expand the field. More...
 
virtual OUString GetFieldName () const
 get name or content More...
 
std::unique_ptr< SwFieldCopyField () const
 
SwFieldIds Which () const
 ResId. More...
 
sal_uInt16 GetTypeId () const
 
virtual sal_uInt16 GetSubType () const
 
virtual void SetSubType (sal_uInt16)
 
LanguageType GetLanguage () const
 Language at field position. More...
 
virtual void SetLanguage (LanguageType nLng)
 
sal_uInt32 GetFormat () const
 Query parameters for dialog and for BASIC. More...
 
virtual OUString GetFormula () const
 
void ChangeFormat (sal_uInt32 n)
 
bool HasClickHdl () const
 Does the field possess an action on its ClickHandler? (e.g. INetFields, ...). More...
 
bool IsFixed () const
 
bool IsAutomaticLanguage () const
 
void SetAutomaticLanguage (bool const bSet)
 
virtual OUString GetDescription () const
 
bool IsClickable () const
 Is this field clickable? More...
 
virtual void dumpAsXml (xmlTextWriterPtr pWriter) const
 

Private Member Functions

virtual OUString ExpandImpl (SwRootFrame const *pLayout) const override
 Expands the field. More...
 
virtual std::unique_ptr< SwFieldCopy () const override
 Creates a copy of this field. More...
 

Private Attributes

std::vector< OUString > aValues
 the possible values (aka items) of the dropdown box More...
 
OUString aSelectedItem
 the selected item More...
 
OUString aName
 the name of the field More...
 
OUString aHelp
 help text More...
 
OUString aToolTip
 tool tip string More...
 

Additional Inherited Members

- Protected Member Functions inherited from SwField
void SetFormat (sal_uInt32 const nSet)
 
 SwField (SwFieldType *pTyp, sal_uInt32 nFormat=0, LanguageType nLang=LANGUAGE_SYSTEM, bool m_bUseFieldValueCache=true)
 

Detailed Description

Dropdown field.

The dropdown field contains a list of strings. At most one of them can be selected.

Definition at line 58 of file flddropdown.hxx.

Constructor & Destructor Documentation

SwDropDownField::SwDropDownField ( SwFieldType pTyp)

Constructor.

Parameters
pTypfield type for this field

Definition at line 48 of file flddropdown.cxx.

References LANGUAGE_SYSTEM.

SwDropDownField::SwDropDownField ( const SwDropDownField rSrc)

Copy constructor.

Parameters
rSrcdropdown field to copy

Definition at line 53 of file flddropdown.cxx.

References aName.

SwDropDownField::~SwDropDownField ( )
overridevirtual

Destructor.

Definition at line 60 of file flddropdown.cxx.

Member Function Documentation

std::unique_ptr< SwField > SwDropDownField::Copy ( ) const
overrideprivatevirtual

Creates a copy of this field.

Returns
the copy of this field

Implements SwField.

Definition at line 79 of file flddropdown.cxx.

OUString SwDropDownField::ExpandImpl ( SwRootFrame const *  pLayout) const
overrideprivatevirtual

Expands the field.

The expanded value of the field is the value of the selected item. If no item is selected, an empty string is returned.

Returns
the expanded value of the field

Implements SwField.

Definition at line 64 of file flddropdown.cxx.

References aValues, and GetSelectedItem().

const OUString& SwDropDownField::GetHelp ( ) const
inline

Returns the help text of the field.

Returns
the help text of the field

Definition at line 198 of file flddropdown.hxx.

Referenced by WW8AttributeOutput::DropdownField(), and DocxAttributeOutput::StartField_Impl().

uno::Sequence< OUString > SwDropDownField::GetItemSequence ( ) const

Returns the items of the dropdown box.

Returns
the items of the dropdown box

Definition at line 119 of file flddropdown.cxx.

References aValues, and comphelper::containerToSequence().

Referenced by WW8AttributeOutput::DropdownField(), sw::DropDownFieldDialog::DropDownFieldDialog(), IMPL_LINK_NOARG(), QueryValue(), and DocxAttributeOutput::StartField_Impl().

const OUString& SwDropDownField::GetName ( ) const
inline

Returns the name of the field.

Returns
the name of the field

Definition at line 191 of file flddropdown.hxx.

Referenced by WW8AttributeOutput::DropdownField(), GetPar2(), DocxAttributeOutput::StartField_Impl(), and DocxAttributeOutput::WriteField_Impl().

OUString SwDropDownField::GetPar1 ( ) const
overridevirtual

Returns the selected value.

See also
Expand
Returns
the selected value

Reimplemented from SwField.

Definition at line 84 of file flddropdown.cxx.

References GetSelectedItem().

OUString SwDropDownField::GetPar2 ( ) const
overridevirtual

Returns the name of the field.

Returns
the name of the field

Reimplemented from SwField.

Definition at line 89 of file flddropdown.cxx.

References GetName().

Referenced by sw::DropDownFieldDialog::DropDownFieldDialog(), and IMPL_LINK_NOARG().

const OUString& SwDropDownField::GetSelectedItem ( ) const
inline
const OUString& SwDropDownField::GetToolTip ( ) const
inline

Returns the tool tip of the field.

Returns
the tool tip of the field

Definition at line 205 of file flddropdown.hxx.

Referenced by WW8AttributeOutput::DropdownField(), and DocxAttributeOutput::StartField_Impl().

bool SwDropDownField::PutValue ( const css::uno::Any &  rVal,
sal_uInt16  nWhichId 
)
overridevirtual

API: Sets a property value on the dropdown field.

Parameters
rValvalue to set
nMId
  • FIELD_PROP_PAR1 Set selected item (String)
  • FIELD_PROP_STRINGS Set all items (Sequence)
  • FIELD_PROP_PAR3 Set the help text of the field.
  • FIELD_PROP_PAR4 Set the tool tip of the field.

Reimplemented from SwField.

Definition at line 178 of file flddropdown.cxx.

References aHelp, aName, aToolTip, FIELD_PROP_PAR1, FIELD_PROP_PAR2, FIELD_PROP_PAR3, FIELD_PROP_PAR4, FIELD_PROP_STRINGS, SetItems(), and SetSelectedItem().

bool SwDropDownField::QueryValue ( css::uno::Any &  rVal,
sal_uInt16  nWhichId 
) const
overridevirtual

API: Gets a property value from the dropdown field.

Parameters
rValreturn value
nMId
  • FIELD_PROP_PAR1 Get selected item (String)
  • FIELD_PROP_STRINGS Get all items (Sequence)
  • FIELD_PROP_PAR3 Get the help text of the field.
  • FIELD_PROP_PAR4 Get the tool tip of the field.

Reimplemented from SwField.

Definition at line 151 of file flddropdown.cxx.

References aHelp, aName, aSelectedItem, aToolTip, CONVERT_TWIPS, FIELD_PROP_PAR1, FIELD_PROP_PAR2, FIELD_PROP_PAR3, FIELD_PROP_PAR4, FIELD_PROP_STRINGS, and GetItemSequence().

void SwDropDownField::SetHelp ( const OUString &  rHelp)

Sets the help text of the field.

Parameters
rHelpthe help text

Definition at line 141 of file flddropdown.cxx.

References aHelp.

Referenced by SwXTextField::attach(), and SwWW8ImplReader::Read_F_FormListBox().

void SwDropDownField::SetItems ( const std::vector< OUString > &  rItems)

Sets the items of the dropdown box.

After setting the items the selection will be empty.

Parameters
rItemsthe new items

Definition at line 104 of file flddropdown.cxx.

References aSelectedItem, and aValues.

Referenced by SwXTextField::attach(), PutValue(), and SwWW8ImplReader::Read_F_FormListBox().

void SwDropDownField::SetItems ( const css::uno::Sequence< OUString > &  rItems)

Sets the items of the dropdown box.

After setting the items the selection will be empty.

Parameters
rItemsthe new items
void SwDropDownField::SetName ( const OUString &  rName)

Sets the name of the field.

Parameters
rNamethe new name of the field

Definition at line 136 of file flddropdown.cxx.

References aName.

Referenced by SwXTextField::attach(), SwWW8ImplReader::Read_F_FormListBox(), and SetPar2().

void SwDropDownField::SetPar1 ( const OUString &  rStr)
overridevirtual

Sets the selected value.

If rStr is an item of the field that item will be selected. Otherwise no item will be selected, i.e. the resulting selection will be empty.

Reimplemented from SwField.

Definition at line 94 of file flddropdown.cxx.

References SetSelectedItem().

void SwDropDownField::SetPar2 ( const OUString &  rStr)
overridevirtual

Sets the name of the field.

Parameters
rStrthe new name of the field

Reimplemented from SwField.

Definition at line 99 of file flddropdown.cxx.

References SetName().

void SwDropDownField::SetSelectedItem ( const OUString &  rItem)

Sets the selected item.

If rItem is found in this dropdown field it is selected. If rItem is not found the selection will be empty.

Parameters
rItemthe item to be set

Definition at line 125 of file flddropdown.cxx.

References aSelectedItem, and aValues.

Referenced by SwXTextField::attach(), PutValue(), SwWW8ImplReader::Read_F_FormListBox(), and SetPar1().

void SwDropDownField::SetToolTip ( const OUString &  rToolTip)

Sets the tool tip of the field.

Parameters
rToolTipthe tool tip

Definition at line 146 of file flddropdown.cxx.

References aToolTip.

Referenced by SwXTextField::attach(), and SwWW8ImplReader::Read_F_FormListBox().

Member Data Documentation

OUString SwDropDownField::aHelp
private

help text

Definition at line 78 of file flddropdown.hxx.

Referenced by PutValue(), QueryValue(), and SetHelp().

OUString SwDropDownField::aName
private

the name of the field

Definition at line 73 of file flddropdown.hxx.

Referenced by PutValue(), QueryValue(), and SetName().

OUString SwDropDownField::aSelectedItem
private

the selected item

Definition at line 68 of file flddropdown.hxx.

Referenced by QueryValue(), SetItems(), and SetSelectedItem().

OUString SwDropDownField::aToolTip
private

tool tip string

Definition at line 83 of file flddropdown.hxx.

Referenced by PutValue(), QueryValue(), and SetToolTip().

std::vector<OUString> SwDropDownField::aValues
private

the possible values (aka items) of the dropdown box

Definition at line 63 of file flddropdown.hxx.

Referenced by ExpandImpl(), GetItemSequence(), SetItems(), and SetSelectedItem().


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