bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / source / forms / elementimport.hxx
bloba1a4344ff03c592b012bad17ba45fe58d7b27bf7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_XMLOFF_SOURCE_FORMS_ELEMENTIMPORT_HXX
21 #define INCLUDED_XMLOFF_SOURCE_FORMS_ELEMENTIMPORT_HXX
23 #include <sal/config.h>
25 #include <map>
27 #include "propertyimport.hxx"
28 #include "controlelement.hxx"
29 #include "valueproperties.hxx"
30 #include "eventimport.hxx"
31 #include "logging.hxx"
32 #include "property_description.hxx"
34 #include <com/sun/star/text/XTextCursor.hpp>
35 #include <com/sun/star/container/XNameContainer.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/form/XGridColumnFactory.hpp>
38 #include <com/sun/star/script/XEventAttacherManager.hpp>
40 class XMLTextStyleContext;
41 namespace xmloff
44 class OFormLayerXMLImport_Impl;
46 //= OElementNameMap
47 const OControlElement::ElementType& operator ++(OControlElement::ElementType& _e);
49 /** helper class which allows fast translation of xml tag names into element types.
51 class OElementNameMap : public OControlElement
53 protected:
54 typedef std::map<OUString, ElementType> MapString2Element;
55 static MapString2Element s_sElementTranslations;
57 protected:
58 OElementNameMap() { }
60 public:
61 static ElementType getElementType(const OUString& _rName);
64 //= OElementImport
65 /** implements common behaviour for importing forms, controls and columns
67 class OElementImport
68 :public OPropertyImport
69 ,public IEventAttacher
70 ,public OStackedLogging
72 protected:
73 OUString m_sServiceName; // the service name as extracted from the service-name attribute
74 OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
75 OFormLayerXMLImport_Impl& m_rFormImport; // the form import context
76 IEventAttacherManager& m_rEventManager; // the event attacher manager
78 const XMLTextStyleContext* m_pStyleElement; // the XML element which describes the style we encountered
79 // while reading our element
81 /// the parent container to insert the new element into
82 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
83 m_xParentContainer;
85 /// the element we're creating. Valid after StartElement
86 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
87 m_xElement;
88 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
89 m_xInfo;
91 bool m_bImplicitGenericAttributeHandling;
93 public:
94 /** ctor
95 @param _rImport
96 the importer
97 @param _rEventManager
98 the event attacher manager for the control being imported
99 @param _nPrefix
100 the namespace prefix
101 @param _rName
102 the element name
103 @param _rAttributeMap
104 the attribute map to be used for translating attributes into properties
105 @param _rxParentContainer
106 the container in which the new element should be inserted
108 OElementImport(
109 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
110 sal_uInt16 _nPrefix, const OUString& _rName,
111 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
113 virtual ~OElementImport();
115 protected:
116 // SvXMLImportContext overridables
117 virtual void StartElement(
118 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
119 virtual SvXMLImportContext* CreateChildContext(
120 sal_uInt16 _nPrefix, const OUString& _rLocalName,
121 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
122 virtual void EndElement() SAL_OVERRIDE;
124 // OPropertyImport overridables
125 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
126 const OUString& _rLocalName,
127 const OUString& _rValue) SAL_OVERRIDE;
129 // IEventAttacher
130 virtual void registerEvents(
131 const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
132 ) SAL_OVERRIDE;
134 /** create the (uninitialized) element which is to represent the read data
136 <p>The default implementation uses <member>m_xORB</member> to create a object with <member>m_sServiceName</member>.
138 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
139 createElement();
141 protected:
142 /** can be used to handle properties where the attribute default and the property default differ.
143 <p>In such case, if the property had the attribute default upon writing, nothing is read, so upon reading,
144 the property is still at it's own default (which is not the attribute default).<p/>
145 <p>This method, if told the attribute and the property, and the (implied) attribute default, sets the
146 property value as if the attribute was encountered.</p>
147 @see encounteredAttribute
149 void simulateDefaultedAttribute(const sal_Char* _pAttributeName, const OUString& _rPropertyName, const sal_Char* _pAttributeDefault);
151 /** to be called from within handleAttribute, checks whether the given attribute is covered by our generic
152 attribute handler mechanisms
154 bool tryGenericAttribute( sal_uInt16 _nNamespaceKey, const OUString& _rLocalName, const OUString& _rValue );
156 /** controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class
157 must do this explicitly at a suitable place in its own |handleAttribute|
159 void disableImplicitGenericAttributeHandling() { m_bImplicitGenericAttributeHandling = false; }
161 private:
162 OUString implGetDefaultName() const;
163 void implApplyGenericProperties();
164 void implApplySpecificProperties();
166 /** sets the style properties which have been read for the element (if any)
168 void implSetStyleProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
170 PropertyGroups::const_iterator impl_matchPropertyGroup( const PropertyGroups& i_propertyGroups ) const;
172 virtual OUString determineDefaultServiceName() const;
175 //= OControlImport
176 /** helper class for importing the description of a single control
178 class OControlImport
179 :public OElementImport
180 ,public OValuePropertiesMetaData
182 protected:
183 OUString m_sControlId;
184 OControlElement::ElementType m_eElementType;
186 PropertyValueArray m_aValueProperties;
187 // the value properties (value, current-value, min-value, max-value) require some special
188 // handling
190 // we fake the attributes our base class gets: we add the attributes of the outer wrapper
191 // element which encloses us
192 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >
193 m_xOuterAttributes;
195 /** the address of the calc cell which the control model should be bound to,
196 if applicable
198 OUString m_sBoundCellAddress;
200 /** name of a value binding (xforms:bind attribute) */
201 OUString m_sBindingID;
203 /** name of a list binding (form:xforms-list-source attribute) */
204 OUString m_sListBindingID;
206 /** name of a submission (xforms:submission attribute) */
207 OUString m_sSubmissionID;
209 protected:
210 // for use by derived classes only
211 OControlImport(
212 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
213 sal_uInt16 _nPrefix, const OUString& _rName,
214 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
217 public:
218 OControlImport(
219 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
220 sal_uInt16 _nPrefix, const OUString& _rName,
221 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
222 OControlElement::ElementType _eType
225 // SvXMLImportContext overridables
226 virtual void StartElement(
227 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
228 virtual void EndElement() SAL_OVERRIDE;
230 // OPropertyImport overridables
231 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
232 const OUString& _rLocalName,
233 const OUString& _rValue) SAL_OVERRIDE;
235 void addOuterAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxOuterAttribs);
237 protected:
238 void setElementType(OControlElement::ElementType _eType) { m_eElementType = _eType; }
240 protected:
241 static void implTranslateValueProperty(
242 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo,
243 ::com::sun::star::beans::PropertyValue& /* [in/out] */ _rPropValue);
245 virtual OUString determineDefaultServiceName() const SAL_OVERRIDE;
247 /** registers the given cell address as value binding address for our element
249 <p>The default implementation simply calls registerCellValueBinding at our import
250 context, but you may want to override this behaviour.</p>
252 @param _rBoundCellAddress
253 the cell address to register for our element. Must not be <NULL/>.
254 @precond
255 we have a valid element (m_xElement)
257 virtual void doRegisterCellValueBinding( const OUString& _rBoundCellAddress );
259 /** register the given XForms binding */
260 void doRegisterXFormsValueBinding( const OUString& );
262 /** register the given XForms list binding */
263 void doRegisterXFormsListBinding( const OUString& );
265 /** register the given XForms submission */
266 void doRegisterXFormsSubmission( const OUString& );
268 protected:
270 // OElementImport overridables
271 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
272 createElement() SAL_OVERRIDE;
275 // TODO:
276 // this whole mechanism doesn't scale. Instead of deriving even more classes for every new attribute,
277 // we should have dedicated attribute handlers
278 // The rest of xmloff implements it this way - why don't we do, too?
280 //= OImagePositionImport
281 class OImagePositionImport : public OControlImport
283 sal_Int16 m_nImagePosition;
284 sal_Int16 m_nImageAlign;
285 bool m_bHaveImagePosition;
287 public:
288 OImagePositionImport(
289 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
290 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
291 OControlElement::ElementType _eType
294 protected:
295 // SvXMLImportContext overridables
296 virtual void StartElement(
297 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
299 // OPropertyImport overridables
300 virtual bool handleAttribute( sal_uInt16 _nNamespaceKey,
301 const OUString& _rLocalName,
302 const OUString& _rValue
303 ) SAL_OVERRIDE;
306 //= OReferredControlImport
307 class OReferredControlImport : public OControlImport
309 protected:
310 OUString m_sReferringControls; // the list of ids of controls referring to the one being imported
312 public:
313 OReferredControlImport(
314 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
315 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
316 OControlElement::ElementType _eType
319 // SvXMLImportContext overridables
320 virtual void StartElement(
321 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
323 // OPropertyImport overridables
324 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
325 const OUString& _rLocalName,
326 const OUString& _rValue) SAL_OVERRIDE;
329 //= OPasswordImport
330 class OPasswordImport : public OControlImport
332 public:
333 OPasswordImport(
334 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
335 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
336 OControlElement::ElementType _eType
339 // OPropertyImport overridables
340 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
341 const OUString& _rLocalName,
342 const OUString& _rValue) SAL_OVERRIDE;
345 //= ORadioImport
346 class ORadioImport : public OImagePositionImport
348 public:
349 ORadioImport(
350 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
351 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
352 OControlElement::ElementType _eType
355 protected:
356 // OPropertyImport overridables
357 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
358 const OUString& _rLocalName,
359 const OUString& _rValue) SAL_OVERRIDE;
362 //= OURLReferenceImport
363 /** a specialized version of the <type>OControlImport</type> class, which is able
364 to handle attributes which denote URLs (and stored relative)
366 class OURLReferenceImport : public OImagePositionImport
368 public:
369 OURLReferenceImport(
370 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
371 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
372 OControlElement::ElementType _eType
375 protected:
376 // OPropertyImport overridables
377 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
378 const OUString& _rLocalName,
379 const OUString& _rValue) SAL_OVERRIDE;
382 //= OButtonImport
383 /** A specialized version of the <type>OControlImport</type> class, which handles
384 the target frame for image and command buttons
386 class OButtonImport : public OURLReferenceImport
388 public:
389 OButtonImport(
390 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
391 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
392 OControlElement::ElementType _eType
395 protected:
396 // SvXMLImportContext overridables
397 virtual void StartElement(
398 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
401 //= OValueRangeImport
402 /** A specialized version of the <type>OControlImport</type> class, which imports
403 the value-range elements
405 class OValueRangeImport : public OControlImport
407 private:
408 sal_Int32 m_nStepSizeValue;
410 public:
411 OValueRangeImport(
412 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
413 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
414 OControlElement::ElementType _eType
417 protected:
418 // SvXMLImportContext overridables
419 virtual void StartElement(
420 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList ) SAL_OVERRIDE;
422 // OPropertyImport overridables
423 virtual bool handleAttribute( sal_uInt16 _nNamespaceKey,
424 const OUString& _rLocalName,
425 const OUString& _rValue ) SAL_OVERRIDE;
428 //= OTextLikeImport
429 /** A specialized version of the <type>OControlImport</type> class, which handles
430 text like controls which have the convert-empty-to-null attribute</p>
432 class OTextLikeImport : public OControlImport
434 private:
435 ::com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > m_xCursor;
436 ::com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > m_xOldCursor;
437 bool m_bEncounteredTextPara;
439 public:
440 OTextLikeImport(
441 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
442 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
443 OControlElement::ElementType _eType
446 // SvXMLImportContext overridables
447 virtual void StartElement(
448 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
449 virtual SvXMLImportContext* CreateChildContext(
450 sal_uInt16 _nPrefix, const OUString& _rLocalName,
451 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
452 virtual void EndElement() SAL_OVERRIDE;
454 private:
455 void adjustDefaultControlProperty();
456 void removeRedundantCurrentValue();
459 //= OListAndComboImport
460 /** A specialized version of the <type>OControlImport</type> class, which handles
461 attributes / sub elements which are special to list and combo boxes
463 class OListAndComboImport : public OControlImport
465 friend class OListOptionImport;
466 friend class OComboItemImport;
468 protected:
469 ::com::sun::star::uno::Sequence< OUString >
470 m_aListSource;
471 ::com::sun::star::uno::Sequence< OUString >
472 m_aValueList;
474 ::com::sun::star::uno::Sequence< sal_Int16 >
475 m_aSelectedSeq;
476 ::com::sun::star::uno::Sequence< sal_Int16 >
477 m_aDefaultSelectedSeq;
479 OUString m_sCellListSource; /// the cell range which acts as list source for the control
481 sal_Int32 m_nEmptyListItems; /// number of empty list items encountered during reading
482 sal_Int32 m_nEmptyValueItems; /// number of empty value items encountered during reading
484 bool m_bEncounteredLSAttrib;
485 bool m_bLinkWithIndexes; /** <TRUE/> if and only if we should use a cell value binding
486 which exchanges the selection index (instead of the selection text
489 public:
490 OListAndComboImport(
491 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
492 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
493 OControlElement::ElementType _eType
496 // SvXMLImportContext overridables
497 virtual void StartElement(
498 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
499 virtual SvXMLImportContext* CreateChildContext(
500 sal_uInt16 _nPrefix, const OUString& _rLocalName,
501 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
502 virtual void EndElement() SAL_OVERRIDE;
504 // OPropertyImport overridables
505 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
506 const OUString& _rLocalName,
507 const OUString& _rValue) SAL_OVERRIDE;
509 // OControlImport ovrridables
510 virtual void doRegisterCellValueBinding( const OUString& _rBoundCellAddress ) SAL_OVERRIDE;
512 protected:
513 void implPushBackLabel(const OUString& _rLabel);
514 void implPushBackValue(const OUString& _rValue);
516 void implEmptyLabelFound();
517 void implEmptyValueFound();
519 void implSelectCurrentItem();
520 void implDefaultSelectCurrentItem();
522 typedef tools::SvRef<OListAndComboImport> OListAndComboImportRef;
524 //= OListOptionImport
525 /** helper class for importing a single &lt;form:option&gt; element.
527 class OListOptionImport
528 :public SvXMLImportContext
530 OListAndComboImportRef m_xListBoxImport;
532 public:
533 OListOptionImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName,
534 const OListAndComboImportRef& _rListBox);
536 virtual void StartElement(
537 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
540 //= OComboItemImport
541 /** helper class for importing a single &lt;form:item&gt; element.
543 class OComboItemImport
544 :public SvXMLImportContext
546 OListAndComboImportRef m_xListBoxImport;
548 public:
549 OComboItemImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName,
550 const OListAndComboImportRef& _rListBox);
552 protected:
553 // SvXMLImportContext overridables
554 virtual void StartElement(
555 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
558 //= OContainerImport
559 // BASE must be a derivee of OElementImport
560 template <class BASE>
561 class OContainerImport
562 :public BASE
563 ,public ODefaultEventAttacherManager
565 protected:
566 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
567 m_xMeAsContainer;
568 OUString m_sWrapperElementName;
570 protected:
571 OContainerImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
572 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
573 const sal_Char* _pWrapperElementName)
574 :BASE(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
575 ,m_sWrapperElementName(OUString::createFromAscii(_pWrapperElementName))
579 // SvXMLImportContext overridables
580 virtual SvXMLImportContext* CreateChildContext(
581 sal_uInt16 _nPrefix, const OUString& _rLocalName,
582 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
583 virtual void EndElement();
585 protected:
586 // OElementImport overridables
587 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
588 createElement();
590 // create the child context for the given control type
591 virtual SvXMLImportContext* implCreateControlWrapper(
592 sal_uInt16 _nPrefix, const OUString& _rLocalName) = 0;
595 //= OColumnImport
596 /** helper class importing a single grid column (without the &lt;form:column&gt; element wrapping
597 the column).
599 <p>BASE (the template argument) must be a derivee of OControlImport</p>
601 template <class BASE>
602 class OColumnImport : public BASE
604 protected:
605 ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridColumnFactory >
606 m_xColumnFactory;
608 public:
609 OColumnImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
610 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
611 OControlElement::ElementType _eType);
613 protected:
614 // OElementImport overridables
615 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
616 createElement();
619 //= OColumnWrapperImport
620 class OColumnWrapperImport : public SvXMLImportContext
622 protected:
623 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >
624 m_xOwnAttributes;
625 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
626 m_xParentContainer;
627 OFormLayerXMLImport_Impl& m_rFormImport;
628 IEventAttacherManager& m_rEventManager;
630 public:
631 OColumnWrapperImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
632 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer);
634 // SvXMLImportContext overridables
635 virtual SvXMLImportContext* CreateChildContext(
636 sal_uInt16 _nPrefix, const OUString& _rLocalName,
637 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
638 virtual void StartElement(
639 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
640 protected:
641 OControlImport* implCreateChildContext(
642 sal_uInt16 _nPrefix, const OUString& _rLocalName,
643 OControlElement::ElementType _eType);
646 //= OGridImport
647 typedef OContainerImport< OControlImport > OGridImport_Base;
648 /** helper class importing a single &lt;form:grid&gt; element
650 class OGridImport : public OGridImport_Base
652 public:
653 OGridImport(
654 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
655 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
656 OControlElement::ElementType _eType);
658 protected:
659 // OContainerImport overridables
660 virtual SvXMLImportContext* implCreateControlWrapper(
661 sal_uInt16 _nPrefix, const OUString& _rLocalName) SAL_OVERRIDE;
664 //= OFormImport
665 typedef OContainerImport< OElementImport > OFormImport_Base;
666 /** helper class importing a single &lt;form:form&gt; element
668 class OFormImport : public OFormImport_Base
670 public:
671 OFormImport(
672 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
673 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
676 protected:
677 // SvXMLImportContext overridables
678 virtual SvXMLImportContext* CreateChildContext(
679 sal_uInt16 _nPrefix, const OUString& _rLocalName,
680 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
681 virtual void StartElement(
682 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList) SAL_OVERRIDE;
683 virtual void EndElement() SAL_OVERRIDE;
685 // OContainerImport overridables
686 virtual SvXMLImportContext* implCreateControlWrapper(
687 sal_uInt16 _nPrefix, const OUString& _rLocalName) SAL_OVERRIDE;
689 // OPropertyImport overridables
690 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
691 const OUString& _rLocalName,
692 const OUString& _rValue) SAL_OVERRIDE;
694 OControlImport* implCreateChildContext(
695 sal_uInt16 _nPrefix, const OUString& _rLocalName,
696 OControlElement::ElementType _eType );
698 virtual OUString determineDefaultServiceName() const SAL_OVERRIDE;
699 void implTranslateStringListProperty(const OUString& _rPropertyName, const OUString& _rValue);
702 //= OXMLDataSourceImport
703 class OXMLDataSourceImport : public SvXMLImportContext
705 public:
706 OXMLDataSourceImport( SvXMLImport& _rImport
707 ,sal_uInt16 nPrfx
708 ,const OUString& rLName
709 ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
710 ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xElement);
713 #define _INCLUDING_FROM_ELEMENTIMPORT_HXX_
714 #include "elementimport_impl.hxx"
715 #undef _INCLUDING_FROM_ELEMENTIMPORT_HXX_
717 } // namespace xmloff
719 #endif // INCLUDED_XMLOFF_SOURCE_FORMS_ELEMENTIMPORT_HXX
721 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */