bump product version to 4.1.6.2
[LibreOffice.git] / xmloff / source / forms / elementimport.hxx
blobb9792808b905ea027bdf2d62aae08988d56a5c1f
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 _XMLOFF_FORMS_ELEMENTIMPORT_HXX_
21 #define _XMLOFF_FORMS_ELEMENTIMPORT_HXX_
23 #include "propertyimport.hxx"
24 #include "controlelement.hxx"
25 #include "valueproperties.hxx"
26 #include "eventimport.hxx"
27 #include "logging.hxx"
28 #include "property_description.hxx"
30 #include <com/sun/star/text/XTextCursor.hpp>
31 #include <com/sun/star/container/XNameContainer.hpp>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 #include <com/sun/star/form/XGridColumnFactory.hpp>
34 #include <com/sun/star/script/XEventAttacherManager.hpp>
36 #include <comphelper/stl_types.hxx>
38 class XMLTextStyleContext;
39 //.........................................................................
40 namespace xmloff
42 //.........................................................................
44 class OFormLayerXMLImport_Impl;
46 //=====================================================================
47 //= OElementNameMap
48 //=====================================================================
49 const OControlElement::ElementType& operator ++(OControlElement::ElementType& _e);
51 /** helper class which allows fast translation of xml tag names into element types.
53 class OElementNameMap : public OControlElement
55 protected:
56 DECLARE_STL_USTRINGACCESS_MAP( ElementType, MapString2Element );
57 static MapString2Element s_sElementTranslations;
59 protected:
60 OElementNameMap() { }
62 public:
63 static ElementType getElementType(const OUString& _rName);
66 //=====================================================================
67 //= OElementImport
68 //=====================================================================
69 /** implements common behaviour for importing forms, controls and columns
71 class OElementImport
72 :public OPropertyImport
73 ,public IEventAttacher
74 ,public OStackedLogging
76 protected:
77 OUString m_sServiceName; // the service name as extracted from the service-name attribute
78 OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
79 OFormLayerXMLImport_Impl& m_rFormImport; // the form import context
80 IEventAttacherManager& m_rEventManager; // the event attacher manager
82 const XMLTextStyleContext* m_pStyleElement; // the XML element which describes the style we encountered
83 // while reading our element
85 /// the parent container to insert the new element into
86 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
87 m_xParentContainer;
89 /// the element we're creating. Valid after StartElement
90 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
91 m_xElement;
92 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
93 m_xInfo;
95 bool m_bImplicitGenericAttributeHandling;
97 public:
98 /** ctor
99 @param _rImport
100 the importer
101 @param _rEventManager
102 the event attacher manager for the control beeing imported
103 @param _nPrefix
104 the namespace prefix
105 @param _rName
106 the element name
107 @param _rAttributeMap
108 the attribute map to be used for translating attributes into properties
109 @param _rxParentContainer
110 the container in which the new element should be inserted
112 OElementImport(
113 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
114 sal_uInt16 _nPrefix, const OUString& _rName,
115 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
117 virtual ~OElementImport();
119 protected:
120 // SvXMLImportContext overridables
121 virtual void StartElement(
122 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
123 virtual SvXMLImportContext* CreateChildContext(
124 sal_uInt16 _nPrefix, const OUString& _rLocalName,
125 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
126 virtual void EndElement();
128 // OPropertyImport overridables
129 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
130 const OUString& _rLocalName,
131 const OUString& _rValue);
133 // IEventAttacher
134 virtual void registerEvents(
135 const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& _rEvents
138 /** create the (uninitialized) element which is to represent the read data
140 <p>The default implementation uses <member>m_xORB</member> to create a object with <member>m_sServiceName</member>.
142 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
143 createElement();
145 protected:
146 /** can be used to handle properties where the attribute default and the property default differ.
147 <p>In such case, if the property had the attribute default upon writing, nothing is read, so upon reading,
148 the property is still at it's own default (which is not the attribute default).<p/>
149 <p>This method, if told the attribute and the property, and the (implied) attribute default, sets the
150 property value as if the attribute was encountered.</p>
151 @see encounteredAttribute
153 void simulateDefaultedAttribute(const sal_Char* _pAttributeName, const OUString& _rPropertyName, const sal_Char* _pAttributeDefault);
155 /** to be called from within handleAttribute, checks whether the given attribute is covered by our generic
156 attribute handler mechanisms
158 bool tryGenericAttribute( sal_uInt16 _nNamespaceKey, const OUString& _rLocalName, const OUString& _rValue );
160 /** controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived class
161 must do this explicitly at a suitable place in its own |handleAttribute|
163 void disableImplicitGenericAttributeHandling() { m_bImplicitGenericAttributeHandling = false; }
165 private:
166 OUString implGetDefaultName() const;
167 void implApplyGenericProperties();
168 void implApplySpecificProperties();
170 /** sets the style properties which have been read for the element (if any)
172 void implSetStyleProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject );
174 PropertyGroups::const_iterator impl_matchPropertyGroup( const PropertyGroups& i_propertyGroups ) const;
176 virtual OUString determineDefaultServiceName() const;
179 //=====================================================================
180 //= OControlImport
181 //=====================================================================
182 /** helper class for importing the description of a single control
184 class OControlImport
185 :public OElementImport
186 ,public OValuePropertiesMetaData
188 protected:
189 OUString m_sControlId;
190 OControlElement::ElementType m_eElementType;
192 PropertyValueArray m_aValueProperties;
193 // the value properties (value, current-value, min-value, max-value) require some special
194 // handling
196 // we fake the attributes our base class gets: we add the attributes of the outer wrapper
197 // element which encloses us
198 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >
199 m_xOuterAttributes;
201 /** the address of the calc cell which the control model should be bound to,
202 if applicable
204 OUString m_sBoundCellAddress;
206 /** name of a value binding (xforms:bind attribute) */
207 OUString m_sBindingID;
209 /** name of a list binding (form:xforms-list-source attribute) */
210 OUString m_sListBindingID;
212 /** name of a submission (xforms:submission attribute) */
213 OUString m_sSubmissionID;
215 protected:
216 // for use by derived classes only
217 OControlImport(
218 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
219 sal_uInt16 _nPrefix, const OUString& _rName,
220 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
223 public:
224 OControlImport(
225 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
226 sal_uInt16 _nPrefix, const OUString& _rName,
227 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
228 OControlElement::ElementType _eType
231 // SvXMLImportContext overridables
232 virtual void StartElement(
233 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
234 virtual void EndElement();
236 // OPropertyImport overridables
237 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
238 const OUString& _rLocalName,
239 const OUString& _rValue);
241 void addOuterAttributes(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxOuterAttribs);
243 protected:
244 void setElementType(OControlElement::ElementType _eType) { m_eElementType = _eType; }
246 protected:
247 void implTranslateValueProperty(
248 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >& _rxPropInfo,
249 ::com::sun::star::beans::PropertyValue& /* [in/out] */ _rPropValue);
251 virtual OUString determineDefaultServiceName() const;
253 /** registers the given cell address as value binding address for our element
255 <p>The default implementation simply calls registerCellValueBinding at our import
256 context, but you may want to override this behaviour.</p>
258 @param _rBoundCellAddress
259 the cell address to register for our element. Must not be <NULL/>.
260 @precond
261 we have a valid element (m_xElement)
263 virtual void doRegisterCellValueBinding( const OUString& _rBoundCellAddress );
265 /** register the given XForms binding */
266 virtual void doRegisterXFormsValueBinding( const OUString& );
268 /** register the given XForms list binding */
269 virtual void doRegisterXFormsListBinding( const OUString& );
271 /** register the given XForms submission */
272 virtual void doRegisterXFormsSubmission( const OUString& );
274 protected:
276 // OElementImport overridables
277 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
278 createElement();
281 // TODO:
282 // this whole mechanism doesn't scale. Instead of deriving even more classes for every new attribute,
283 // we should have dedicated attribute handlers
284 // The rest of xmloff implements it this way - why don't we do, too?
286 //=====================================================================
287 //= OImagePositionImport
288 //=====================================================================
289 class OImagePositionImport : public OControlImport
291 sal_Int16 m_nImagePosition;
292 sal_Int16 m_nImageAlign;
293 sal_Bool m_bHaveImagePosition;
295 public:
296 OImagePositionImport(
297 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
298 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
299 OControlElement::ElementType _eType
302 protected:
303 // SvXMLImportContext overridables
304 virtual void StartElement(
305 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
307 // OPropertyImport overridables
308 virtual bool handleAttribute( sal_uInt16 _nNamespaceKey,
309 const OUString& _rLocalName,
310 const OUString& _rValue
314 //=====================================================================
315 //= OReferredControlImport
316 //=====================================================================
317 class OReferredControlImport : public OControlImport
319 protected:
320 OUString m_sReferringControls; // the list of ids of controls referring to the one beeing imported
322 public:
323 OReferredControlImport(
324 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
325 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
326 OControlElement::ElementType _eType
329 // SvXMLImportContext overridables
330 virtual void StartElement(
331 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
333 // OPropertyImport overridables
334 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
335 const OUString& _rLocalName,
336 const OUString& _rValue);
339 //=====================================================================
340 //= OPasswordImport
341 //=====================================================================
342 class OPasswordImport : public OControlImport
344 public:
345 OPasswordImport(
346 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
347 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
348 OControlElement::ElementType _eType
351 // OPropertyImport overridables
352 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
353 const OUString& _rLocalName,
354 const OUString& _rValue);
357 //=====================================================================
358 //= ORadioImport
359 //=====================================================================
360 class ORadioImport : public OImagePositionImport
362 public:
363 ORadioImport(
364 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
365 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
366 OControlElement::ElementType _eType
369 protected:
370 // OPropertyImport overridables
371 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
372 const OUString& _rLocalName,
373 const OUString& _rValue);
376 //=====================================================================
377 //= OURLReferenceImport
378 //=====================================================================
379 /** a specialized version of the <type>OControlImport</type> class, which is able
380 to handle attributes which denote URLs (and stored relative)
382 class OURLReferenceImport : public OImagePositionImport
384 public:
385 OURLReferenceImport(
386 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
387 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
388 OControlElement::ElementType _eType
391 protected:
392 // OPropertyImport overridables
393 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
394 const OUString& _rLocalName,
395 const OUString& _rValue);
398 //=====================================================================
399 //= OButtonImport
400 //=====================================================================
401 /** A specialized version of the <type>OControlImport</type> class, which handles
402 the target frame for image and command buttons
404 class OButtonImport : public OURLReferenceImport
406 public:
407 OButtonImport(
408 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
409 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
410 OControlElement::ElementType _eType
413 protected:
414 // SvXMLImportContext overridables
415 virtual void StartElement(
416 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
419 //=====================================================================
420 //= OValueRangeImport
421 //=====================================================================
422 /** A specialized version of the <type>OControlImport</type> class, which imports
423 the value-range elements
425 class OValueRangeImport : public OControlImport
427 private:
428 sal_Int32 m_nStepSizeValue;
430 public:
431 OValueRangeImport(
432 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
433 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
434 OControlElement::ElementType _eType
437 protected:
438 // SvXMLImportContext overridables
439 virtual void StartElement(
440 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList );
442 // OPropertyImport overridables
443 virtual bool handleAttribute( sal_uInt16 _nNamespaceKey,
444 const OUString& _rLocalName,
445 const OUString& _rValue );
448 //=====================================================================
449 //= OTextLikeImport
450 //=====================================================================
451 /** A specialized version of the <type>OControlImport</type> class, which handles
452 text like controls which have the convert-empty-to-null attribute</p>
454 class OTextLikeImport : public OControlImport
456 private:
457 ::com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > m_xCursor;
458 ::com::sun::star::uno::Reference< com::sun::star::text::XTextCursor > m_xOldCursor;
459 bool m_bEncounteredTextPara;
461 public:
462 OTextLikeImport(
463 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
464 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
465 OControlElement::ElementType _eType
468 // SvXMLImportContext overridables
469 virtual void StartElement(
470 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
471 virtual SvXMLImportContext* CreateChildContext(
472 sal_uInt16 _nPrefix, const OUString& _rLocalName,
473 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
474 virtual void EndElement();
476 private:
477 void adjustDefaultControlProperty();
478 void removeRedundantCurrentValue();
481 //=====================================================================
482 //= OListAndComboImport
483 //=====================================================================
484 /** A specialized version of the <type>OControlImport</type> class, which handles
485 attributes / sub elements which are special to list and combo boxes
487 class OListAndComboImport : public OControlImport
489 friend class OListOptionImport;
490 friend class OComboItemImport;
492 protected:
493 ::com::sun::star::uno::Sequence< OUString >
494 m_aListSource;
495 ::com::sun::star::uno::Sequence< OUString >
496 m_aValueList;
498 ::com::sun::star::uno::Sequence< sal_Int16 >
499 m_aSelectedSeq;
500 ::com::sun::star::uno::Sequence< sal_Int16 >
501 m_aDefaultSelectedSeq;
503 OUString m_sCellListSource; /// the cell range which acts as list source for the control
505 sal_Int32 m_nEmptyListItems; /// number of empty list items encountered during reading
506 sal_Int32 m_nEmptyValueItems; /// number of empty value items encountered during reading
508 sal_Bool m_bEncounteredLSAttrib;
509 sal_Bool m_bLinkWithIndexes; /** <TRUE/> if and only if we should use a cell value binding
510 which exchanges the selection index (instead of the selection text
513 public:
514 OListAndComboImport(
515 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
516 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
517 OControlElement::ElementType _eType
520 // SvXMLImportContext overridables
521 virtual void StartElement(
522 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
523 virtual SvXMLImportContext* CreateChildContext(
524 sal_uInt16 _nPrefix, const OUString& _rLocalName,
525 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
526 virtual void EndElement();
528 // OPropertyImport overridables
529 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
530 const OUString& _rLocalName,
531 const OUString& _rValue);
533 // OControlImport ovrridables
534 virtual void doRegisterCellValueBinding( const OUString& _rBoundCellAddress );
536 protected:
537 void implPushBackLabel(const OUString& _rLabel);
538 void implPushBackValue(const OUString& _rValue);
540 void implEmptyLabelFound();
541 void implEmptyValueFound();
543 void implSelectCurrentItem();
544 void implDefaultSelectCurrentItem();
546 SV_DECL_IMPL_REF(OListAndComboImport);
548 //=====================================================================
549 //= OListOptionImport
550 //=====================================================================
551 /** helper class for importing a single &lt;form:option&gt; element.
553 class OListOptionImport
554 :public SvXMLImportContext
556 OListAndComboImportRef m_xListBoxImport;
558 public:
559 OListOptionImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName,
560 const OListAndComboImportRef& _rListBox);
562 virtual void StartElement(
563 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
566 //=====================================================================
567 //= OComboItemImport
568 //=====================================================================
569 /** helper class for importing a single &lt;form:item&gt; element.
571 class OComboItemImport
572 :public SvXMLImportContext
574 OListAndComboImportRef m_xListBoxImport;
576 public:
577 OComboItemImport(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName,
578 const OListAndComboImportRef& _rListBox);
580 protected:
581 // SvXMLImportContext overridables
582 virtual void StartElement(
583 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
586 //=====================================================================
587 //= OContainerImport
588 //=====================================================================
589 // BASE must be a derivee of OElementImport
590 template <class BASE>
591 class OContainerImport
592 :public BASE
593 ,public ODefaultEventAttacherManager
595 protected:
596 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
597 m_xMeAsContainer;
598 OUString m_sWrapperElementName;
600 protected:
601 OContainerImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
602 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
603 const sal_Char* _pWrapperElementName)
604 :BASE(_rImport, _rEventManager, _nPrefix, _rName, _rxParentContainer)
605 ,m_sWrapperElementName(OUString::createFromAscii(_pWrapperElementName))
609 // SvXMLImportContext overridables
610 virtual SvXMLImportContext* CreateChildContext(
611 sal_uInt16 _nPrefix, const OUString& _rLocalName,
612 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
613 virtual void EndElement();
615 protected:
616 // OElementImport overridables
617 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
618 createElement();
620 // create the child context for the given control type
621 virtual SvXMLImportContext* implCreateControlWrapper(
622 sal_uInt16 _nPrefix, const OUString& _rLocalName) = 0;
625 //=====================================================================
626 //= OColumnImport
627 //=====================================================================
628 /** helper class importing a single grid column (without the &lt;form:column&gt; element wrapping
629 the column).
631 <p>BASE (the template argument) must be a derivee of OControlImport</p>
633 template <class BASE>
634 class OColumnImport : public BASE
636 protected:
637 ::com::sun::star::uno::Reference< ::com::sun::star::form::XGridColumnFactory >
638 m_xColumnFactory;
640 public:
641 OColumnImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
642 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
643 OControlElement::ElementType _eType);
645 protected:
646 // OElementImport overridables
647 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
648 createElement();
651 //=====================================================================
652 //= OColumnWrapperImport
653 //=====================================================================
654 class OColumnWrapperImport : public SvXMLImportContext
656 protected:
657 ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >
658 m_xOwnAttributes;
659 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
660 m_xParentContainer;
661 OFormLayerXMLImport_Impl& m_rFormImport;
662 IEventAttacherManager& m_rEventManager;
664 public:
665 OColumnWrapperImport(OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
666 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer);
668 // SvXMLImportContext overridables
669 virtual SvXMLImportContext* CreateChildContext(
670 sal_uInt16 _nPrefix, const OUString& _rLocalName,
671 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
672 virtual void StartElement(
673 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
674 protected:
675 OControlImport* implCreateChildContext(
676 sal_uInt16 _nPrefix, const OUString& _rLocalName,
677 OControlElement::ElementType _eType);
680 //=====================================================================
681 //= OGridImport
682 //=====================================================================
683 typedef OContainerImport< OControlImport > OGridImport_Base;
684 /** helper class importing a single &lt;form:grid&gt; element
686 class OGridImport : public OGridImport_Base
688 public:
689 OGridImport(
690 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
691 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer,
692 OControlElement::ElementType _eType);
694 protected:
695 // OContainerImport overridables
696 virtual SvXMLImportContext* implCreateControlWrapper(
697 sal_uInt16 _nPrefix, const OUString& _rLocalName);
700 //=====================================================================
701 //= OFormImport
702 //=====================================================================
703 typedef OContainerImport< OElementImport > OFormImport_Base;
704 /** helper class importing a single &lt;form:form&gt; element
706 class OFormImport : public OFormImport_Base
708 public:
709 OFormImport(
710 OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager, sal_uInt16 _nPrefix, const OUString& _rName,
711 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxParentContainer
714 protected:
715 // SvXMLImportContext overridables
716 virtual SvXMLImportContext* CreateChildContext(
717 sal_uInt16 _nPrefix, const OUString& _rLocalName,
718 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
719 virtual void StartElement(
720 const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
721 virtual void EndElement();
723 // OContainerImport overridables
724 virtual SvXMLImportContext* implCreateControlWrapper(
725 sal_uInt16 _nPrefix, const OUString& _rLocalName);
727 // OPropertyImport overridables
728 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey,
729 const OUString& _rLocalName,
730 const OUString& _rValue);
732 OControlImport* implCreateChildContext(
733 sal_uInt16 _nPrefix, const OUString& _rLocalName,
734 OControlElement::ElementType _eType );
737 void implTranslateStringListProperty(const OUString& _rPropertyName, const OUString& _rValue);
740 //=====================================================================
741 //= OXMLDataSourceImport
742 //=====================================================================
743 class OXMLDataSourceImport : public SvXMLImportContext
745 public:
746 OXMLDataSourceImport( SvXMLImport& _rImport
747 ,sal_uInt16 nPrfx
748 ,const OUString& rLName
749 ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
750 ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xElement);
753 #define _INCLUDING_FROM_ELEMENTIMPORT_HXX_
754 #include "elementimport_impl.hxx"
755 #undef _INCLUDING_FROM_ELEMENTIMPORT_HXX_
757 //.........................................................................
758 } // namespace xmloff
759 //.........................................................................
761 #endif // _XMLOFF_FORMS_ELEMENTIMPORT_HXX_
763 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */