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 INCLUDED_XMLOFF_FORMLAYERIMPORT_HXX
21 #define INCLUDED_XMLOFF_FORMLAYERIMPORT_HXX
23 #include <sal/config.h>
24 #include <xmloff/dllapi.h>
25 #include <com/sun/star/drawing/XDrawPage.hpp>
26 #include <com/sun/star/xml/sax/XAttributeList.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <rtl/ref.hxx>
29 #include <salhelper/simplereferenceobject.hxx>
30 #include <xmloff/xmlimppr.hxx>
34 class SvXMLImportContext
;
35 class SvXMLStylesContext
;
36 class XMLPropStyleContext
;
43 //= OFormLayerXMLImport
45 class OFormLayerXMLImport_Impl
;
46 /** allows you to import a <form:form> element
48 class XMLOFF_DLLPUBLIC OFormLayerXMLImport
49 :public ::salhelper::SimpleReferenceObject
51 std::unique_ptr
<OFormLayerXMLImport_Impl
> m_pImpl
;
54 OFormLayerXMLImport(SvXMLImport
& _rImporter
);
55 virtual ~OFormLayerXMLImport() override
;
57 /** start importing the forms of the given page
59 <p>starting the import of a new page (by using this method) invalidates the current page position.</p>
64 const css::uno::Reference
< css::drawing::XDrawPage
>& _rxDrawPage
);
66 /** creates an import context for the office:forms element
68 static SvXMLImportContext
* createOfficeFormsContext(
69 SvXMLImport
& _rImport
,
71 const OUString
& _rLocalName
);
73 /** create an SvXMLImportContext instance which is able to import the <form:form>
76 <p>You must have called <method>startPage</method> before you can create such an import context.</p>
81 SvXMLImportContext
* createContext(
82 const sal_uInt16 _nPrefix
,
83 const OUString
& _rLocalName
,
84 const css::uno::Reference
< css::xml::sax::XAttributeList
>& _rxAttribs
);
86 /** lookup a control given by id.
88 <p>The control must be part of the page which is currently being imported.</p>
90 <p>(And, of course, the control must have been imported already at the moment you call this.)</p>
94 css::uno::Reference
< css::beans::XPropertySet
>
95 lookupControl(const OUString
& _rId
);
97 /** end importing the forms of the current page
99 <p>You must call this method if you want the import to be finished correctly. Without calling
100 it, you will lose information.</p>
106 /** announces the auto-style context to the form importer
108 void setAutoStyleContext(SvXMLStylesContext
* _pNewContext
);
110 /** sets the given number style on the given control
111 @param _rxControlModel
112 the control model which's style is to be set
113 @param _rControlNumerStyleName
114 the style name for the control's number style
116 void applyControlNumberStyle(
117 const css::uno::Reference
< css::beans::XPropertySet
>& _rxControlModel
,
118 const OUString
& _rControlNumerStyleName
121 /** to be called when the document has been completely imported
123 <p>For some documents (currently: only some spreadsheet documents) it's necessary
124 do to a post processing, since not all information from the file can be processed
125 if the document is not completed, yet.</p>
127 void documentDone( );
131 } // namespace xmloff
134 #endif // INCLUDED_XMLOFF_FORMLAYERIMPORT_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */