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