31#include <com/sun/star/text/XTextCursor.hpp>
32#include <com/sun/star/container/XNameContainer.hpp>
33#include <com/sun/star/form/XGridColumnFactory.hpp>
34#include <com/sun/star/graphic/XGraphic.hpp>
35#include <osl/diagnose.h>
44 class OFormLayerXMLImport_Impl;
80 css::uno::Reference< css::container::XNameContainer >
84 css::uno::Reference< css::beans::XPropertySet >
86 css::uno::Reference< css::beans::XPropertySetInfo >
104 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
110 virtual void SAL_CALL
startFastElement( sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
override;
111 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
114 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
117 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
121 const css::uno::Sequence< css::script::ScriptEventDescriptor >& _rEvents
128 virtual css::uno::Reference< css::beans::XPropertySet >
178 css::uno::Reference< css::xml::sax::XFastAttributeList >
199 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
205 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
210 virtual void SAL_CALL
startFastElement( sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
override;
211 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
214 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
216 void addOuterAttributes(
const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxOuterAttribs);
223 const css::uno::Reference< css::beans::XPropertySetInfo >& _rxPropInfo,
224 css::beans::PropertyValue& _rPropValue);
252 virtual css::uno::Reference< css::beans::XPropertySet >
272 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
280 const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList)
override;
283 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
294 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
300 const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList)
override;
303 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
312 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
317 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
326 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
332 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
344 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
350 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
362 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
370 const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList)
override;
385 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
393 const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList )
override;
396 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
406 css::uno::Reference< css::text::XTextCursor >
m_xCursor;
413 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
420 const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList)
override;
423 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
override;
424 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
440 std::vector<OUString >
442 std::vector< OUString >
445 std::vector< sal_Int16 >
447 std::vector< sal_Int16 >
463 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
469 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
override;
470 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
473 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
476 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
506 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
override;
524 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
override;
534 template <
class BASE>
537 css::uno::Reference< css::form::XGridColumnFactory >
542 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
547 virtual css::uno::Reference< css::beans::XPropertySet >
554 css::uno::Reference< css::xml::sax::XFastAttributeList >
556 css::uno::Reference< css::container::XNameContainer >
564 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer);
569 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
572 const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList)
override;
586 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
592 const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
593 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
597 virtual css::uno::Reference< css::beans::XPropertySet >
createElement()
override;
609 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
616 const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList)
override;
617 virtual void SAL_CALL
endFastElement(sal_Int32 nElement)
override;
620 sal_Int32 nElement,
const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList )
override;
623 virtual bool handleAttribute(sal_Int32 nElement,
const OUString& _rValue)
override;
626 virtual css::uno::Reference< css::beans::XPropertySet >
640 ,
const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList
641 ,
const css::uno::Reference< css::beans::XPropertySet >& _xElement);
645 template <
class BASE>
648 const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
650 :
BASE(_rImport, _rEventManager, _rxParentContainer, _eType)
651 ,m_xColumnFactory(_rxParentContainer, css::
uno::UNO_QUERY)
653 OSL_ENSURE(
m_xColumnFactory.is(),
"OColumnImport::OColumnImport: invalid parent container (no factory)!");
657 template <
class BASE>
660 css::uno::Reference< css::beans::XPropertySet > xReturn;
662 if (m_xColumnFactory.is())
665 xReturn = m_xColumnFactory->createColumn(this->m_sServiceName);
666 OSL_ENSURE(xReturn.is(),
"OColumnImport::createElement: the factory returned an invalid object!");
This class deliberately does not support XWeak, to improve performance when loading large documents.
helper class importing a single grid column (without the <form:column> element wrapping the column).
OColumnImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
css::uno::Reference< css::form::XGridColumnFactory > m_xColumnFactory
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
OControlImport * implCreateChildContext(sal_Int32 nElement, OControlElement::ElementType _eType)
OColumnWrapperImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, sal_Int32 nElement, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
IEventAttacherManager & m_rEventManager
OFormLayerXMLImport_Impl & m_rFormImport
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
css::uno::Reference< css::xml::sax::XFastAttributeList > m_xOwnAttributes
css::uno::Reference< css::container::XNameContainer > m_xParentContainer
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
helper class for importing a single <form:item> element.
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
OListAndComboImportRef m_xListBoxImport
OComboItemImport(SvXMLImport &_rImport, OListAndComboImportRef _xListBox)
helper for translating between control types and XML tags
helper class for importing the description of a single control
OUString m_sSubmissionID
name of a submission (xforms:submission attribute)
static void implTranslateValueProperty(const css::uno::Reference< css::beans::XPropertySetInfo > &_rxPropInfo, css::beans::PropertyValue &_rPropValue)
OUString m_sListBindingID
name of a list binding (form:xforms-list-source attribute)
void doRegisterXFormsValueBinding(const OUString &)
register the given XForms binding
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
create the (uninitialized) element which is to represent the read data
css::uno::Reference< css::xml::sax::XFastAttributeList > m_xOuterAttributes
void setElementType(OControlElement::ElementType _eType)
void doRegisterXFormsSubmission(const OUString &)
register the given XForms submission
OUString m_sBoundCellAddress
the address of the calc cell which the control model should be bound to, if applicable
virtual OUString determineDefaultServiceName() const override
void addOuterAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxOuterAttribs)
virtual void doRegisterCellValueBinding(const OUString &_rBoundCellAddress)
registers the given cell address as value binding address for our element
OControlElement::ElementType m_eElementType
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
OUString m_sBindingID
name of a value binding (xforms:bind attribute)
PropertyValueArray m_aValueProperties
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
OControlImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
void doRegisterXFormsListBinding(const OUString &)
register the given XForms list binding
OControlImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
implements common behaviour for importing forms, controls and columns
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo
void implApplySpecificProperties()
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
PropertyGroups::const_iterator impl_matchPropertyGroup(const PropertyGroups &i_propertyGroups) const
virtual css::uno::Reference< css::beans::XPropertySet > createElement()
create the (uninitialized) element which is to represent the read data
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
css::uno::Reference< css::container::XNameContainer > m_xParentContainer
the parent container to insert the new element into
virtual ~OElementImport() override
OElementImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
ctor
bool tryGenericAttribute(sal_Int32 nElement, const OUString &_rValue)
to be called from within handleAttribute, checks whether the given attribute is covered by our generi...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
IEventAttacherManager & m_rEventManager
css::uno::Reference< css::beans::XPropertySet > m_xElement
the element we're creating. Valid after StartElement
OFormLayerXMLImport_Impl & m_rFormImport
OUString implGetDefaultName() const
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
void disableImplicitGenericAttributeHandling()
controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived cla...
const XMLTextStyleContext * m_pStyleElement
virtual OUString determineDefaultServiceName() const
void implApplyGenericProperties()
virtual void registerEvents(const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents) override
void simulateDefaultedAttribute(sal_Int32 nElement, const OUString &_rPropertyName, const char *_pAttributeDefault)
can be used to handle properties where the attribute default and the property default differ.
bool m_bImplicitGenericAttributeHandling
helper class which allows fast translation of xml tag names into element types.
static ElementType getElementType(sal_Int32 nToken)
static std::map< sal_Int32, ElementType > s_sElementTranslations2
std::map< OUString, ElementType > MapString2Element
helper class importing a single <form:grid> element
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
OGridImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
css::uno::Reference< css::container::XNameContainer > m_xMeAsContainer
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
create the (uninitialized) element which is to represent the read data
OImagePositionImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
css::uno::Reference< css::graphic::XGraphic > m_xGraphic
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
sal_Int16 m_nImagePosition
bool m_bHaveImagePosition
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
A specialized version of the <type>OControlImport</type> class, which handles attributes / sub elemen...
std::vector< sal_Int16 > m_aDefaultSelectedSeq
void implPushBackLabel(const OUString &_rLabel)
void implDefaultSelectCurrentItem()
bool m_bEncounteredLSAttrib
number of empty value items encountered during reading
void implSelectCurrentItem()
std::vector< sal_Int16 > m_aSelectedSeq
void implPushBackValue(const OUString &_rValue)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual void doRegisterCellValueBinding(const OUString &_rBoundCellAddress) override
registers the given cell address as value binding address for our element
sal_Int32 m_nEmptyValueItems
number of empty list items encountered during reading
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
std::vector< OUString > m_aValueList
std::vector< OUString > m_aListSource
void implEmptyLabelFound()
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
void implEmptyValueFound()
OUString m_sCellListSource
sal_Int32 m_nEmptyListItems
the cell range which acts as list source for the control
OListAndComboImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, 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...
helper class for importing a single <form:option> element.
OListOptionImport(SvXMLImport &_rImport, OListAndComboImportRef _xListBox)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
OListAndComboImportRef m_xListBoxImport
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
OPasswordImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
Helper class for importing property values.
::std::vector< css::beans::PropertyValue > PropertyValueArray
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
ORadioImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
OReferredControlImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
OUString m_sReferringControls
A specialized version of the <type>OControlImport</type> class, which handles text like controls whic...
bool m_bEncounteredTextPara
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
void removeRedundantCurrentValue()
void adjustDefaultControlProperty()
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
css::uno::Reference< css::text::XTextCursor > m_xCursor
css::uno::Reference< css::text::XTextCursor > m_xOldCursor
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
OTextLikeImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
a specialized version of the <type>OControlImport</type> class, which is able to handle attributes wh...
OURLReferenceImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
A specialized version of the <type>OControlImport</type> class, which imports the value-range element...
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
sal_Int32 m_nStepSizeValue
OValueRangeImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
OXMLDataSourceImport(SvXMLImport &_rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const css::uno::Reference< css::beans::XPropertySet > &_xElement)
::std::vector< PropertyDescriptionList > PropertyGroups
const OControlElement::ElementType & operator++(OControlElement::ElementType &_e)
rtl::Reference< OListAndComboImport > OListAndComboImportRef