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/uno/Reference.hxx>
26 #include <salhelper/simplereferenceobject.hxx>
29 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ class XPropertySet
; } } } }
30 namespace com
{ namespace sun
{ namespace star
{ namespace drawing
{ class XDrawPage
; } } } }
31 namespace com
{ namespace sun
{ namespace star
{ namespace xml
{ namespace sax
{ class XAttributeList
; } } } } }
34 class SvXMLImportContext
;
35 class SvXMLStylesContext
;
42 //= OFormLayerXMLImport
44 class OFormLayerXMLImport_Impl
;
45 /** allows you to import a <form:form> element
47 class XMLOFF_DLLPUBLIC OFormLayerXMLImport
48 :public ::salhelper::SimpleReferenceObject
50 std::unique_ptr
<OFormLayerXMLImport_Impl
> m_pImpl
;
53 OFormLayerXMLImport(SvXMLImport
& _rImporter
);
54 virtual ~OFormLayerXMLImport() override
;
56 /** start importing the forms of the given page
58 <p>starting the import of a new page (by using this method) invalidates the current page position.</p>
63 const css::uno::Reference
< css::drawing::XDrawPage
>& _rxDrawPage
);
65 /** creates an import context for the office:forms element
67 static SvXMLImportContext
* createOfficeFormsContext(
68 SvXMLImport
& _rImport
,
70 const OUString
& _rLocalName
);
72 /** create an SvXMLImportContext instance which is able to import the <form:form>
75 <p>You must have called <method>startPage</method> before you can create such an import context.</p>
80 SvXMLImportContext
* createContext(
81 const sal_uInt16 _nPrefix
,
82 const OUString
& _rLocalName
,
83 const css::uno::Reference
< css::xml::sax::XAttributeList
>& _rxAttribs
);
85 /** lookup a control given by id.
87 <p>The control must be part of the page which is currently being imported.</p>
89 <p>(And, of course, the control must have been imported already at the moment you call this.)</p>
93 css::uno::Reference
< css::beans::XPropertySet
>
94 lookupControl(const OUString
& _rId
);
96 /** end importing the forms of the current page
98 <p>You must call this method if you want the import to be finished correctly. Without calling
99 it, you will lose information.</p>
105 /** announces the auto-style context to the form importer
107 void setAutoStyleContext(SvXMLStylesContext
* _pNewContext
);
109 /** sets the given number style on the given control
110 @param _rxControlModel
111 the control model which's style is to be set
112 @param _rControlNumerStyleName
113 the style name for the control's number style
115 void applyControlNumberStyle(
116 const css::uno::Reference
< css::beans::XPropertySet
>& _rxControlModel
,
117 const OUString
& _rControlNumerStyleName
120 /** to be called when the document has been completely imported
122 <p>For some documents (currently: only some spreadsheet documents) it's necessary
123 do to a post processing, since not all information from the file can be processed
124 if the document is not completed, yet.</p>
126 void documentDone( );
130 } // namespace xmloff
133 #endif // INCLUDED_XMLOFF_FORMLAYERIMPORT_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */