LibreOffice Module xmloff (master) 1
elementexport.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 <memory>
26
27#include <com/sun/star/beans/XPropertySet.hpp>
28#include <com/sun/star/script/ScriptEventDescriptor.hpp>
29#include <xmloff/xmlexp.hxx>
30#include "propertyexport.hxx"
31#include "callbacks.hxx"
32#include "controlelement.hxx"
33#include "valueproperties.hxx"
34
36namespace xmloff
37{
38
39 //= OElementExport
41 {
42 protected:
43 css::uno::Sequence< css::script::ScriptEventDescriptor >
45
46 std::unique_ptr<SvXMLElementExport> m_pXMLElement; // XML element doing the concrete startElement etc.
47
48 public:
50 const css::uno::Reference< css::beans::XPropertySet >& _rxProps,
51 const css::uno::Sequence< css::script::ScriptEventDescriptor >& _rEvents);
52 virtual ~OElementExport();
53
54 void doExport();
55
56 protected:
58 virtual const char* getXMLElementName() const = 0;
60 virtual void examine();
62 virtual void exportAttributes();
64 virtual void exportSubTags();
65
68 void exportEvents();
69
72 virtual void exportServiceNameAttribute();
73
75 virtual void implStartElement(const char* _pName);
76
78 virtual void implEndElement();
79 };
80
81 //= OControlExport
85 :public OControlElement
87 ,public OElementExport
88 {
89 protected:
91 // used below
92
93 OUString m_sControlId; // the control id to use when exporting
94 OUString m_sReferringControls; // list of referring controls (i.e. their id's)
95 sal_Int16 m_nClassId; // class id of the control we're representing
96 ElementType m_eType; // (XML) type of the control we're representing
97 CCAFlags m_nIncludeCommon; // common control attributes to include
98 DAFlags m_nIncludeDatabase; // common database attributes to include
99 SCAFlags m_nIncludeSpecial; // special attributes to include
100 EAFlags m_nIncludeEvents; // events to include
101 BAFlags m_nIncludeBindings; // binding attributes to include
102
103 std::unique_ptr<SvXMLElementExport> m_pOuterElement; // XML element doing the concrete startElement etc. for the outer element
104
105 public:
118 const css::uno::Reference< css::beans::XPropertySet >& _rxControl,
119 OUString _sControlId,
120 OUString _sReferringControls,
121 const css::uno::Sequence< css::script::ScriptEventDescriptor >& _rxEvents);
122
123 protected:
125 virtual void implStartElement(const char* _pName) override;
126
128 virtual void implEndElement() override;
129
131 virtual const char* getOuterXMLElementName() const;
132
133 // get the name of the XML element
134 virtual const char* getXMLElementName() const override;
135
138 virtual void examine() override;
139
142
145
147 virtual void exportAttributes() override;
148
151 void exportSubTags() override;
152
159
165
171
176
180
194
200
207 void getSequenceInt16PropertyAsSet(const OUString& _rPropertyName, Int16Set& _rOut);
208
212 void exportCellBindingAttributes( bool _bIncludeListLinkageType );
213
216
220
223
228
232
240 bool controlHasActiveDataBinding() const;
241
244 OUString getScalarListSourceValue() const;
245
257 };
258
259 //= OColumnExport
263 {
264 public:
269 const css::uno::Reference< css::beans::XPropertySet >& _rxControl,
270 const OUString& _rControlId,
271 const css::uno::Sequence< css::script::ScriptEventDescriptor >& _rxEvents);
272
273 virtual ~OColumnExport() override;
274
275 protected:
276 // OControlExport overridables
277 virtual const char* getOuterXMLElementName() const override;
278 virtual void exportServiceNameAttribute() override;
279 virtual void exportAttributes() override;
280
281 // OElementExport overridables
282 virtual void examine() override;
283 };
284
285 //= OFormExport
292 :public OControlElement
293 ,public OElementExport
294 {
296 public:
300 const css::uno::Reference< css::beans::XPropertySet >& _rxForm,
301 const css::uno::Sequence< css::script::ScriptEventDescriptor >& _rxEvents
302 );
303
304 protected:
305 virtual const char* getXMLElementName() const override;
306 virtual void exportSubTags() override;
307 virtual void exportAttributes() override;
308 };
309} // namespace xmloff
310
311/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper class for exporting a grid column.
virtual void examine() override
examine the control.
OColumnExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxControl, const OUString &_rControlId, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
ctor
virtual void exportServiceNameAttribute() override
add the service-name attribute to the export context
virtual ~OColumnExport() override
virtual const char * getOuterXMLElementName() const override
get the name of the outer XML element
virtual void exportAttributes() override
export the attributes
helper for translating between control types and XML tags
Helper class for handling xml elements representing a form control.
void exportCellBindingAttributes(bool _bIncludeListLinkageType)
exports the attribute which descrives a cell value binding of a control in a spreadsheet document
o3tl::sorted_vector< sal_Int16 > Int16Set
bool controlHasActiveDataBinding() const
determines whether the control we're exporting has an active data binding.
virtual void implEndElement() override
ends the XML element
void exportOuterAttributes()
exports the attributes for the outer element
std::unique_ptr< SvXMLElementExport > m_pOuterElement
void exportXFormsBindAttributes()
exports the attribute(s) which bind this control to XForms
virtual void implStartElement(const char *_pName) override
start the XML element
void exportXFormsListAttributes()
exports the attribute(s) which bind the list of a list control to XForms
void exportXFormsSubmissionAttributes()
exports the attribute(s) for an XForms submission
void getSequenceInt16PropertyAsSet(const OUString &_rPropertyName, Int16Set &_rOut)
gets a Sequence< sal_Int16 > property value as set of sal_Int16's
virtual void exportAttributes() override
export the attributes
void exportListSourceAsAttribute()
exports the ListSource property of a control as attribute
virtual const char * getXMLElementName() const override
get the name of the XML element
void exportSubTags() override
writes everything which needs to be represented as sub tag
void exportDatabaseAttributes()
adds database attributes to the XMLExport context given
void exportCommonControlAttributes()
adds common control attributes to the XMLExport context given
OControlExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxControl, OUString _sControlId, OUString _sReferringControls, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
constructs an object capable of exporting controls
bool controlHasUserSuppliedListEntries() const
determines whether the list entries (of a combo or list box) are supplied by the user
void exportBindingAttributes()
adds the XML attributes which are related to binding controls to external values and/or list sources
void exportListSourceAsElements()
exports the ListSource property of a control as XML elements
virtual void examine() override
examine the control.
void exportCellListSourceRange()
exports the attribute which descrives a cell range which acts as list source for a list-like control
void exportInnerAttributes()
exports the attributes for the inner element
virtual const char * getOuterXMLElementName() const
get the name of the outer XML element
void exportImagePositionAttributes()
exports the attribute(s) for the ImagePosition property
void exportGenericHandlerAttributes()
adds the attributes which are handled via generic IPropertyHandlers
void exportSpecialAttributes()
adds attributes which are special to a control type to the export context's attribute list
OUString getScalarListSourceValue() const
retrieves the string specifying the ListSource of a list or combo box
virtual void implEndElement()
ends the XML element
virtual void exportSubTags()
export any sub tags
void exportEvents()
exports the events (as script:events tag)
OElementExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxProps, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rEvents)
virtual void implStartElement(const char *_pName)
start the XML element
virtual void exportAttributes()
export the attributes
virtual const char * getXMLElementName() const =0
get the name of the XML element
std::unique_ptr< SvXMLElementExport > m_pXMLElement
virtual void examine()
examine the element we're exporting
css::uno::Sequence< css::script::ScriptEventDescriptor > m_aEvents
virtual void exportServiceNameAttribute()
add the service-name attribute to the export context
Helper class for handling xml elements representing a form.
virtual const char * getXMLElementName() const override
get the name of the XML element
virtual void exportSubTags() override
export any sub tags
OFormExport(IFormsExportContext &_rContext, const css::uno::Reference< css::beans::XPropertySet > &_rxForm, const css::uno::Sequence< css::script::ScriptEventDescriptor > &_rxEvents)
constructs an object capable of exporting controls
virtual void exportAttributes() override
export the attributes
bool m_bCreateConnectionResourceElement
provides export related tools for attribute handling
SCAFlags
DAFlags
BAFlags
EAFlags
CCAFlags
ElementType