android: Update app-specific/MIME type icons
[LibreOffice.git] / include / xmloff / formlayerexport.hxx
blob823e99875104d6fed5b8d176eca0bf8f1540b8cc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_XMLOFF_FORMLAYEREXPORT_HXX
21 #define INCLUDED_XMLOFF_FORMLAYEREXPORT_HXX
23 #include <sal/config.h>
24 #include <xmloff/dllapi.h>
25 #include <rtl/ustring.hxx>
26 #include <salhelper/simplereferenceobject.hxx>
27 #include <memory>
29 namespace com::sun::star::awt {
30 class XControlModel;
33 namespace com::sun::star::drawing { class XDrawPage; }
34 namespace com::sun::star::beans { class XPropertySet; }
35 namespace com::sun::star::uno { template <typename > class Reference; }
37 class SvXMLExport;
39 namespace xmloff
43 class OFormLayerXMLExport_Impl;
44 class OFormsRootExport;
47 //= OFormLayerXMLExport
49 /** provides functionality for exporting a complete form layer.
51 class XMLOFF_DLLPUBLIC OFormLayerXMLExport final
52 :public ::salhelper::SimpleReferenceObject
54 // impl class
55 std::unique_ptr<OFormLayerXMLExport_Impl> m_pImpl;
57 SAL_DLLPRIVATE virtual ~OFormLayerXMLExport() override;
59 public:
60 SAL_DLLPRIVATE OFormLayerXMLExport(SvXMLExport& _rContext);
62 /** initializes some internal structures for fast access to the given page
64 <p>This method has to be called before you use getControlId for controls on the given page.
65 This way a performance optimization can be done for faster access to the control ids</p>
67 @return
68 <TRUE/> if the page has been examined before. If <FALSE/> is returned, this is a serious error.
70 @see getControlId
71 @see examineForms
73 bool seekPage(
74 const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage);
76 /** get the id for the given control
78 <p>The page the control belongs to must have been examined and sought to.</p>
80 @param _rxControl
81 the control which's id should be retrieved. Must not be <NULL/>.
83 @see examineForms
84 @see seekPage
87 SAL_DLLPRIVATE OUString getControlId(
88 const css::uno::Reference< css::beans::XPropertySet >& _rxControl);
90 /** retrieves the style name for the control's number style.
92 <p>For performance reasons, this method is allowed to be called for any controls, even those which
93 do not have a number style. In this case, an empty string is returned.</p>
95 @param _rxControl
96 the control which's id should be retrieved. Must not be <NULL/>.
98 @see examineForms
99 @see seekPage
101 SAL_DLLPRIVATE OUString getControlNumberStyle(
102 const css::uno::Reference< css::beans::XPropertySet >& _rxControl );
104 /** examines the forms collection given.
106 <p>This method will collect all form layer related data of the given draw page</p>
108 @param _rxDrawPage
109 the draw page to examine. The object will be queried for a com.sun.star.form::XFormsSupplier
110 interface to obtain the forms container.
112 void examineForms(const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage);
114 /** exports the structure of a form layer
116 <p>This method does not export styles (e.g. font properties of the controls), or any references
117 external instances may have to the control models contained in the form layer (e.g. uno control
118 shapes in the drawing layer may have such references)</p>
120 <p>No top level element describing the whole collection is inserted. I.e. if within your document, you
121 expect the forms collection to be stored like
122 <listing>
123 &lt;Forms&gt;
124 ... // all the forms stuff here
125 &lt;/Forms&gt;
126 </listing>
127 you have to start the Forms element yourself.</p>
129 @param _rxDrawPage
130 the draw page to examine. The object will be queried for a com.sun.star.form::XFormsSupplier
131 interface to obtain the forms container.
133 void exportForms(const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage);
135 /** exports the XForms model data
137 void exportXForms() const;
139 /** determines whether the given page contains logical forms
141 static bool pageContainsForms( const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage );
143 /** determines whether the given page contains XForm instances
145 bool documentContainsXForms() const;
147 /** exports the automatic controls number styles
149 SAL_DLLPRIVATE void exportAutoControlNumberStyles();
151 /** exports the auto-styles collected during the examineForms calls
153 void exportAutoStyles();
155 /** exclude the given control (model) from export.
157 <p>If your document contains form controls which are not to be exported for whatever reason,
158 you need to announce the models of these controls (can be retrieved from XControlShape::getControl)
159 to the form layer exporter.<br/>
160 Of course you have to do this before calling <member>exportForms</member></p>
162 SAL_DLLPRIVATE void excludeFromExport( const css::uno::Reference< css::awt::XControlModel >& _rxControl );
166 //= OOfficeFormsExport
168 /// export helper for the office::forms element
169 class XMLOFF_DLLPUBLIC OOfficeFormsExport
171 private:
172 std::unique_ptr<OFormsRootExport> m_pImpl;
174 public:
175 OOfficeFormsExport( SvXMLExport& _rExp );
176 ~OOfficeFormsExport();
180 } // namespace xmloff
183 #endif // INCLUDED_XMLOFF_FORMLAYEREXPORT_HXX
185 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */