bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / xmloff / formlayerexport.hxx
blobabe6f30ad943f300c36df15b625f4703c0db6c5b
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 { namespace sun { namespace star { namespace awt {
30 class XControlModel;
31 } } } }
33 namespace com { namespace sun { namespace star { namespace drawing { class XDrawPage; } } } }
34 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
35 namespace com { namespace sun { namespace star { namespace 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
52 :public ::salhelper::SimpleReferenceObject
54 // impl class
55 std::unique_ptr<OFormLayerXMLExport_Impl> m_pImpl;
57 protected:
58 virtual ~OFormLayerXMLExport() override;
60 public:
61 OFormLayerXMLExport(SvXMLExport& _rContext);
63 /** initializes some internal structures for fast access to the given page
65 <p>This method has to be called before you use getControlId for controls on the given page.
66 This way a performance optimization can be done for faster access to the control ids</p>
68 @return
69 <TRUE/> if the page has been examined before. If <FALSE/> is returned, this is a serious error.
71 @see getControlId
72 @see examineForms
74 bool seekPage(
75 const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage);
77 /** get the id for the given control
79 <p>The page the control belongs to must have been examined and sought to.</p>
81 @param _rxControl
82 the control which's id should be retrieved. Must not be <NULL/>.
84 @see examineForms
85 @see seekPage
88 OUString getControlId(
89 const css::uno::Reference< css::beans::XPropertySet >& _rxControl);
91 /** retrieves the style name for the control's number style.
93 <p>For performance reasons, this method is allowed to be called for any controls, even those which
94 do not have a number style. In this case, an empty string is returned.</p>
96 @param _rxControl
97 the control which's id should be retrieved. Must not be <NULL/>.
99 @see examineForms
100 @see seekPage
102 OUString getControlNumberStyle(
103 const css::uno::Reference< css::beans::XPropertySet >& _rxControl );
105 /** examines the forms collection given.
107 <p>This method will collect all form layer related data of the given draw page</p>
109 @param _rxDrawPage
110 the draw page to examine. The object will be queried for a com.sun.star.form::XFormsSupplier
111 interface to obtain the forms container.
113 void examineForms(const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage);
115 /** exports the structure of a form layer
117 <p>This method does not export styles (e.g. font properties of the controls), or any references
118 external instances may have to the control models contained in the form layer (e.g. uno control
119 shapes in the drawing layer may have such references)</p>
121 <p>No top level element describing the whole collection is inserted. I.e. if within your document, you
122 expect the forms collection to be stored like
123 <listing>
124 &lt;Forms&gt;
125 .... // all the forms stuff here
126 &lt;/Forms&gt;
127 </listing>
128 you have to start the Forms element yourself.</p>
130 @param _rxDrawPage
131 the draw page to examine. The object will be queried for a com.sun.star.form::XFormsSupplier
132 interface to obtain the forms container.
134 void exportForms(const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage);
136 /** exports the XForms model data
138 void exportXForms() const;
140 /** determines whether the given page contains logical forms
142 static bool pageContainsForms( const css::uno::Reference< css::drawing::XDrawPage >& _rxDrawPage );
144 /** determines whether the given page contains XForm instances
146 bool documentContainsXForms() const;
148 /** exports the automatic controls number styles
150 void exportAutoControlNumberStyles();
152 /** exports the auto-styles collected during the examineForms calls
154 void exportAutoStyles();
156 /** exclude the given control (model) from export.
158 <p>If your document contains form controls which are not to be exported for whatever reason,
159 you need to announce the models of these controls (can be retrieved from XControlShape::getControl)
160 to the form layer exporter.<br/>
161 Of course you have to do this before calling <member>exportForms</member></p>
163 void excludeFromExport( const css::uno::Reference< css::awt::XControlModel >& _rxControl );
167 //= OOfficeFormsExport
169 /// export helper for the office::forms element
170 class XMLOFF_DLLPUBLIC OOfficeFormsExport
172 private:
173 std::unique_ptr<OFormsRootExport> m_pImpl;
175 public:
176 OOfficeFormsExport( SvXMLExport& _rExp );
177 ~OOfficeFormsExport();
181 } // namespace xmloff
184 #endif // INCLUDED_XMLOFF_FORMLAYEREXPORT_HXX
186 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */