1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _XMLOFF_FORMS_ELEMENTIMPORT_HXX_ 29*cdf0e10cSrcweir #define _XMLOFF_FORMS_ELEMENTIMPORT_HXX_ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "propertyimport.hxx" 32*cdf0e10cSrcweir #include "controlelement.hxx" 33*cdf0e10cSrcweir #include "valueproperties.hxx" 34*cdf0e10cSrcweir #include "eventimport.hxx" 35*cdf0e10cSrcweir #include "logging.hxx" 36*cdf0e10cSrcweir #include "property_description.hxx" 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir /** === begin UNO includes === **/ 39*cdf0e10cSrcweir #include <com/sun/star/text/XTextCursor.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/form/XGridColumnFactory.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/script/XEventAttacherManager.hpp> 44*cdf0e10cSrcweir /** === end UNO includes === **/ 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir #include <comphelper/stl_types.hxx> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir class XMLTextStyleContext; 49*cdf0e10cSrcweir //......................................................................... 50*cdf0e10cSrcweir namespace xmloff 51*cdf0e10cSrcweir { 52*cdf0e10cSrcweir //......................................................................... 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir class IControlIdMap; 55*cdf0e10cSrcweir class OFormLayerXMLImport_Impl; 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir //===================================================================== 58*cdf0e10cSrcweir //= OElementNameMap 59*cdf0e10cSrcweir //===================================================================== 60*cdf0e10cSrcweir const OControlElement::ElementType& operator ++(OControlElement::ElementType& _e); 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir /** helper class which allows fast translation of xml tag names into element types. 63*cdf0e10cSrcweir */ 64*cdf0e10cSrcweir class OElementNameMap : public OControlElement 65*cdf0e10cSrcweir { 66*cdf0e10cSrcweir protected: 67*cdf0e10cSrcweir DECLARE_STL_USTRINGACCESS_MAP( ElementType, MapString2Element ); 68*cdf0e10cSrcweir static MapString2Element s_sElementTranslations; 69*cdf0e10cSrcweir 70*cdf0e10cSrcweir protected: 71*cdf0e10cSrcweir OElementNameMap() { } 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir public: 74*cdf0e10cSrcweir static ElementType getElementType(const ::rtl::OUString& _rName); 75*cdf0e10cSrcweir }; 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir //===================================================================== 78*cdf0e10cSrcweir //= OElementImport 79*cdf0e10cSrcweir //===================================================================== 80*cdf0e10cSrcweir /** implements common behaviour for importing forms, controls and columns 81*cdf0e10cSrcweir */ 82*cdf0e10cSrcweir class OElementImport 83*cdf0e10cSrcweir :public OPropertyImport 84*cdf0e10cSrcweir ,public IEventAttacher 85*cdf0e10cSrcweir ,public OStackedLogging 86*cdf0e10cSrcweir { 87*cdf0e10cSrcweir protected: 88*cdf0e10cSrcweir ::rtl::OUString m_sServiceName; // the service name as extracted from the service-name attribute 89*cdf0e10cSrcweir ::rtl::OUString m_sName; // the name of the object (redundant, already contained in the base class' array) 90*cdf0e10cSrcweir OFormLayerXMLImport_Impl& m_rFormImport; // the form import context 91*cdf0e10cSrcweir IEventAttacherManager& m_rEventManager; // the event attacher manager 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir const XMLTextStyleContext* m_pStyleElement; // the XML element which describes the style we encountered 94*cdf0e10cSrcweir // while reading our element 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir /// the parent container to insert the new element into 97*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > 98*cdf0e10cSrcweir m_xParentContainer; 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir /// the element we're creating. Valid after StartElement 101*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 102*cdf0e10cSrcweir m_xElement; 103*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > 104*cdf0e10cSrcweir m_xInfo; 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir bool m_bImplicitGenericAttributeHandling; 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir public: 109*cdf0e10cSrcweir /** ctor 110*cdf0e10cSrcweir @param _rImport 111*cdf0e10cSrcweir the importer 112*cdf0e10cSrcweir @param _rEventManager 113*cdf0e10cSrcweir the event attacher manager for the control beeing imported 114*cdf0e10cSrcweir @param _nPrefix 115*cdf0e10cSrcweir the namespace prefix 116*cdf0e10cSrcweir @param _rName 117*cdf0e10cSrcweir the element name 118*cdf0e10cSrcweir @param _rAttributeMap 119*cdf0e10cSrcweir the attribute map to be used for translating attributes into properties 120*cdf0e10cSrcweir @param _rxParentContainer 121*cdf0e10cSrcweir the container in which the new element should be inserted 122*cdf0e10cSrcweir */ 123*cdf0e10cSrcweir OElementImport( 124*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, 125*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 126*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer 127*cdf0e10cSrcweir ); 128*cdf0e10cSrcweir virtual ~OElementImport(); 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir protected: 131*cdf0e10cSrcweir // SvXMLImportContext overridables 132*cdf0e10cSrcweir virtual void StartElement( 133*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 134*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 135*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 136*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 137*cdf0e10cSrcweir virtual void EndElement(); 138*cdf0e10cSrcweir 139*cdf0e10cSrcweir // OPropertyImport overridables 140*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 141*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 142*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir // IEventAttacher 145*cdf0e10cSrcweir virtual void registerEvents( 146*cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents 147*cdf0e10cSrcweir ); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir /** create the (uninitialized) element which is to represent the read data 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir <p>The default implementation uses <member>m_xORB</member> to create a object with <member>m_sServiceName</member>. 152*cdf0e10cSrcweir */ 153*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 154*cdf0e10cSrcweir createElement(); 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir protected: 157*cdf0e10cSrcweir /** can be used to handle properties where the attribute default and the property default differ. 158*cdf0e10cSrcweir <p>In such case, if the property had the attribute default upon writing, nothing is read, so upon reading, 159*cdf0e10cSrcweir the property is still at it's own default (which is not the attribute default).<p/> 160*cdf0e10cSrcweir <p>This method, if told the attribute and the property, and the (implied) attribute default, sets the 161*cdf0e10cSrcweir property value as if the attribute was encountered.</p> 162*cdf0e10cSrcweir @see encounteredAttribute 163*cdf0e10cSrcweir */ 164*cdf0e10cSrcweir void simulateDefaultedAttribute(const sal_Char* _pAttributeName, const ::rtl::OUString& _rPropertyName, const sal_Char* _pAttributeDefault); 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir /** to be called from within handleAttribute, checks whether the given attribute is covered by our generic 167*cdf0e10cSrcweir attribute handler mechanisms 168*cdf0e10cSrcweir */ 169*cdf0e10cSrcweir bool tryGenericAttribute( sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue ); 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir /** controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class 172*cdf0e10cSrcweir must do this explicitly at a suitable place in its own |handleAttribute| 173*cdf0e10cSrcweir */ 174*cdf0e10cSrcweir void disableImplicitGenericAttributeHandling() { m_bImplicitGenericAttributeHandling = false; } 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir private: 177*cdf0e10cSrcweir ::rtl::OUString implGetDefaultName() const; 178*cdf0e10cSrcweir void implApplyGenericProperties(); 179*cdf0e10cSrcweir void implApplySpecificProperties(); 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir /** sets the style properties which have been read for the element (if any) 182*cdf0e10cSrcweir */ 183*cdf0e10cSrcweir void implSetStyleProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject ); 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir PropertyGroups::const_iterator impl_matchPropertyGroup( const PropertyGroups& i_propertyGroups ) const; 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir virtual ::rtl::OUString determineDefaultServiceName() const; 188*cdf0e10cSrcweir }; 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir //===================================================================== 191*cdf0e10cSrcweir //= OControlImport 192*cdf0e10cSrcweir //===================================================================== 193*cdf0e10cSrcweir /** helper class for importing the description of a single control 194*cdf0e10cSrcweir */ 195*cdf0e10cSrcweir class OControlImport 196*cdf0e10cSrcweir :public OElementImport 197*cdf0e10cSrcweir ,public OValuePropertiesMetaData 198*cdf0e10cSrcweir { 199*cdf0e10cSrcweir protected: 200*cdf0e10cSrcweir ::rtl::OUString m_sControlId; 201*cdf0e10cSrcweir OControlElement::ElementType m_eElementType; 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir PropertyValueArray m_aValueProperties; 204*cdf0e10cSrcweir // the value properties (value, current-value, min-value, max-value) require some special 205*cdf0e10cSrcweir // handling 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir // we fake the attributes our base class gets: we add the attributes of the outer wrapper 208*cdf0e10cSrcweir // element which encloses us 209*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > 210*cdf0e10cSrcweir m_xOuterAttributes; 211*cdf0e10cSrcweir 212*cdf0e10cSrcweir /** the address of the calc cell which the control model should be bound to, 213*cdf0e10cSrcweir if applicable 214*cdf0e10cSrcweir */ 215*cdf0e10cSrcweir ::rtl::OUString m_sBoundCellAddress; 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir /** name of a value binding (xforms:bind attribute) */ 218*cdf0e10cSrcweir ::rtl::OUString m_sBindingID; 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir /** name of a list binding (form:xforms-list-source attribute) */ 221*cdf0e10cSrcweir ::rtl::OUString m_sListBindingID; 222*cdf0e10cSrcweir 223*cdf0e10cSrcweir /** name of a submission (xforms:submission attribute) */ 224*cdf0e10cSrcweir ::rtl::OUString m_sSubmissionID; 225*cdf0e10cSrcweir 226*cdf0e10cSrcweir protected: 227*cdf0e10cSrcweir // for use by derived classes only 228*cdf0e10cSrcweir OControlImport( 229*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, 230*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 231*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer 232*cdf0e10cSrcweir ); 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir public: 235*cdf0e10cSrcweir OControlImport( 236*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, 237*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 238*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 239*cdf0e10cSrcweir OControlElement::ElementType _eType 240*cdf0e10cSrcweir ); 241*cdf0e10cSrcweir 242*cdf0e10cSrcweir // SvXMLImportContext overridables 243*cdf0e10cSrcweir virtual void StartElement( 244*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 245*cdf0e10cSrcweir virtual void EndElement(); 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir // OPropertyImport overridables 248*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 249*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 250*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir void addOuterAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxOuterAttribs); 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir protected: 255*cdf0e10cSrcweir void setElementType(OControlElement::ElementType _eType) { m_eElementType = _eType; } 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir protected: 258*cdf0e10cSrcweir void implTranslateValueProperty( 259*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo, 260*cdf0e10cSrcweir ::com::sun::star::beans::PropertyValue& /* [in/out] */ _rPropValue); 261*cdf0e10cSrcweir 262*cdf0e10cSrcweir virtual ::rtl::OUString determineDefaultServiceName() const; 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir /** registers the given cell address as value binding address for our element 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir <p>The default implementation simply calls registerCellValueBinding at our import 267*cdf0e10cSrcweir context, but you may want to override this behaviour.</p> 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir @param _rBoundCellAddress 270*cdf0e10cSrcweir the cell address to register for our element. Must not be <NULL/>. 271*cdf0e10cSrcweir @precond 272*cdf0e10cSrcweir we have a valid element (m_xElement) 273*cdf0e10cSrcweir */ 274*cdf0e10cSrcweir virtual void doRegisterCellValueBinding( const ::rtl::OUString& _rBoundCellAddress ); 275*cdf0e10cSrcweir 276*cdf0e10cSrcweir /** register the given XForms binding */ 277*cdf0e10cSrcweir virtual void doRegisterXFormsValueBinding( const ::rtl::OUString& ); 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir /** register the given XForms list binding */ 280*cdf0e10cSrcweir virtual void doRegisterXFormsListBinding( const ::rtl::OUString& ); 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir /** register the given XForms submission */ 283*cdf0e10cSrcweir virtual void doRegisterXFormsSubmission( const ::rtl::OUString& ); 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir protected: 286*cdf0e10cSrcweir //added by BerryJia for fixing bug102407 2002-11-5 287*cdf0e10cSrcweir // OElementImport overridables 288*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 289*cdf0e10cSrcweir createElement(); 290*cdf0e10cSrcweir }; 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir // TODO: 293*cdf0e10cSrcweir // this whole mechanism doesn't scale. Instead of deriving even more classes for every new attribute, 294*cdf0e10cSrcweir // we should have dedicated attribute handlers 295*cdf0e10cSrcweir // The rest of xmloff implements it this way - why don't we do, too? 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir //===================================================================== 298*cdf0e10cSrcweir //= OImagePositionImport 299*cdf0e10cSrcweir //===================================================================== 300*cdf0e10cSrcweir class OImagePositionImport : public OControlImport 301*cdf0e10cSrcweir { 302*cdf0e10cSrcweir sal_Int16 m_nImagePosition; 303*cdf0e10cSrcweir sal_Int16 m_nImageAlign; 304*cdf0e10cSrcweir sal_Bool m_bHaveImagePosition; 305*cdf0e10cSrcweir 306*cdf0e10cSrcweir public: 307*cdf0e10cSrcweir OImagePositionImport( 308*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 309*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 310*cdf0e10cSrcweir OControlElement::ElementType _eType 311*cdf0e10cSrcweir ); 312*cdf0e10cSrcweir 313*cdf0e10cSrcweir protected: 314*cdf0e10cSrcweir // SvXMLImportContext overridables 315*cdf0e10cSrcweir virtual void StartElement( 316*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 317*cdf0e10cSrcweir 318*cdf0e10cSrcweir // OPropertyImport overridables 319*cdf0e10cSrcweir virtual bool handleAttribute( sal_uInt16 _nNamespaceKey, 320*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 321*cdf0e10cSrcweir const ::rtl::OUString& _rValue 322*cdf0e10cSrcweir ); 323*cdf0e10cSrcweir }; 324*cdf0e10cSrcweir 325*cdf0e10cSrcweir //===================================================================== 326*cdf0e10cSrcweir //= OReferredControlImport 327*cdf0e10cSrcweir //===================================================================== 328*cdf0e10cSrcweir class OReferredControlImport : public OControlImport 329*cdf0e10cSrcweir { 330*cdf0e10cSrcweir protected: 331*cdf0e10cSrcweir ::rtl::OUString m_sReferringControls; // the list of ids of controls referring to the one beeing imported 332*cdf0e10cSrcweir 333*cdf0e10cSrcweir public: 334*cdf0e10cSrcweir OReferredControlImport( 335*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 336*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 337*cdf0e10cSrcweir OControlElement::ElementType _eType 338*cdf0e10cSrcweir ); 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir // SvXMLImportContext overridables 341*cdf0e10cSrcweir virtual void StartElement( 342*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir // OPropertyImport overridables 345*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 346*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 347*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 348*cdf0e10cSrcweir }; 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir //===================================================================== 351*cdf0e10cSrcweir //= OPasswordImport 352*cdf0e10cSrcweir //===================================================================== 353*cdf0e10cSrcweir class OPasswordImport : public OControlImport 354*cdf0e10cSrcweir { 355*cdf0e10cSrcweir public: 356*cdf0e10cSrcweir OPasswordImport( 357*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 358*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 359*cdf0e10cSrcweir OControlElement::ElementType _eType 360*cdf0e10cSrcweir ); 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir // OPropertyImport overridables 363*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 364*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 365*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 366*cdf0e10cSrcweir }; 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir //===================================================================== 369*cdf0e10cSrcweir //= ORadioImport 370*cdf0e10cSrcweir //===================================================================== 371*cdf0e10cSrcweir class ORadioImport : public OImagePositionImport 372*cdf0e10cSrcweir { 373*cdf0e10cSrcweir public: 374*cdf0e10cSrcweir ORadioImport( 375*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 376*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 377*cdf0e10cSrcweir OControlElement::ElementType _eType 378*cdf0e10cSrcweir ); 379*cdf0e10cSrcweir 380*cdf0e10cSrcweir protected: 381*cdf0e10cSrcweir // OPropertyImport overridables 382*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 383*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 384*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 385*cdf0e10cSrcweir }; 386*cdf0e10cSrcweir 387*cdf0e10cSrcweir //===================================================================== 388*cdf0e10cSrcweir //= OURLReferenceImport 389*cdf0e10cSrcweir //===================================================================== 390*cdf0e10cSrcweir /** a specialized version of the <type>OControlImport</type> class, which is able 391*cdf0e10cSrcweir to handle attributes which denote URLs (and stored relative) 392*cdf0e10cSrcweir */ 393*cdf0e10cSrcweir class OURLReferenceImport : public OImagePositionImport 394*cdf0e10cSrcweir { 395*cdf0e10cSrcweir public: 396*cdf0e10cSrcweir OURLReferenceImport( 397*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 398*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 399*cdf0e10cSrcweir OControlElement::ElementType _eType 400*cdf0e10cSrcweir ); 401*cdf0e10cSrcweir 402*cdf0e10cSrcweir protected: 403*cdf0e10cSrcweir // OPropertyImport overridables 404*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 405*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 406*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 407*cdf0e10cSrcweir }; 408*cdf0e10cSrcweir 409*cdf0e10cSrcweir //===================================================================== 410*cdf0e10cSrcweir //= OButtonImport 411*cdf0e10cSrcweir //===================================================================== 412*cdf0e10cSrcweir /** A specialized version of the <type>OControlImport</type> class, which handles 413*cdf0e10cSrcweir the target frame for image and command buttons 414*cdf0e10cSrcweir */ 415*cdf0e10cSrcweir class OButtonImport : public OURLReferenceImport 416*cdf0e10cSrcweir { 417*cdf0e10cSrcweir public: 418*cdf0e10cSrcweir OButtonImport( 419*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 420*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 421*cdf0e10cSrcweir OControlElement::ElementType _eType 422*cdf0e10cSrcweir ); 423*cdf0e10cSrcweir 424*cdf0e10cSrcweir protected: 425*cdf0e10cSrcweir // SvXMLImportContext overridables 426*cdf0e10cSrcweir virtual void StartElement( 427*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 428*cdf0e10cSrcweir }; 429*cdf0e10cSrcweir 430*cdf0e10cSrcweir //===================================================================== 431*cdf0e10cSrcweir //= OValueRangeImport 432*cdf0e10cSrcweir //===================================================================== 433*cdf0e10cSrcweir /** A specialized version of the <type>OControlImport</type> class, which imports 434*cdf0e10cSrcweir the value-range elements 435*cdf0e10cSrcweir */ 436*cdf0e10cSrcweir class OValueRangeImport : public OControlImport 437*cdf0e10cSrcweir { 438*cdf0e10cSrcweir private: 439*cdf0e10cSrcweir sal_Int32 m_nStepSizeValue; 440*cdf0e10cSrcweir 441*cdf0e10cSrcweir public: 442*cdf0e10cSrcweir OValueRangeImport( 443*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 444*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 445*cdf0e10cSrcweir OControlElement::ElementType _eType 446*cdf0e10cSrcweir ); 447*cdf0e10cSrcweir 448*cdf0e10cSrcweir protected: 449*cdf0e10cSrcweir // SvXMLImportContext overridables 450*cdf0e10cSrcweir virtual void StartElement( 451*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList ); 452*cdf0e10cSrcweir 453*cdf0e10cSrcweir // OPropertyImport overridables 454*cdf0e10cSrcweir virtual bool handleAttribute( sal_uInt16 _nNamespaceKey, 455*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 456*cdf0e10cSrcweir const ::rtl::OUString& _rValue ); 457*cdf0e10cSrcweir }; 458*cdf0e10cSrcweir 459*cdf0e10cSrcweir //===================================================================== 460*cdf0e10cSrcweir //= OTextLikeImport 461*cdf0e10cSrcweir //===================================================================== 462*cdf0e10cSrcweir /** A specialized version of the <type>OControlImport</type> class, which handles 463*cdf0e10cSrcweir text like controls which have the convert-empty-to-null attribute</p> 464*cdf0e10cSrcweir */ 465*cdf0e10cSrcweir class OTextLikeImport : public OControlImport 466*cdf0e10cSrcweir { 467*cdf0e10cSrcweir private: 468*cdf0e10cSrcweir ::com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > m_xCursor; 469*cdf0e10cSrcweir ::com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > m_xOldCursor; 470*cdf0e10cSrcweir bool m_bEncounteredTextPara; 471*cdf0e10cSrcweir 472*cdf0e10cSrcweir public: 473*cdf0e10cSrcweir OTextLikeImport( 474*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 475*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 476*cdf0e10cSrcweir OControlElement::ElementType _eType 477*cdf0e10cSrcweir ); 478*cdf0e10cSrcweir 479*cdf0e10cSrcweir // SvXMLImportContext overridables 480*cdf0e10cSrcweir virtual void StartElement( 481*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 482*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 483*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 484*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 485*cdf0e10cSrcweir virtual void EndElement(); 486*cdf0e10cSrcweir 487*cdf0e10cSrcweir private: 488*cdf0e10cSrcweir void adjustDefaultControlProperty(); 489*cdf0e10cSrcweir void removeRedundantCurrentValue(); 490*cdf0e10cSrcweir }; 491*cdf0e10cSrcweir 492*cdf0e10cSrcweir //===================================================================== 493*cdf0e10cSrcweir //= OListAndComboImport 494*cdf0e10cSrcweir //===================================================================== 495*cdf0e10cSrcweir /** A specialized version of the <type>OControlImport</type> class, which handles 496*cdf0e10cSrcweir attributes / sub elements which are special to list and combo boxes 497*cdf0e10cSrcweir */ 498*cdf0e10cSrcweir class OListAndComboImport : public OControlImport 499*cdf0e10cSrcweir { 500*cdf0e10cSrcweir friend class OListOptionImport; 501*cdf0e10cSrcweir friend class OComboItemImport; 502*cdf0e10cSrcweir 503*cdf0e10cSrcweir protected: 504*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::rtl::OUString > 505*cdf0e10cSrcweir m_aListSource; 506*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::rtl::OUString > 507*cdf0e10cSrcweir m_aValueList; 508*cdf0e10cSrcweir 509*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< sal_Int16 > 510*cdf0e10cSrcweir m_aSelectedSeq; 511*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< sal_Int16 > 512*cdf0e10cSrcweir m_aDefaultSelectedSeq; 513*cdf0e10cSrcweir 514*cdf0e10cSrcweir ::rtl::OUString m_sCellListSource; /// the cell range which acts as list source for the control 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir sal_Int32 m_nEmptyListItems; /// number of empty list items encountered during reading 517*cdf0e10cSrcweir sal_Int32 m_nEmptyValueItems; /// number of empty value items encountered during reading 518*cdf0e10cSrcweir 519*cdf0e10cSrcweir sal_Bool m_bEncounteredLSAttrib; 520*cdf0e10cSrcweir sal_Bool m_bLinkWithIndexes; /** <TRUE/> if and only if we should use a cell value binding 521*cdf0e10cSrcweir which exchanges the selection index (instead of the selection text 522*cdf0e10cSrcweir */ 523*cdf0e10cSrcweir 524*cdf0e10cSrcweir public: 525*cdf0e10cSrcweir OListAndComboImport( 526*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 527*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 528*cdf0e10cSrcweir OControlElement::ElementType _eType 529*cdf0e10cSrcweir ); 530*cdf0e10cSrcweir 531*cdf0e10cSrcweir // SvXMLImportContext overridables 532*cdf0e10cSrcweir virtual void StartElement( 533*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 534*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 535*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 536*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 537*cdf0e10cSrcweir virtual void EndElement(); 538*cdf0e10cSrcweir 539*cdf0e10cSrcweir // OPropertyImport overridables 540*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 541*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 542*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 543*cdf0e10cSrcweir 544*cdf0e10cSrcweir // OControlImport ovrridables 545*cdf0e10cSrcweir virtual void doRegisterCellValueBinding( const ::rtl::OUString& _rBoundCellAddress ); 546*cdf0e10cSrcweir 547*cdf0e10cSrcweir protected: 548*cdf0e10cSrcweir void implPushBackLabel(const ::rtl::OUString& _rLabel); 549*cdf0e10cSrcweir void implPushBackValue(const ::rtl::OUString& _rValue); 550*cdf0e10cSrcweir 551*cdf0e10cSrcweir void implEmptyLabelFound(); 552*cdf0e10cSrcweir void implEmptyValueFound(); 553*cdf0e10cSrcweir 554*cdf0e10cSrcweir void implSelectCurrentItem(); 555*cdf0e10cSrcweir void implDefaultSelectCurrentItem(); 556*cdf0e10cSrcweir }; 557*cdf0e10cSrcweir SV_DECL_IMPL_REF(OListAndComboImport); 558*cdf0e10cSrcweir 559*cdf0e10cSrcweir //===================================================================== 560*cdf0e10cSrcweir //= OListOptionImport 561*cdf0e10cSrcweir //===================================================================== 562*cdf0e10cSrcweir /** helper class for importing a single <form:option> element. 563*cdf0e10cSrcweir */ 564*cdf0e10cSrcweir class OListOptionImport 565*cdf0e10cSrcweir :public SvXMLImportContext 566*cdf0e10cSrcweir { 567*cdf0e10cSrcweir OListAndComboImportRef m_xListBoxImport; 568*cdf0e10cSrcweir 569*cdf0e10cSrcweir public: 570*cdf0e10cSrcweir OListOptionImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 571*cdf0e10cSrcweir const OListAndComboImportRef& _rListBox); 572*cdf0e10cSrcweir 573*cdf0e10cSrcweir virtual void StartElement( 574*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 575*cdf0e10cSrcweir }; 576*cdf0e10cSrcweir 577*cdf0e10cSrcweir //===================================================================== 578*cdf0e10cSrcweir //= OComboItemImport 579*cdf0e10cSrcweir //===================================================================== 580*cdf0e10cSrcweir /** helper class for importing a single <form:item> element. 581*cdf0e10cSrcweir */ 582*cdf0e10cSrcweir class OComboItemImport 583*cdf0e10cSrcweir :public SvXMLImportContext 584*cdf0e10cSrcweir { 585*cdf0e10cSrcweir OListAndComboImportRef m_xListBoxImport; 586*cdf0e10cSrcweir 587*cdf0e10cSrcweir public: 588*cdf0e10cSrcweir OComboItemImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 589*cdf0e10cSrcweir const OListAndComboImportRef& _rListBox); 590*cdf0e10cSrcweir 591*cdf0e10cSrcweir protected: 592*cdf0e10cSrcweir // SvXMLImportContext overridables 593*cdf0e10cSrcweir virtual void StartElement( 594*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 595*cdf0e10cSrcweir }; 596*cdf0e10cSrcweir 597*cdf0e10cSrcweir //===================================================================== 598*cdf0e10cSrcweir //= OContainerImport 599*cdf0e10cSrcweir //===================================================================== 600*cdf0e10cSrcweir // BASE must be a derivee of OElementImport 601*cdf0e10cSrcweir template <class BASE> 602*cdf0e10cSrcweir class OContainerImport 603*cdf0e10cSrcweir :public BASE 604*cdf0e10cSrcweir ,public ODefaultEventAttacherManager 605*cdf0e10cSrcweir { 606*cdf0e10cSrcweir protected: 607*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > 608*cdf0e10cSrcweir m_xMeAsContainer; 609*cdf0e10cSrcweir ::rtl::OUString m_sWrapperElementName; 610*cdf0e10cSrcweir 611*cdf0e10cSrcweir protected: 612*cdf0e10cSrcweir OContainerImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 613*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 614*cdf0e10cSrcweir const sal_Char* _pWrapperElementName) 615*cdf0e10cSrcweir :BASE(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer) 616*cdf0e10cSrcweir ,m_sWrapperElementName(::rtl::OUString::createFromAscii(_pWrapperElementName)) 617*cdf0e10cSrcweir { 618*cdf0e10cSrcweir } 619*cdf0e10cSrcweir 620*cdf0e10cSrcweir // SvXMLImportContext overridables 621*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 622*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 623*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 624*cdf0e10cSrcweir virtual void EndElement(); 625*cdf0e10cSrcweir 626*cdf0e10cSrcweir protected: 627*cdf0e10cSrcweir // OElementImport overridables 628*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 629*cdf0e10cSrcweir createElement(); 630*cdf0e10cSrcweir 631*cdf0e10cSrcweir // create the child context for the given control type 632*cdf0e10cSrcweir virtual SvXMLImportContext* implCreateControlWrapper( 633*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName) = 0; 634*cdf0e10cSrcweir }; 635*cdf0e10cSrcweir 636*cdf0e10cSrcweir //===================================================================== 637*cdf0e10cSrcweir //= OColumnImport 638*cdf0e10cSrcweir //===================================================================== 639*cdf0e10cSrcweir /** helper class importing a single grid column (without the <form:column> element wrapping 640*cdf0e10cSrcweir the column). 641*cdf0e10cSrcweir 642*cdf0e10cSrcweir <p>BASE (the template argument) must be a derivee of OControlImport</p> 643*cdf0e10cSrcweir */ 644*cdf0e10cSrcweir template <class BASE> 645*cdf0e10cSrcweir class OColumnImport : public BASE 646*cdf0e10cSrcweir { 647*cdf0e10cSrcweir protected: 648*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridColumnFactory > 649*cdf0e10cSrcweir m_xColumnFactory; 650*cdf0e10cSrcweir 651*cdf0e10cSrcweir public: 652*cdf0e10cSrcweir OColumnImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 653*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 654*cdf0e10cSrcweir OControlElement::ElementType _eType); 655*cdf0e10cSrcweir 656*cdf0e10cSrcweir protected: 657*cdf0e10cSrcweir // OElementImport overridables 658*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 659*cdf0e10cSrcweir createElement(); 660*cdf0e10cSrcweir }; 661*cdf0e10cSrcweir 662*cdf0e10cSrcweir //===================================================================== 663*cdf0e10cSrcweir //= OColumnWrapperImport 664*cdf0e10cSrcweir //===================================================================== 665*cdf0e10cSrcweir class OColumnWrapperImport : public SvXMLImportContext 666*cdf0e10cSrcweir { 667*cdf0e10cSrcweir protected: 668*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > 669*cdf0e10cSrcweir m_xOwnAttributes; 670*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > 671*cdf0e10cSrcweir m_xParentContainer; 672*cdf0e10cSrcweir OFormLayerXMLImport_Impl& m_rFormImport; 673*cdf0e10cSrcweir IEventAttacherManager& m_rEventManager; 674*cdf0e10cSrcweir 675*cdf0e10cSrcweir public: 676*cdf0e10cSrcweir OColumnWrapperImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 677*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer); 678*cdf0e10cSrcweir 679*cdf0e10cSrcweir // SvXMLImportContext overridables 680*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 681*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 682*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 683*cdf0e10cSrcweir virtual void StartElement( 684*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 685*cdf0e10cSrcweir protected: 686*cdf0e10cSrcweir OControlImport* implCreateChildContext( 687*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 688*cdf0e10cSrcweir OControlElement::ElementType _eType); 689*cdf0e10cSrcweir }; 690*cdf0e10cSrcweir 691*cdf0e10cSrcweir //===================================================================== 692*cdf0e10cSrcweir //= OGridImport 693*cdf0e10cSrcweir //===================================================================== 694*cdf0e10cSrcweir typedef OContainerImport< OControlImport > OGridImport_Base; 695*cdf0e10cSrcweir /** helper class importing a single <form:grid> element 696*cdf0e10cSrcweir */ 697*cdf0e10cSrcweir class OGridImport : public OGridImport_Base 698*cdf0e10cSrcweir { 699*cdf0e10cSrcweir public: 700*cdf0e10cSrcweir OGridImport( 701*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 702*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer, 703*cdf0e10cSrcweir OControlElement::ElementType _eType); 704*cdf0e10cSrcweir 705*cdf0e10cSrcweir protected: 706*cdf0e10cSrcweir // OContainerImport overridables 707*cdf0e10cSrcweir virtual SvXMLImportContext* implCreateControlWrapper( 708*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName); 709*cdf0e10cSrcweir }; 710*cdf0e10cSrcweir 711*cdf0e10cSrcweir //===================================================================== 712*cdf0e10cSrcweir //= OFormImport 713*cdf0e10cSrcweir //===================================================================== 714*cdf0e10cSrcweir typedef OContainerImport< OElementImport > OFormImport_Base; 715*cdf0e10cSrcweir /** helper class importing a single <form:form> element 716*cdf0e10cSrcweir */ 717*cdf0e10cSrcweir class OFormImport : public OFormImport_Base 718*cdf0e10cSrcweir { 719*cdf0e10cSrcweir public: 720*cdf0e10cSrcweir OFormImport( 721*cdf0e10cSrcweir OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const ::rtl::OUString& _rName, 722*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer 723*cdf0e10cSrcweir ); 724*cdf0e10cSrcweir 725*cdf0e10cSrcweir protected: 726*cdf0e10cSrcweir // SvXMLImportContext overridables 727*cdf0e10cSrcweir virtual SvXMLImportContext* CreateChildContext( 728*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 729*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 730*cdf0e10cSrcweir virtual void StartElement( 731*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList); 732*cdf0e10cSrcweir virtual void EndElement(); 733*cdf0e10cSrcweir 734*cdf0e10cSrcweir // OContainerImport overridables 735*cdf0e10cSrcweir virtual SvXMLImportContext* implCreateControlWrapper( 736*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName); 737*cdf0e10cSrcweir 738*cdf0e10cSrcweir // OPropertyImport overridables 739*cdf0e10cSrcweir virtual bool handleAttribute(sal_uInt16 _nNamespaceKey, 740*cdf0e10cSrcweir const ::rtl::OUString& _rLocalName, 741*cdf0e10cSrcweir const ::rtl::OUString& _rValue); 742*cdf0e10cSrcweir 743*cdf0e10cSrcweir OControlImport* implCreateChildContext( 744*cdf0e10cSrcweir sal_uInt16 _nPrefix, const ::rtl::OUString& _rLocalName, 745*cdf0e10cSrcweir OControlElement::ElementType _eType ); 746*cdf0e10cSrcweir 747*cdf0e10cSrcweir 748*cdf0e10cSrcweir void implTranslateStringListProperty(const ::rtl::OUString& _rPropertyName, const ::rtl::OUString& _rValue); 749*cdf0e10cSrcweir }; 750*cdf0e10cSrcweir 751*cdf0e10cSrcweir //===================================================================== 752*cdf0e10cSrcweir //= OXMLDataSourceImport 753*cdf0e10cSrcweir //===================================================================== 754*cdf0e10cSrcweir class OXMLDataSourceImport : public SvXMLImportContext 755*cdf0e10cSrcweir { 756*cdf0e10cSrcweir public: 757*cdf0e10cSrcweir OXMLDataSourceImport( SvXMLImport& _rImport 758*cdf0e10cSrcweir ,sal_uInt16 nPrfx 759*cdf0e10cSrcweir ,const ::rtl::OUString& rLName 760*cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList 761*cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xElement); 762*cdf0e10cSrcweir }; 763*cdf0e10cSrcweir 764*cdf0e10cSrcweir #define _INCLUDING_FROM_ELEMENTIMPORT_HXX_ 765*cdf0e10cSrcweir #include "elementimport_impl.hxx" 766*cdf0e10cSrcweir #undef _INCLUDING_FROM_ELEMENTIMPORT_HXX_ 767*cdf0e10cSrcweir 768*cdf0e10cSrcweir //......................................................................... 769*cdf0e10cSrcweir } // namespace xmloff 770*cdf0e10cSrcweir //......................................................................... 771*cdf0e10cSrcweir 772*cdf0e10cSrcweir #endif // _XMLOFF_FORMS_ELEMENTIMPORT_HXX_ 773*cdf0e10cSrcweir 774