1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 //.........................................................................
42 //.........................................................................
44 class OFormLayerXMLImport_Impl
;
46 //=====================================================================
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
56 DECLARE_STL_USTRINGACCESS_MAP( ElementType
, MapString2Element
);
57 static MapString2Element s_sElementTranslations
;
63 static ElementType
getElementType(const OUString
& _rName
);
66 //=====================================================================
68 //=====================================================================
69 /** implements common behaviour for importing forms, controls and columns
72 :public OPropertyImport
73 ,public IEventAttacher
74 ,public OStackedLogging
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
>
89 /// the element we're creating. Valid after StartElement
90 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>
92 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
>
95 bool m_bImplicitGenericAttributeHandling
;
101 @param _rEventManager
102 the event attacher manager for the control beeing imported
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
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();
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
);
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
>
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; }
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 //=====================================================================
181 //=====================================================================
182 /** helper class for importing the description of a single control
185 :public OElementImport
186 ,public OValuePropertiesMetaData
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
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
>
201 /** the address of the calc cell which the control model should be bound to,
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
;
216 // for use by derived classes only
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
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
);
244 void setElementType(OControlElement::ElementType _eType
) { m_eElementType
= _eType
; }
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/>.
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
& );
276 // OElementImport overridables
277 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>
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
;
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
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
320 OUString m_sReferringControls
; // the list of ids of controls referring to the one beeing imported
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 //=====================================================================
341 //=====================================================================
342 class OPasswordImport
: public OControlImport
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 //=====================================================================
359 //=====================================================================
360 class ORadioImport
: public OImagePositionImport
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
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
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
392 // OPropertyImport overridables
393 virtual bool handleAttribute(sal_uInt16 _nNamespaceKey
,
394 const OUString
& _rLocalName
,
395 const OUString
& _rValue
);
398 //=====================================================================
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
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
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
428 sal_Int32 m_nStepSizeValue
;
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
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 //=====================================================================
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
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
;
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();
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
;
493 ::com::sun::star::uno::Sequence
< OUString
>
495 ::com::sun::star::uno::Sequence
< OUString
>
498 ::com::sun::star::uno::Sequence
< sal_Int16
>
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
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
);
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 <form:option> element.
553 class OListOptionImport
554 :public SvXMLImportContext
556 OListAndComboImportRef m_xListBoxImport
;
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 //=====================================================================
568 //=====================================================================
569 /** helper class for importing a single <form:item> element.
571 class OComboItemImport
572 :public SvXMLImportContext
574 OListAndComboImportRef m_xListBoxImport
;
577 OComboItemImport(SvXMLImport
& _rImport
, sal_uInt16 _nPrefix
, const OUString
& _rName
,
578 const OListAndComboImportRef
& _rListBox
);
581 // SvXMLImportContext overridables
582 virtual void StartElement(
583 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& _rxAttrList
);
586 //=====================================================================
588 //=====================================================================
589 // BASE must be a derivee of OElementImport
590 template <class BASE
>
591 class OContainerImport
593 ,public ODefaultEventAttacherManager
596 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
>
598 OUString m_sWrapperElementName
;
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();
616 // OElementImport overridables
617 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>
620 // create the child context for the given control type
621 virtual SvXMLImportContext
* implCreateControlWrapper(
622 sal_uInt16 _nPrefix
, const OUString
& _rLocalName
) = 0;
625 //=====================================================================
627 //=====================================================================
628 /** helper class importing a single grid column (without the <form:column> element wrapping
631 <p>BASE (the template argument) must be a derivee of OControlImport</p>
633 template <class BASE
>
634 class OColumnImport
: public BASE
637 ::com::sun::star::uno::Reference
< ::com::sun::star::form::XGridColumnFactory
>
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
);
646 // OElementImport overridables
647 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>
651 //=====================================================================
652 //= OColumnWrapperImport
653 //=====================================================================
654 class OColumnWrapperImport
: public SvXMLImportContext
657 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>
659 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
>
661 OFormLayerXMLImport_Impl
& m_rFormImport
;
662 IEventAttacherManager
& m_rEventManager
;
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
);
675 OControlImport
* implCreateChildContext(
676 sal_uInt16 _nPrefix
, const OUString
& _rLocalName
,
677 OControlElement::ElementType _eType
);
680 //=====================================================================
682 //=====================================================================
683 typedef OContainerImport
< OControlImport
> OGridImport_Base
;
684 /** helper class importing a single <form:grid> element
686 class OGridImport
: public OGridImport_Base
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
);
695 // OContainerImport overridables
696 virtual SvXMLImportContext
* implCreateControlWrapper(
697 sal_uInt16 _nPrefix
, const OUString
& _rLocalName
);
700 //=====================================================================
702 //=====================================================================
703 typedef OContainerImport
< OElementImport
> OFormImport_Base
;
704 /** helper class importing a single <form:form> element
706 class OFormImport
: public OFormImport_Base
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
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
746 OXMLDataSourceImport( SvXMLImport
& _rImport
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: */