LibreOffice Module sw (master) 1
|
Dropdown field. More...
#include <flddropdown.hxx>
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 (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 | |
SwField & | operator= (SwField const &)=default |
SwField & | operator= (SwField &&)=default |
SwFieldType * | GetTyp () const |
virtual SwFieldType * | ChgTyp (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< SwField > | CopyField () const |
SwFieldIds | Which () const |
ResId. More... | |
SwFieldTypesEnum | 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 | GetPar1 () const |
virtual OUString | GetPar2 () const |
virtual OUString | GetFormula () const |
void | ChangeFormat (sal_uInt32 n) |
virtual void | SetPar1 (const OUString &rStr) |
virtual void | SetPar2 (const OUString &rStr) |
virtual bool | QueryValue (css::uno::Any &rVal, sal_uInt16 nWhichId) const |
virtual bool | PutValue (const css::uno::Any &rVal, sal_uInt16 nWhichId) |
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 |
const OUString & | GetTitle () const |
void | SetTitle (const OUString &rTitle) |
Private Member Functions | |
virtual OUString | ExpandImpl (SwRootFrame const *pLayout) const override |
Expands the field. More... | |
virtual std::unique_ptr< SwField > | Copy () const override |
Creates a copy of this field. More... | |
Private Attributes | |
std::vector< OUString > | m_aValues |
the possible values (aka items) of the dropdown box More... | |
OUString | m_aSelectedItem |
the selected item More... | |
OUString | m_aName |
the name of the field More... | |
OUString | m_aHelp |
help text More... | |
OUString | m_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) | |
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.
SwDropDownField::SwDropDownField | ( | SwFieldType * | pTyp | ) |
Constructor.
pTyp | field type for this field |
Definition at line 47 of file flddropdown.cxx.
References LANGUAGE_SYSTEM.
SwDropDownField::SwDropDownField | ( | const SwDropDownField & | rSrc | ) |
Copy constructor.
rSrc | dropdown field to copy |
Definition at line 52 of file flddropdown.cxx.
References GetFormat(), m_aName, and m_aValues.
|
overridevirtual |
Destructor.
Definition at line 59 of file flddropdown.cxx.
|
overrideprivatevirtual |
Creates a copy of this field.
Implements SwField.
Definition at line 78 of file flddropdown.cxx.
|
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.
Implements SwField.
Definition at line 63 of file flddropdown.cxx.
References GetSelectedItem(), and m_aValues.
|
inline |
Returns the help text of the field.
Definition at line 198 of file flddropdown.hxx.
Referenced by WW8AttributeOutput::DropdownField().
uno::Sequence< OUString > SwDropDownField::GetItemSequence | ( | ) | const |
Returns the items of the dropdown box.
Definition at line 118 of file flddropdown.cxx.
References comphelper::containerToSequence(), and m_aValues.
Referenced by WW8AttributeOutput::DropdownField(), sw::DropDownFieldDialog::DropDownFieldDialog(), DocxAttributeOutput::EndField_Impl(), IMPL_LINK_NOARG(), QueryValue(), and DocxAttributeOutput::StartField_Impl().
|
inline |
Returns the name of the field.
Definition at line 191 of file flddropdown.hxx.
References m_aName.
Referenced by WW8AttributeOutput::DropdownField(), GetPar2(), DocxAttributeOutput::StartField_Impl(), and DocxAttributeOutput::WriteField_Impl().
|
overridevirtual |
Returns the selected value.
Reimplemented from SwField.
Definition at line 83 of file flddropdown.cxx.
References GetSelectedItem().
|
overridevirtual |
Returns the name of the field.
Reimplemented from SwField.
Definition at line 88 of file flddropdown.cxx.
References GetName().
Referenced by sw::DropDownFieldDialog::DropDownFieldDialog(), and IMPL_LINK_NOARG().
|
inline |
Returns the selected item.
Definition at line 184 of file flddropdown.hxx.
Referenced by WW8AttributeOutput::DropdownField(), sw::DropDownFieldDialog::DropDownFieldDialog(), DocxAttributeOutput::EndField_Impl(), ExpandImpl(), GetPar1(), IMPL_LINK_NOARG(), and DocxAttributeOutput::StartField_Impl().
|
inline |
Returns the tool tip of the field.
Definition at line 205 of file flddropdown.hxx.
Referenced by WW8AttributeOutput::DropdownField().
|
overridevirtual |
API: Sets a property value on the dropdown field.
rVal | value to set |
nMId |
|
Reimplemented from SwField.
Definition at line 177 of file flddropdown.cxx.
References aSeq, FIELD_PROP_PAR1, FIELD_PROP_PAR2, FIELD_PROP_PAR3, FIELD_PROP_PAR4, FIELD_PROP_STRINGS, m_aHelp, m_aName, m_aToolTip, SetItems(), and SetSelectedItem().
|
overridevirtual |
API: Gets a property value from the dropdown field.
rVal | return value |
nMId |
|
Reimplemented from SwField.
Definition at line 150 of file flddropdown.cxx.
References FIELD_PROP_PAR1, FIELD_PROP_PAR2, FIELD_PROP_PAR3, FIELD_PROP_PAR4, FIELD_PROP_STRINGS, GetItemSequence(), m_aHelp, m_aName, m_aSelectedItem, and m_aToolTip.
void SwDropDownField::SetHelp | ( | const OUString & | rHelp | ) |
Sets the help text of the field.
rHelp | the help text |
Definition at line 140 of file flddropdown.cxx.
References m_aHelp.
Referenced by SwXTextField::attach(), 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.
rItems | the new items |
void SwDropDownField::SetItems | ( | std::vector< OUString > && | rItems | ) |
Sets the items of the dropdown box.
After setting the items the selection will be empty.
rItems | the new items |
Referenced by SwXTextField::attach(), PutValue(), and SwWW8ImplReader::Read_F_FormListBox().
void SwDropDownField::SetName | ( | const OUString & | rName | ) |
Sets the name of the field.
rName | the new name of the field |
Definition at line 135 of file flddropdown.cxx.
References m_aName.
Referenced by SwXTextField::attach(), SwWW8ImplReader::Read_F_FormListBox(), and SetPar2().
|
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 93 of file flddropdown.cxx.
References SetSelectedItem().
|
overridevirtual |
Sets the name of the field.
rStr | the new name of the field |
Reimplemented from SwField.
Definition at line 98 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.
rItem | the item to be set |
Definition at line 124 of file flddropdown.cxx.
References m_aSelectedItem, and m_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.
rToolTip | the tool tip |
Definition at line 145 of file flddropdown.cxx.
References m_aToolTip.
Referenced by SwXTextField::attach(), and SwWW8ImplReader::Read_F_FormListBox().
|
private |
help text
Definition at line 78 of file flddropdown.hxx.
Referenced by PutValue(), QueryValue(), and SetHelp().
|
private |
the name of the field
Definition at line 73 of file flddropdown.hxx.
Referenced by PutValue(), QueryValue(), and SetName().
|
private |
the selected item
Definition at line 68 of file flddropdown.hxx.
Referenced by QueryValue(), and SetSelectedItem().
|
private |
tool tip string
Definition at line 83 of file flddropdown.hxx.
Referenced by PutValue(), QueryValue(), and SetToolTip().
|
private |
the possible values (aka items) of the dropdown box
Definition at line 63 of file flddropdown.hxx.
Referenced by ExpandImpl(), GetItemSequence(), and SetSelectedItem().