LibreOffice Module xmloff (master)  1
elementimport.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #pragma once
21 
22 #include <sal/config.h>
23 
24 #include "propertyimport.hxx"
25 #include "controlelement.hxx"
26 #include "valueproperties.hxx"
27 #include "eventimport.hxx"
28 #include "logging.hxx"
29 #include "property_description.hxx"
30 
31 #include <com/sun/star/text/XTextCursor.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <com/sun/star/form/XGridColumnFactory.hpp>
34 #include <com/sun/star/graphic/XGraphic.hpp>
35 #include <osl/diagnose.h>
36 
37 #include <map>
38 #include <vector>
39 
41 namespace xmloff
42 {
43 
44  class OFormLayerXMLImport_Impl;
45 
46  //= OElementNameMap
48 
52  {
53  typedef std::map<OUString, ElementType> MapString2Element;
54  static std::map<sal_Int32, ElementType> s_sElementTranslations2;
55 
56  OElementNameMap() = delete;
57 
58  public:
59  static ElementType getElementType(sal_Int32 nToken);
60  };
61 
62  //= OElementImport
66  :public OPropertyImport
67  ,public IEventAttacher
68  ,public OStackedLogging
69  {
70  protected:
71  OUString m_sServiceName; // the service name as extracted from the service-name attribute
72  OUString m_sName; // the name of the object (redundant, already contained in the base class' array)
73  OFormLayerXMLImport_Impl& m_rFormImport; // the form import context
74  IEventAttacherManager& m_rEventManager; // the event attacher manager
75 
76  const XMLTextStyleContext* m_pStyleElement; // the XML element which describes the style we encountered
77  // while reading our element
78 
80  css::uno::Reference< css::container::XNameContainer >
82 
84  css::uno::Reference< css::beans::XPropertySet >
86  css::uno::Reference< css::beans::XPropertySetInfo >
88 
90 
91  public:
103  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
104  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
105  );
106  virtual ~OElementImport() override;
107 
108  protected:
109  // SvXMLImportContext overridables
110  virtual void SAL_CALL startFastElement( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
111  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
112  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
113  sal_Int32 nElement,
114  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
115 
116  // OPropertyImport overridables
117  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
118 
119  // IEventAttacher
120  virtual void registerEvents(
121  const css::uno::Sequence< css::script::ScriptEventDescriptor >& _rEvents
122  ) override;
123 
128  virtual css::uno::Reference< css::beans::XPropertySet >
129  createElement();
130 
131  protected:
139  void simulateDefaultedAttribute(sal_Int32 nElement, const OUString& _rPropertyName, const char* _pAttributeDefault);
140 
144  bool tryGenericAttribute( sal_Int32 nElement, const OUString& _rValue );
145 
149  void disableImplicitGenericAttributeHandling() { m_bImplicitGenericAttributeHandling = false; }
150 
151  private:
152  OUString implGetDefaultName() const;
155 
156  PropertyGroups::const_iterator impl_matchPropertyGroup( const PropertyGroups& i_propertyGroups ) const;
157 
158  virtual OUString determineDefaultServiceName() const;
159  };
160 
161  //= OControlImport
165  :public OElementImport
167  {
168  protected:
169  OUString m_sControlId;
171 
173  // the value properties (value, current-value, min-value, max-value) require some special
174  // handling
175 
176  // we fake the attributes our base class gets: we add the attributes of the outer wrapper
177  // element which encloses us
178  css::uno::Reference< css::xml::sax::XFastAttributeList >
180 
185 
187  OUString m_sBindingID;
188 
191 
193  OUString m_sSubmissionID;
194 
195  protected:
196  // for use by derived classes only
198  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
199  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
200  );
201 
202  public:
204  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
205  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
207  );
208 
209  // SvXMLImportContext overridables
210  virtual void SAL_CALL startFastElement( sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
211  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
212 
213  // OPropertyImport overridables
214  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
215 
216  void addOuterAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxOuterAttribs);
217 
218  protected:
219  void setElementType(OControlElement::ElementType _eType) { m_eElementType = _eType; }
220 
221  protected:
222  static void implTranslateValueProperty(
223  const css::uno::Reference< css::beans::XPropertySetInfo >& _rxPropInfo,
224  css::beans::PropertyValue& /* [in/out] */ _rPropValue);
225 
226  virtual OUString determineDefaultServiceName() const override;
227 
238  virtual void doRegisterCellValueBinding( const OUString& _rBoundCellAddress );
239 
241  void doRegisterXFormsValueBinding( const OUString& );
242 
244  void doRegisterXFormsListBinding( const OUString& );
245 
247  void doRegisterXFormsSubmission( const OUString& );
248 
249  protected:
250 
251  // OElementImport overridables
252  virtual css::uno::Reference< css::beans::XPropertySet >
253  createElement() override;
254  };
255 
256  // TODO:
257  // this whole mechanism doesn't scale. Instead of deriving even more classes for every new attribute,
258  // we should have dedicated attribute handlers
259  // The rest of xmloff implements it this way - why don't we do, too?
260 
261  //= OImagePositionImport
263  {
264  css::uno::Reference<css::graphic::XGraphic> m_xGraphic;
265  sal_Int16 m_nImagePosition;
266  sal_Int16 m_nImageAlign;
268 
269  public:
271  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
272  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
274  );
275 
276  protected:
277  // SvXMLImportContext overridables
278  virtual void SAL_CALL startFastElement(
279  sal_Int32 nElement,
280  const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList) override;
281 
282  // OPropertyImport overridables
283  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
284  };
285 
286  //= OReferredControlImport
288  {
289  OUString m_sReferringControls; // the list of ids of controls referring to the one being imported
290 
291  public:
293  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
294  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
295  );
296 
297  // SvXMLImportContext overridables
298  virtual void SAL_CALL startFastElement(
299  sal_Int32 nElement,
300  const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList) override;
301 
302  // OPropertyImport overridables
303  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
304  };
305 
306  //= OPasswordImport
308  {
309  public:
311  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
312  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
314  );
315 
316  // OPropertyImport overridables
317  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
318  };
319 
320  //= ORadioImport
322  {
323  public:
324  ORadioImport(
325  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
326  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
328  );
329 
330  protected:
331  // OPropertyImport overridables
332  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
333  };
334 
335  //= OURLReferenceImport
340  {
341  public:
343  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
344  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
346  );
347 
348  protected:
349  // OPropertyImport overridables
350  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
351  };
352 
353  //= OButtonImport
358  {
359  public:
361  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
362  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
364  );
365 
366  protected:
367  // SvXMLImportContext overridables
368  virtual void SAL_CALL startFastElement(
369  sal_Int32 nElement,
370  const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList) override;
371  };
372 
373  //= OValueRangeImport
378  {
379  private:
380  sal_Int32 m_nStepSizeValue;
381 
382  public:
384  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
385  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
387  );
388 
389  protected:
390  // SvXMLImportContext overridables
391  virtual void SAL_CALL startFastElement(
392  sal_Int32 nElement,
393  const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList ) override;
394 
395  // OPropertyImport overridables
396  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
397  };
398 
399  //= OTextLikeImport
404  {
405  private:
406  css::uno::Reference< css::text::XTextCursor > m_xCursor;
407  css::uno::Reference< css::text::XTextCursor > m_xOldCursor;
409 
410  public:
412  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
413  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
415  );
416 
417  // SvXMLImportContext overridables
418  virtual void SAL_CALL startFastElement(
419  sal_Int32 nElement,
420  const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList) override;
421  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
422  sal_Int32 nElement,
423  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
424  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
425 
426  private:
429  };
430 
431  //= OListAndComboImport
436  {
437  friend class OListOptionImport;
438  friend class OComboItemImport;
439 
440  protected:
441  std::vector<OUString >
443  std::vector< OUString >
445 
446  std::vector< sal_Int16 >
448  std::vector< sal_Int16 >
450 
451  OUString m_sCellListSource;
452 
453  sal_Int32 m_nEmptyListItems;
454  sal_Int32 m_nEmptyValueItems;
455 
461  public:
463  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
464  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
466  );
467 
468  // SvXMLImportContext overridables
469  virtual void SAL_CALL startFastElement( sal_Int32 nElement,
470  const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override;
471  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
472  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
473  sal_Int32 nElement,
474  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
475 
476  // OPropertyImport overridables
477  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
478 
479  // OControlImport overridables
480  virtual void doRegisterCellValueBinding( const OUString& _rBoundCellAddress ) override;
481 
482  protected:
483  void implPushBackLabel(const OUString& _rLabel);
484  void implPushBackValue(const OUString& _rValue);
485 
486  void implEmptyLabelFound();
487  void implEmptyValueFound();
488 
489  void implSelectCurrentItem();
491  };
493 
494  //= OListOptionImport
498  :public SvXMLImportContext
499  {
500  OListAndComboImportRef m_xListBoxImport;
501 
502  public:
503  OListOptionImport(SvXMLImport& _rImport,
504  const OListAndComboImportRef& _rListBox);
505 
506  virtual void SAL_CALL startFastElement( sal_Int32 nElement,
507  const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override;
508  };
509 
510  //= OComboItemImport
514  :public SvXMLImportContext
515  {
516  OListAndComboImportRef m_xListBoxImport;
517 
518  public:
519  OComboItemImport(SvXMLImport& _rImport,
520  const OListAndComboImportRef& _rListBox);
521 
522  protected:
523  // SvXMLImportContext overridables
524  virtual void SAL_CALL startFastElement( sal_Int32 nElement,
525  const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override;
526  };
527 
528 
529  //= OColumnImport
535  template <class BASE>
536  class OColumnImport : public BASE
537  {
538  css::uno::Reference< css::form::XGridColumnFactory >
540 
541  public:
543  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
545 
546  protected:
547  // OElementImport overridables
548  virtual css::uno::Reference< css::beans::XPropertySet >
549  createElement() override;
550  };
551 
552  //= OColumnWrapperImport
554  {
555  css::uno::Reference< css::xml::sax::XFastAttributeList >
557  css::uno::Reference< css::container::XNameContainer >
561 
562  public:
564  sal_Int32 nElement,
565  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer);
566 
567  // SvXMLImportContext overridables
568  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
569  sal_Int32 nElement,
570  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
571  virtual void SAL_CALL startFastElement(
572  sal_Int32 nElement,
573  const css::uno::Reference< css::xml::sax::XFastAttributeList >& _rxAttrList) override;
574  private:
576  sal_Int32 nElement,
578  };
579 
583  {
584  public:
585  OGridImport(
586  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
587  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
589 
590  // SvXMLImportContext overridables
591  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
592  sal_Int32 nElement,
593  const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
594  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
595 
596  private:
597  // OElementImport overridables
598  virtual css::uno::Reference< css::beans::XPropertySet > createElement() override;
599 
600  css::uno::Reference< css::container::XNameContainer > m_xMeAsContainer;
601  };
602 
606  {
607  public:
608  OFormImport(
609  OFormLayerXMLImport_Impl& _rImport, IEventAttacherManager& _rEventManager,
610  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer
611  );
612 
613  private:
614  // SvXMLImportContext overridables
615  virtual void SAL_CALL startFastElement(
616  sal_Int32 nElement,
617  const css::uno::Reference< css::xml::sax::XFastAttributeList>& xAttrList) override;
618  virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
619 
620  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
621  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override;
622 
623  // OPropertyImport overridables
624  virtual bool handleAttribute(sal_Int32 nElement, const OUString& _rValue) override;
625 
626  // OElementImport overridables
627  virtual css::uno::Reference< css::beans::XPropertySet >
628  createElement() override;
629 
630  virtual OUString determineDefaultServiceName() const override;
631  void implTranslateStringListProperty(const OUString& _rPropertyName, const OUString& _rValue);
632 
633  css::uno::Reference< css::container::XNameContainer > m_xMeAsContainer;
634  };
635 
636  //= OXMLDataSourceImport
638  {
639  public:
641  ,const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList
642  ,const css::uno::Reference< css::beans::XPropertySet >& _xElement);
643  };
644 
645  //= OColumnImport
646  template <class BASE>
648  IEventAttacherManager& _rEventManager,
649  const css::uno::Reference< css::container::XNameContainer >& _rxParentContainer,
651  :BASE(_rImport, _rEventManager, _rxParentContainer, _eType)
652  ,m_xColumnFactory(_rxParentContainer, css::uno::UNO_QUERY)
653  {
654  OSL_ENSURE(m_xColumnFactory.is(), "OColumnImport::OColumnImport: invalid parent container (no factory)!");
655  }
656 
657  // OElementImport overridables
658  template <class BASE>
659  css::uno::Reference< css::beans::XPropertySet > OColumnImport< BASE >::createElement()
660  {
661  css::uno::Reference< css::beans::XPropertySet > xReturn;
662  // no call to the base class' method. We have to use the grid column factory
663  if (m_xColumnFactory.is())
664  {
665  // create the column
666  xReturn = m_xColumnFactory->createColumn(this->m_sServiceName);
667  OSL_ENSURE(xReturn.is(), "OColumnImport::createElement: the factory returned an invalid object!");
668  }
669  return xReturn;
670  }
671 
672 } // namespace xmloff
673 
674 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
helper class for importing a single element.
OUString m_sListBindingID
name of a list binding (form:xforms-list-source attribute)
OReferredControlImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
OGridImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
virtual OUString determineDefaultServiceName() const
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
IEventAttacherManager & m_rEventManager
OListAndComboImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
if and only if we should use a cell value binding which exchanges the selection index (instead...
::std::vector< PropertyDescriptionList > PropertyGroups
std::map< OUString, ElementType > MapString2Element
OListAndComboImportRef m_xListBoxImport
css::uno::Reference< css::container::XNameContainer > m_xMeAsContainer
OTextLikeImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
OUString m_sSubmissionID
name of a submission (xforms:submission attribute)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
rtl::Reference< OListAndComboImport > OListAndComboImportRef
OButtonImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
css::uno::Reference< css::text::XTextCursor > m_xCursor
OURLReferenceImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
helper class importing a single grid column (without the element wrapping the column)...
helper class for importing a single element.
helper for translating between control types and XML tags
OColumnImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
A specialized version of the OControlImport class, which handles the target frame for im...
static void implTranslateValueProperty(const css::uno::Reference< css::beans::XPropertySetInfo > &_rxPropInfo, css::beans::PropertyValue &_rPropValue)
void implTranslateStringListProperty(const OUString &_rPropertyName, const OUString &_rValue)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
helper class which allows fast translation of xml tag names into element types.
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
::std::vector< css::beans::PropertyValue > PropertyValueArray
helper class importing a single element
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
create the (uninitialized) element which is to represent the read data
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
a specialized version of the OControlImport class, which is able to handle attributes wh...
sal_Int32 m_nEmptyValueItems
number of empty list items encountered during reading
OFormLayerXMLImport_Impl & m_rFormImport
A specialized version of the OControlImport class, which handles text like controls whic...
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
OColumnWrapperImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, sal_Int32 nElement, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
A specialized version of the OControlImport class, which handles attributes / sub elemen...
css::uno::Reference< css::container::XNameContainer > m_xParentContainer
void doRegisterXFormsListBinding(const OUString &)
register the given XForms list binding
OControlImport * implCreateChildContext(sal_Int32 nElement, OControlElement::ElementType _eType)
css::uno::Reference< css::graphic::XGraphic > m_xGraphic
virtual OUString determineDefaultServiceName() const override
OComboItemImport(SvXMLImport &_rImport, const OListAndComboImportRef &_rListBox)
OXMLDataSourceImport(SvXMLImport &_rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const css::uno::Reference< css::beans::XPropertySet > &_xElement)
ORadioImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
OFormImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
OListOptionImport(SvXMLImport &_rImport, const OListAndComboImportRef &_rListBox)
const OControlElement::ElementType & operator++(OControlElement::ElementType &_e)
OListAndComboImportRef m_xListBoxImport
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
OElementImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
ctor
OValueRangeImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
css::uno::Reference< css::xml::sax::XFastAttributeList > m_xOuterAttributes
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
helper class importing a single element
bool m_bEncounteredLSAttrib
number of empty value items encountered during reading
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
BASE
sal_Int32 m_nEmptyListItems
the cell range which acts as list source for the control
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
create the (uninitialized) element which is to represent the read data
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
OUString implGetDefaultName() const
OUString m_sBindingID
name of a value binding (xforms:bind attribute)
void implPushBackLabel(const OUString &_rLabel)
A specialized version of the OControlImport class, which imports the value-range element...
OControlImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer)
virtual OUString determineDefaultServiceName() const override
OImagePositionImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
PropertyGroups::const_iterator impl_matchPropertyGroup(const PropertyGroups &i_propertyGroups) const
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
virtual void doRegisterCellValueBinding(const OUString &_rBoundCellAddress)
registers the given cell address as value binding address for our element
ElementType
IEventAttacherManager & m_rEventManager
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
std::vector< OUString > m_aListSource
bool tryGenericAttribute(sal_Int32 nElement, const OUString &_rValue)
to be called from within handleAttribute, checks whether the given attribute is covered by our generi...
static ElementType getElementType(sal_Int32 nToken)
virtual void doRegisterCellValueBinding(const OUString &_rBoundCellAddress) override
registers the given cell address as value binding address for our element
void doRegisterXFormsValueBinding(const OUString &)
register the given XForms binding
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
OControlElement::ElementType m_eElementType
void setElementType(OControlElement::ElementType _eType)
OFormLayerXMLImport_Impl & m_rFormImport
This class deliberately does not support XWeak, to improve performance when loading large documents...
Definition: xmlictxt.hxx:44
css::uno::Reference< css::xml::sax::XFastAttributeList > m_xOwnAttributes
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
helper class for importing the description of a single control
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
static std::map< sal_Int32, ElementType > s_sElementTranslations2
virtual ~OElementImport() override
implements common behaviour for importing forms, controls and columns
std::vector< sal_Int16 > m_aSelectedSeq
std::vector< sal_Int16 > m_aDefaultSelectedSeq
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
PropertyValueArray m_aValueProperties
Helper class for importing property values.
virtual void registerEvents(const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents) override
virtual css::uno::Reference< css::beans::XPropertySet > createElement()
create the (uninitialized) element which is to represent the read data
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &) override
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
create the (uninitialized) element which is to represent the read data
virtual css::uno::Reference< css::beans::XPropertySet > createElement() override
css::uno::Reference< css::beans::XPropertySet > m_xElement
the element we're creating. Valid after StartElement
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
css::uno::Reference< css::text::XTextCursor > m_xOldCursor
OUString m_sBoundCellAddress
the address of the calc cell which the control model should be bound to, if applicable ...
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
void implPushBackValue(const OUString &_rValue)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
void disableImplicitGenericAttributeHandling()
controls whether |handleAttribute| implicitly calls |tryGenericAttribute|, or whether the derived cla...
virtual bool handleAttribute(sal_Int32 nElement, const OUString &_rValue) override
handle one single attribute.
void doRegisterXFormsSubmission(const OUString &)
register the given XForms submission
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override
OPasswordImport(OFormLayerXMLImport_Impl &_rImport, IEventAttacherManager &_rEventManager, const css::uno::Reference< css::container::XNameContainer > &_rxParentContainer, OControlElement::ElementType _eType)
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
css::uno::Reference< css::container::XNameContainer > m_xMeAsContainer
const XMLTextStyleContext * m_pStyleElement
void simulateDefaultedAttribute(sal_Int32 nElement, const OUString &_rPropertyName, const char *_pAttributeDefault)
can be used to handle properties where the attribute default and the property default differ...
void addOuterAttributes(const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxOuterAttribs)
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
std::vector< OUString > m_aValueList
css::uno::Reference< css::form::XGridColumnFactory > m_xColumnFactory
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
endFastElement is called before a context will be destructed, but after an elements context has been ...
css::uno::Reference< css::container::XNameContainer > m_xParentContainer
the parent container to insert the new element into