/** helper class which allows fast translation of xml tag names into element types.
*/ class OElementNameMap : public OControlElement
{ typedef std::map<OUString, ElementType> MapString2Element; static std::map<sal_Int32, ElementType> s_sElementTranslations2;
//= OElementImport /** implements common behaviour for importing forms, controls and columns
*/ class OElementImport
:public OPropertyImport
,public IEventAttacher
,public OStackedLogging
{ protected:
OUString m_sServiceName; // the service name as extracted from the service-name attribute
OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
OFormLayerXMLImport_Impl& m_rFormImport; // the form import context
IEventAttacherManager& m_rEventManager; // the event attacher manager
const XMLTextStyleContext* m_pStyleElement; // the XML element which describes the style we encountered // while reading our element
/// the parent container to insert the new element into
css::uno::Reference< css::container::XNameContainer >
m_xParentContainer;
/// the element we're creating. Valid after StartElement
css::uno::Reference< css::beans::XPropertySet >
m_xElement;
css::uno::Reference< css::beans::XPropertySetInfo >
m_xInfo;
protected: /** can be used to handle properties where the attribute default and the property default differ. <p>Insuchcase,ifthepropertyhadtheattributedefaultuponwriting,nothingisread,souponreading, thepropertyisstillatitsowndefault(whichisnottheattributedefault).<p/> <p>Thismethod,iftoldtheattributeandtheproperty,andthe(implied)attributedefault,setsthe propertyvalueasiftheattributewasencountered.</p> @seeencounteredAttribute
*/ void simulateDefaultedAttribute(sal_Int32 nElement, const OUString& _rPropertyName, const OUString& _pAttributeDefault);
/** to be called from within handleAttribute, checks whether the given attribute is covered by our generic attributehandlermechanisms
*/ bool tryGenericAttribute( sal_Int32 nElement, const OUString& _rValue );
/** controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class mustdothisexplicitlyatasuitableplaceinitsown|handleAttribute|
*/ void disableImplicitGenericAttributeHandling() { m_bImplicitGenericAttributeHandling = false; }
//= OControlImport /** helper class for importing the description of a single control
*/ class OControlImport
:public OElementImport
,public OValuePropertiesMetaData
{ protected:
OUString m_sControlId;
OControlElement::ElementType m_eElementType;
PropertyValueArray m_aValueProperties; // the value properties (value, current-value, min-value, max-value) require some special // handling
// we fake the attributes our base class gets: we add the attributes of the outer wrapper // element which encloses us
css::uno::Reference< css::xml::sax::XFastAttributeList >
m_xOuterAttributes;
/** the address of the calc cell which the control model should be bound to, ifapplicable
*/
OUString m_sBoundCellAddress;
/** name of a value binding (xforms:bind attribute) */
OUString m_sBindingID;
/** name of a list binding (form:xforms-list-source attribute) */
OUString m_sListBindingID;
/** name of a submission (xforms:submission attribute) */
OUString m_sSubmissionID;
protected: // for use by derived classes only
OControlImport(
OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
);
// TODO: // this whole mechanism doesn't scale. Instead of deriving even more classes for every new attribute, // we should have dedicated attribute handlers // The rest of xmloff implements it this way - why don't we do, too?
//= OImagePositionImport class OImagePositionImport : public OControlImport
{
css::uno::Reference<css::graphic::XGraphic> m_xGraphic;
sal_Int16 m_nImagePosition;
sal_Int16 m_nImageAlign; bool m_bHaveImagePosition;
//= OReferredControlImport class OReferredControlImport : public OControlImport
{
OUString m_sReferringControls; // the list of ids of controls referring to the one being imported
//= OURLReferenceImport /** a specialized version of the <type>OControlImport</type> class, which is able tohandleattributeswhichdenoteURLs(andstoredrelative)
*/ class OURLReferenceImport : public OImagePositionImport
{ public:
OURLReferenceImport(
OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
OControlElement::ElementType _eType
);
//= OButtonImport /** A specialized version of the <type>OControlImport</type> class, which handles thetargetframeforimageandcommandbuttons
*/ class OButtonImport : public OURLReferenceImport
{ public:
OButtonImport(
OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
OControlElement::ElementType _eType
);
//= OValueRangeImport /** A specialized version of the <type>OControlImport</type> class, which imports thevalue-rangeelements
*/ class OValueRangeImport : public OControlImport
{ private:
sal_Int32 m_nStepSizeValue;
//= OTextLikeImport /** A specialized version of the <type>OControlImport</type> class, which handles textlikecontrolswhichhavetheconvert-empty-to-nullattribute</p>
*/ class OTextLikeImport : public OControlImport
{ private:
css::uno::Reference< css::text::XTextCursor > m_xCursor;
css::uno::Reference< css::text::XTextCursor > m_xOldCursor; bool m_bEncounteredTextPara;
//= OListAndComboImport /** A specialized version of the <type>OControlImport</type> class, which handles attributes/subelementswhicharespecialtolistandcomboboxes
*/ class OListAndComboImport : public OControlImport
{ friendclass OListOptionImport; friendclass OComboItemImport;
OUString m_sCellListSource; /// the cell range which acts as list source for the control
sal_Int32 m_nEmptyListItems; /// number of empty list items encountered during reading
sal_Int32 m_nEmptyValueItems; /// number of empty value items encountered during reading
bool m_bEncounteredLSAttrib; bool m_bLinkWithIndexes; /** <TRUE/> if and only if we should use a cell value binding whichexchangestheselectionindex(insteadoftheselectiontext
*/
//= OListOptionImport /** helper class for importing a single <form:option> element.
*/ class OListOptionImport
:public SvXMLImportContext
{
OListAndComboImportRef m_xListBoxImport;
//= OComboItemImport /** helper class for importing a single <form:item> element.
*/ class OComboItemImport
:public SvXMLImportContext
{
OListAndComboImportRef m_xListBoxImport;
//= OColumnImport /** helper class importing a single grid column (without the <form:column> element wrapping thecolumn).
<p>BASE(thetemplateargument)mustbeaderiveeofOControlImport</p>
*/ template <class BASE> class OColumnImport : public BASE
{
css::uno::Reference< css::form::XGridColumnFactory >
m_xColumnFactory;
/** helper class importing a single <form:grid> element
*/ class OGridImport : public OControlImport, public ODefaultEventAttacherManager
{ public:
OGridImport(
OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
OControlElement::ElementType _eType);
/** helper class importing a single <form:form> element
*/ class OFormImport : public OElementImport, public ODefaultEventAttacherManager
{ public:
OFormImport(
OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
);
// OElementImport overridables template <class BASE>
css::uno::Reference< css::beans::XPropertySet > OColumnImport< BASE >::createElement()
{
css::uno::Reference< css::beans::XPropertySet > xReturn; // no call to the base class' method. We have to use the grid column factory if (m_xColumnFactory.is())
{ // create the column
xReturn = m_xColumnFactory->createColumn(this->m_sServiceName);
OSL_ENSURE(xReturn.is(), "OColumnImport::createElement: the factory returned an invalid object!");
} return xReturn;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.