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_SOURCE_DRAW_XIMPSTYL_HXX
21 #define INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSTYL_HXX
23 #include <xmloff/xmlictxt.hxx>
24 #include "sdxmlimp_impl.hxx"
25 #include "ximppage.hxx"
26 #include <xmloff/xmlstyle.hxx>
27 #include <com/sun/star/view/PaperOrientation.hpp>
30 class SvNumberFormatter
;
31 class SvXMLNumFmtHelper
;
33 // special style:style context inside style:page-master context
35 class SdXMLPageMasterStyleContext
: public SvXMLStyleContext
37 sal_Int32 mnBorderBottom
;
38 sal_Int32 mnBorderLeft
;
39 sal_Int32 mnBorderRight
;
40 sal_Int32 mnBorderTop
;
43 com::sun::star::view::PaperOrientation meOrientation
;
45 const SdXMLImport
& GetSdImport() const { return static_cast<const SdXMLImport
&>(GetImport()); }
46 SdXMLImport
& GetSdImport() { return static_cast<SdXMLImport
&>(GetImport()); }
51 SdXMLPageMasterStyleContext(
54 const OUString
& rLName
,
55 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
56 virtual ~SdXMLPageMasterStyleContext();
58 sal_Int32
GetBorderBottom() const { return mnBorderBottom
; }
59 sal_Int32
GetBorderLeft() const { return mnBorderLeft
; }
60 sal_Int32
GetBorderRight() const { return mnBorderRight
; }
61 sal_Int32
GetBorderTop() const { return mnBorderTop
; }
62 sal_Int32
GetWidth() const { return mnWidth
; }
63 sal_Int32
GetHeight() const { return mnHeight
; }
64 com::sun::star::view::PaperOrientation
GetOrientation() const { return meOrientation
; }
67 // style:page-master context
69 class SdXMLPageMasterContext
: public SvXMLStyleContext
72 SdXMLPageMasterStyleContext
*mpPageMasterStyle
;
74 const SdXMLImport
& GetSdImport() const { return static_cast<const SdXMLImport
&>(GetImport()); }
75 SdXMLImport
& GetSdImport() { return static_cast<SdXMLImport
&>(GetImport()); }
80 SdXMLPageMasterContext(
83 const OUString
& rLName
,
84 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
85 virtual ~SdXMLPageMasterContext();
87 virtual SvXMLImportContext
*CreateChildContext(
88 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
89 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
91 const OUString
& GetName() const { return msName
; }
92 const SdXMLPageMasterStyleContext
* GetPageMasterStyle() const { return mpPageMasterStyle
; }
95 // style:masterpage context
97 class SdXMLMasterPageContext
: public SdXMLGenericPageContext
99 OUString msPageMasterName
;
101 OUString msDisplayName
;
102 OUString msStyleName
;
107 SdXMLMasterPageContext(
108 SdXMLImport
& rImport
,
110 const OUString
& rLName
,
111 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
112 com::sun::star::uno::Reference
< com::sun::star::drawing::XShapes
>& rShapes
);
113 virtual ~SdXMLMasterPageContext();
115 virtual SvXMLImportContext
*CreateChildContext(
116 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
117 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
119 virtual void EndElement() SAL_OVERRIDE
;
121 const OUString
& GetPageMasterName() const { return msPageMasterName
; }
122 const OUString
& GetEncodedName() const { return msName
; }
123 const OUString
& GetDisplayName() const { return msDisplayName
; }
126 typedef ::std::vector
< SdXMLMasterPageContext
* > ImpMasterPageList
;
128 // presentation:placeholder context
130 class SdXMLPresentationPlaceholderContext
: public SvXMLImportContext
138 const SdXMLImport
& GetSdImport() const { return static_cast<const SdXMLImport
&>(GetImport()); }
139 SdXMLImport
& GetSdImport() { return static_cast<SdXMLImport
&>(GetImport()); }
142 SdXMLPresentationPlaceholderContext(
143 SdXMLImport
& rImport
,
145 const OUString
& rLName
,
146 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
147 virtual ~SdXMLPresentationPlaceholderContext();
149 const OUString
& GetName() const { return msName
; }
150 sal_Int32
GetX() const { return mnX
; }
151 sal_Int32
GetY() const { return mnY
; }
152 sal_Int32
GetWidth() const { return mnWidth
; }
153 sal_Int32
GetHeight() const { return mnHeight
; }
155 typedef ::std::vector
< SdXMLPresentationPlaceholderContext
* > ImpPlaceholderList
;
157 // style:presentation-page-layout context
159 class SdXMLPresentationPageLayoutContext
: public SvXMLStyleContext
162 ImpPlaceholderList maList
;
165 const SdXMLImport
& GetSdImport() const { return static_cast<const SdXMLImport
&>(GetImport()); }
166 SdXMLImport
& GetSdImport() { return static_cast<SdXMLImport
&>(GetImport()); }
171 SdXMLPresentationPageLayoutContext(
172 SdXMLImport
& rImport
,
174 const OUString
& rLName
,
175 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
176 virtual ~SdXMLPresentationPageLayoutContext();
178 virtual SvXMLImportContext
*CreateChildContext(
179 sal_uInt16 nPrefix
, const OUString
& rLocalName
,
180 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
182 virtual void EndElement() SAL_OVERRIDE
;
183 sal_uInt16
GetTypeId() const { return mnTypeId
; }
186 // office:styles context
188 class SdXMLStylesContext
: public SvXMLStylesContext
190 rtl::Reference
< SvXMLImportPropertyMapper
> xPresImpPropMapper
;
192 SvXMLNumFmtHelper
* mpNumFmtHelper
;
193 SvNumberFormatter
* mpNumFormatter
;
195 const SdXMLImport
& GetSdImport() const { return static_cast<const SdXMLImport
&>(GetImport()); }
196 SdXMLImport
& GetSdImport() { return static_cast<SdXMLImport
&>(GetImport()); }
198 void ImpSetGraphicStyles() const;
199 void ImpSetCellStyles() const;
200 void ImpSetGraphicStyles( com::sun::star::uno::Reference
< com::sun::star::container::XNameAccess
>& xPageStyles
,
201 sal_uInt16 nFamily
, const OUString
& rPrefix
) const;
204 virtual SvXMLStyleContext
* CreateStyleChildContext(
206 const OUString
& rLocalName
,
207 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
209 virtual SvXMLStyleContext
*CreateStyleStyleChildContext(
212 const OUString
& rLocalName
,
213 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
215 virtual SvXMLStyleContext
*CreateDefaultStyleStyleChildContext(
216 sal_uInt16 nFamily
, sal_uInt16 nPrefix
,
217 const OUString
& rLocalName
,
218 const ::com::sun::star::uno::Reference
<
219 ::com::sun::star::xml::sax::XAttributeList
> & xAttrList
) SAL_OVERRIDE
;
224 SdXMLImport
& rImport
,
226 const OUString
& rLName
,
227 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
229 virtual ~SdXMLStylesContext();
231 virtual sal_uInt16
GetFamily( const OUString
& rFamily
) const SAL_OVERRIDE
;
232 virtual void EndElement() SAL_OVERRIDE
;
233 virtual rtl::Reference
< SvXMLImportPropertyMapper
> GetImportPropertyMapper(sal_uInt16 nFamily
) const SAL_OVERRIDE
;
235 void SetMasterPageStyles(SdXMLMasterPageContext
& rMaster
) const;
237 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> getPageLayouts() const;
240 // office:master-styles context
242 class SdXMLMasterStylesContext
: public SvXMLImportContext
244 ImpMasterPageList maMasterPageList
;
246 const SdXMLImport
& GetSdImport() const { return static_cast<const SdXMLImport
&>(GetImport()); }
247 SdXMLImport
& GetSdImport() { return static_cast<SdXMLImport
&>(GetImport()); }
252 SdXMLMasterStylesContext(
253 SdXMLImport
& rImport
,
255 const OUString
& rLName
);
256 virtual ~SdXMLMasterStylesContext();
258 virtual SvXMLImportContext
* CreateChildContext(
260 const OUString
& rLocalName
,
261 const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
263 const ImpMasterPageList
& GetMasterPageList() const { return maMasterPageList
; }
266 // <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl>
268 class SdXMLHeaderFooterDeclContext
: public SvXMLStyleContext
271 SdXMLHeaderFooterDeclContext( SvXMLImport
& rImport
, sal_uInt16 nPrfx
,
272 const OUString
& rLName
,
273 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
275 virtual bool IsTransient() const SAL_OVERRIDE
;
276 virtual void EndElement() SAL_OVERRIDE
;
277 virtual void Characters( const OUString
& rChars
) SAL_OVERRIDE
;
282 OUString maStrDateTimeFormat
;
286 #endif // INCLUDED_XMLOFF_SOURCE_DRAW_XIMPSTYL_HXX
288 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */