LibreOffice Module xmloff (master)  1
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
xmloff::OListAndComboImport Class Reference

A specialized version of the <type>OControlImport</type> class, which handles attributes / sub elements which are special to list and combo boxes. More...

#include <elementimport.hxx>

Inheritance diagram for xmloff::OListAndComboImport:
[legend]
Collaboration diagram for xmloff::OListAndComboImport:
[legend]

Public Member Functions

 OListAndComboImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, sal_uInt16 _nPrefix, const OUString &_rName, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
 <TRUE> if and only if we should use a cell value binding which exchanges the selection index (instead of the selection text More...
 
virtual void StartElement (const css::uno::Reference< css::xml::sax::XAttributeList > &_rxAttrList) override
 StartElement is called after a context has been constructed and before an elements context is parsed. More...
 
virtual SvXMLImportContextRef CreateChildContext (sal_uInt16 _nPrefix, const OUString &_rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &_rxAttrList) override
 Create a children element context. More...
 
virtual void EndElement () override
 EndElement is called before a context will be destructed, but after an elements context has been parsed. More...
 
virtual bool handleAttribute (sal_uInt16 _nNamespaceKey, const OUString &_rLocalName, const OUString &_rValue) override
 handle one single attribute. More...
 
virtual void doRegisterCellValueBinding (const OUString &_rBoundCellAddress) override
 registers the given cell address as value binding address for our element More...
 
- Public Member Functions inherited from xmloff::OControlImport
 OControlImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, sal_uInt16 _nPrefix, const OUString &_rName, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
 
void addOuterAttributes (const css::uno::Reference< css::xml::sax::XAttributeList > &_rxOuterAttribs)
 
- Public Member Functions inherited from xmloff::OElementImport
 OElementImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, sal_uInt16 _nPrefix, const OUString &_rName, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
 ctor More...
 
virtual ~OElementImport () override
 
- Public Member Functions inherited from xmloff::OPropertyImport
 OPropertyImport (OFormLayerXMLImport_Impl &_rImport, sal_uInt16 _nPrefix, const OUString &_rName)
 
virtual void Characters (const OUString &_rChars) override
 This method is called for all characters that are contained in the current element. More...
 
- Public Member Functions inherited from SvXMLImportContext
bool IsPrefixFilledIn () const
 
sal_uInt16 GetPrefix () const
 
const OUString & GetLocalName () const
 
 SvXMLImportContext (SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName)
 A contexts constructor does anything that is required if an element starts. More...
 
 SvXMLImportContext (SvXMLImport &rImport)
 
virtual ~SvXMLImportContext ()
 A contexts destructor does anything that is required if an element ends. More...
 
virtual void SAL_CALL startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL startUnknownElement (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL endFastElement (sal_Int32 Element) override
 
virtual void SAL_CALL endUnknownElement (const OUString &Namespace, const OUString &Name) override
 
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL characters (const OUString &aChars) override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &aType) final override
 
virtual void SAL_CALL acquire () final override throw ()
 
virtual void SAL_CALL release () final override throw ()
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () final override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () final override
 

Protected Member Functions

void implPushBackLabel (const OUString &_rLabel)
 
void implPushBackValue (const OUString &_rValue)
 
void implEmptyLabelFound ()
 
void implEmptyValueFound ()
 
void implSelectCurrentItem ()
 
void implDefaultSelectCurrentItem ()
 
- Protected Member Functions inherited from xmloff::OControlImport
 OControlImport (OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, sal_uInt16 _nPrefix, const OUString &_rName, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
 
void setElementType (OControlElement::ElementType _eType)
 
virtual OUString determineDefaultServiceName () const override
 
void doRegisterXFormsValueBinding (const OUString &)
 register the given XForms binding More...
 
void doRegisterXFormsListBinding (const OUString &)
 register the given XForms list binding More...
 
void doRegisterXFormsSubmission (const OUString &)
 register the given XForms submission More...
 
virtual css::uno::Reference< css::beans::XPropertySetcreateElement () override
 create the (uninitialized) element which is to represent the read data More...
 
- Protected Member Functions inherited from xmloff::OElementImport
virtual void registerEvents (const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents) override
 
void simulateDefaultedAttribute (const char *_pAttributeName, const OUString &_rPropertyName, const char *_pAttributeDefault)
 can be used to handle properties where the attribute default and the property default differ. More...
 
bool tryGenericAttribute (sal_uInt16 _nNamespaceKey, const OUString &_rLocalName, const OUString &_rValue)
 to be called from within handleAttribute, checks whether the given attribute is covered by our generic attribute handler mechanisms More...
 
void disableImplicitGenericAttributeHandling ()
 controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class must do this explicitly at a suitable place in its own |handleAttribute| More...
 
- Protected Member Functions inherited from xmloff::OPropertyImport
bool encounteredAttribute (const OUString &_rAttributeName) const
 determine if the element imported by the object had a given attribute. More...
 
void enableTrackAttributes ()
 enables the tracking of the encountered attributes More...
 
void implPushBackPropertyValue (const css::beans::PropertyValue &_rProp)
 
void implPushBackPropertyValue (const OUString &_rName, const css::uno::Any &_rValue)
 
void implPushBackGenericPropertyValue (const css::beans::PropertyValue &_rProp)
 
- Protected Member Functions inherited from SvXMLImportContext
SvXMLImportGetImport ()
 
const SvXMLImportGetImport () const
 
- Protected Member Functions inherited from xmloff::IEventAttacher
 ~IEventAttacher ()
 

Protected Attributes

std::vector< OUString > m_aListSource
 
std::vector< OUString > m_aValueList
 
std::vector< sal_Int16 > m_aSelectedSeq
 
std::vector< sal_Int16 > m_aDefaultSelectedSeq
 
OUString m_sCellListSource
 
sal_Int32 m_nEmptyListItems
 the cell range which acts as list source for the control More...
 
sal_Int32 m_nEmptyValueItems
 number of empty list items encountered during reading More...
 
bool m_bEncounteredLSAttrib
 number of empty value items encountered during reading More...
 
bool m_bLinkWithIndexes
 
- Protected Attributes inherited from xmloff::OControlImport
OUString m_sControlId
 
OControlElement::ElementType m_eElementType
 
PropertyValueArray m_aValueProperties
 
css::uno::Reference< css::xml::sax::XAttributeList > m_xOuterAttributes
 
OUString m_sBoundCellAddress
 the address of the calc cell which the control model should be bound to, if applicable More...
 
OUString m_sBindingID
 name of a value binding (xforms:bind attribute) More...
 
OUString m_sListBindingID
 name of a list binding (form:xforms-list-source attribute) More...
 
OUString m_sSubmissionID
 name of a submission (xforms:submission attribute) More...
 
- Protected Attributes inherited from xmloff::OElementImport
OUString m_sServiceName
 
OUString m_sName
 
OFormLayerXMLImport_Implm_rFormImport
 
IEventAttacherManagerm_rEventManager
 
const XMLTextStyleContextm_pStyleElement
 
css::uno::Reference< css::container::XNameContainer > m_xParentContainer
 the parent container to insert the new element into More...
 
css::uno::Reference< css::beans::XPropertySetm_xElement
 the element we're creating. Valid after StartElement More...
 
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo
 
bool m_bImplicitGenericAttributeHandling
 
- Protected Attributes inherited from xmloff::OPropertyImport
PropertyValueArray m_aValues
 
PropertyValueArray m_aGenericValues
 
std::set< OUString > m_aEncounteredAttributes
 
OFormLayerXMLImport_Implm_rContext
 
bool m_bTrackAttributes
 

Friends

class OListOptionImport
 
class OComboItemImport
 

Additional Inherited Members

- Protected Types inherited from xmloff::OPropertyImport
typedef ::std::vector< css::beans::PropertyValue > PropertyValueArray
 
- Static Protected Member Functions inherited from xmloff::OControlImport
static void implTranslateValueProperty (const css::uno::Reference< css::beans::XPropertySetInfo > &_rxPropInfo, css::beans::PropertyValue &_rPropValue)
 

Detailed Description

A specialized version of the <type>OControlImport</type> class, which handles attributes / sub elements which are special to list and combo boxes.

Definition at line 457 of file elementimport.hxx.

Constructor & Destructor Documentation

xmloff::OListAndComboImport::OListAndComboImport ( OFormLayerXMLImport_Impl _rImport,
IEventAttacherManager _rEventManager,
sal_uInt16  _nPrefix,
const OUString &  _rName,
const css::uno::Reference< css::container::XNameContainer > &  _rxParentContainer,
OControlElement::ElementType  _eType 
)

<TRUE> if and only if we should use a cell value binding which exchanges the selection index (instead of the selection text

Definition at line 1476 of file elementimport.cxx.

References xmloff::OControlElement::COMBOBOX, xmloff::OPropertyImport::enableTrackAttributes(), and xmloff::OControlImport::m_eElementType.

Member Function Documentation

SvXMLImportContextRef xmloff::OListAndComboImport::CreateChildContext ( sal_uInt16  nPrefix,
const OUString &  rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList 
)
overridevirtual

Create a children element context.

By default, the import's CreateContext method is called to create a new default context.

Reimplemented from xmloff::OElementImport.

Definition at line 1489 of file elementimport.cxx.

References xmloff::OElementImport::CreateChildContext(), SvXMLImportContext::GetImport(), OComboItemImport, and OListOptionImport.

void xmloff::OListAndComboImport::doRegisterCellValueBinding ( const OUString &  _rBoundCellAddress)
overridevirtual

registers the given cell address as value binding address for our element

The default implementation simply calls registerCellValueBinding at our import context, but you may want to override this behaviour.

Parameters
_rBoundCellAddressthe cell address to register for our element. Must not be <NULL>. we have a valid element (m_xElement)

Reimplemented from xmloff::OControlImport.

Definition at line 1565 of file elementimport.cxx.

References xmloff::OControlImport::doRegisterCellValueBinding(), and m_bLinkWithIndexes.

void xmloff::OListAndComboImport::EndElement ( )
overridevirtual
bool xmloff::OListAndComboImport::handleAttribute ( sal_uInt16  _nNamespaceKey,
const OUString &  _rLocalName,
const OUString &  _rValue 
)
overridevirtual

handle one single attribute.

This is called for every attribute of the element. This class' implementation checks if the attribute describes a property, if so, it is added to <member>m_aValues</member>.

All non-property attributes should be handled in derived classes.

Parameters
_nNamespaceKeykey of the namespace used in the attribute
_rLocalNamelocal (relative to the namespace) attribute name
_rValueattribute value

Reimplemented from xmloff::OControlImport.

Definition at line 1580 of file elementimport.cxx.

References xmloff::aListLinkageMap, xmloff::OControlElement::COMBOBOX, xmloff::PropertyConversion::convertString(), xmloff::OAttributeMetaData::getBindingAttributeName(), xmloff::OAttributeMetaData::getDatabaseAttributeName(), xmloff::OControlImport::handleAttribute(), xmloff::OPropertyImport::implPushBackPropertyValue(), ListCellRange, ListLinkingType, ListSource, m_bEncounteredLSAttrib, m_bLinkWithIndexes, xmloff::OControlImport::m_eElementType, m_sCellListSource, and PROPERTY_LISTSOURCE.

void xmloff::OListAndComboImport::implDefaultSelectCurrentItem ( )
protected
void xmloff::OListAndComboImport::implEmptyLabelFound ( )
protected

Definition at line 1651 of file elementimport.cxx.

References m_nEmptyListItems.

void xmloff::OListAndComboImport::implEmptyValueFound ( )
protected

Definition at line 1656 of file elementimport.cxx.

References m_nEmptyValueItems.

void xmloff::OListAndComboImport::implPushBackLabel ( const OUString &  _rLabel)
protected

Definition at line 1629 of file elementimport.cxx.

References m_aListSource, and m_nEmptyListItems.

void xmloff::OListAndComboImport::implPushBackValue ( const OUString &  _rValue)
protected

Definition at line 1636 of file elementimport.cxx.

References m_aValueList, m_bEncounteredLSAttrib, and m_nEmptyValueItems.

void xmloff::OListAndComboImport::implSelectCurrentItem ( )
protected
void xmloff::OListAndComboImport::StartElement ( const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList)
overridevirtual

StartElement is called after a context has been constructed and before an elements context is parsed.

It may be used for actions that require virtual methods. The default is to do nothing.

Reimplemented from xmloff::OControlImport.

Definition at line 1504 of file elementimport.cxx.

References AutoCompletion, xmloff::OControlElement::COMBOBOX, ConvertEmpty, xmloff::OAttributeMetaData::getDatabaseAttributeName(), xmloff::OAttributeMetaData::getSpecialAttributeName(), m_bLinkWithIndexes, xmloff::OControlImport::m_eElementType, PROPERTY_AUTOCOMPLETE, PROPERTY_EMPTY_IS_NULL, xmloff::OElementImport::simulateDefaultedAttribute(), and xmloff::OControlImport::StartElement().

Friends And Related Function Documentation

friend class OComboItemImport
friend

Definition at line 460 of file elementimport.hxx.

Referenced by CreateChildContext().

friend class OListOptionImport
friend

Definition at line 459 of file elementimport.hxx.

Referenced by CreateChildContext().

Member Data Documentation

std::vector< sal_Int16 > xmloff::OListAndComboImport::m_aDefaultSelectedSeq
protected

Definition at line 471 of file elementimport.hxx.

Referenced by EndElement(), and implDefaultSelectCurrentItem().

std::vector<OUString > xmloff::OListAndComboImport::m_aListSource
protected
std::vector< sal_Int16 > xmloff::OListAndComboImport::m_aSelectedSeq
protected

Definition at line 469 of file elementimport.hxx.

Referenced by EndElement(), and implSelectCurrentItem().

std::vector< OUString > xmloff::OListAndComboImport::m_aValueList
protected
bool xmloff::OListAndComboImport::m_bEncounteredLSAttrib
protected

number of empty value items encountered during reading

Definition at line 478 of file elementimport.hxx.

Referenced by EndElement(), handleAttribute(), and implPushBackValue().

bool xmloff::OListAndComboImport::m_bLinkWithIndexes
protected

Definition at line 479 of file elementimport.hxx.

Referenced by doRegisterCellValueBinding(), handleAttribute(), and StartElement().

sal_Int32 xmloff::OListAndComboImport::m_nEmptyListItems
protected

the cell range which acts as list source for the control

Definition at line 475 of file elementimport.hxx.

Referenced by EndElement(), implDefaultSelectCurrentItem(), implEmptyLabelFound(), implPushBackLabel(), and implSelectCurrentItem().

sal_Int32 xmloff::OListAndComboImport::m_nEmptyValueItems
protected

number of empty list items encountered during reading

Definition at line 476 of file elementimport.hxx.

Referenced by EndElement(), implDefaultSelectCurrentItem(), implEmptyValueFound(), implPushBackValue(), and implSelectCurrentItem().

OUString xmloff::OListAndComboImport::m_sCellListSource
protected

Definition at line 473 of file elementimport.hxx.

Referenced by EndElement(), and handleAttribute().


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