Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_XMLOFF_INC_XMLCHARTPROPERTYSETMAPPER_HXX
20 : #define INCLUDED_XMLOFF_INC_XMLCHARTPROPERTYSETMAPPER_HXX
21 :
22 : #include <xmloff/xmlprmap.hxx>
23 : #include <xmloff/xmlexppr.hxx>
24 : #include <xmloff/xmlimppr.hxx>
25 : #include <xmloff/xmlimp.hxx>
26 :
27 : extern const XMLPropertyMapEntry aXMLChartPropMap[];
28 :
29 : class SvXMLExport;
30 :
31 1888 : class XMLChartPropHdlFactory : public XMLPropertyHandlerFactory
32 : {
33 : private:
34 : const XMLPropertyHandler* GetShapePropertyHandler( sal_Int32 nType ) const;
35 :
36 : public:
37 : virtual ~XMLChartPropHdlFactory();
38 : virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const SAL_OVERRIDE;
39 : };
40 :
41 : class XMLChartPropertySetMapper : public XMLPropertySetMapper
42 : {
43 : public:
44 : explicit XMLChartPropertySetMapper( bool bForExport );
45 : virtual ~XMLChartPropertySetMapper();
46 : };
47 :
48 : class XMLChartExportPropertyMapper : public SvXMLExportPropertyMapper
49 : {
50 : private:
51 : const OUString msTrue;
52 : const OUString msFalse;
53 :
54 : SvXMLExport& mrExport;
55 : com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxChartDoc;
56 :
57 : protected:
58 : virtual void ContextFilter(
59 : bool bEnableFoFontFamily,
60 : ::std::vector< XMLPropertyState >& rProperties,
61 : ::com::sun::star::uno::Reference<
62 : ::com::sun::star::beans::XPropertySet > rPropSet ) const SAL_OVERRIDE;
63 :
64 : private:
65 : /// this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set
66 : virtual void handleElementItem(
67 : SvXMLExport& rExport,
68 : const XMLPropertyState& rProperty, sal_uInt16 nFlags,
69 : const ::std::vector< XMLPropertyState > *pProperties = 0,
70 : sal_uInt32 nIdx = 0 ) const SAL_OVERRIDE;
71 :
72 : /// this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set
73 : virtual void handleSpecialItem(
74 : SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
75 : const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap,
76 : const ::std::vector< XMLPropertyState > *pProperties = 0,
77 : sal_uInt32 nIdx = 0 ) const SAL_OVERRIDE;
78 :
79 : public:
80 : XMLChartExportPropertyMapper( const rtl::Reference< XMLPropertySetMapper >& rMapper,
81 : SvXMLExport& rExport );
82 : virtual ~XMLChartExportPropertyMapper();
83 :
84 : void setAdaptPercentage( bool bNewValue );
85 :
86 : void setChartDoc( com::sun::star::uno::Reference<
87 : com::sun::star::chart2::XChartDocument > xChartDoc );
88 : };
89 :
90 : class XMLChartImportPropertyMapper : public SvXMLImportPropertyMapper
91 : {
92 : private:
93 : SvXMLImport& mrImport;
94 :
95 : public:
96 : XMLChartImportPropertyMapper( const rtl::Reference< XMLPropertySetMapper >& rMapper,
97 : const SvXMLImport& rImport );
98 : virtual ~XMLChartImportPropertyMapper();
99 :
100 : virtual bool handleSpecialItem(
101 : XMLPropertyState& rProperty,
102 : ::std::vector< XMLPropertyState >& rProperties,
103 : const OUString& rValue,
104 : const SvXMLUnitConverter& rUnitConverter,
105 : const SvXMLNamespaceMap& rNamespaceMap ) const SAL_OVERRIDE;
106 :
107 : virtual void finished(
108 : ::std::vector< XMLPropertyState >& rProperties,
109 : sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const SAL_OVERRIDE;
110 : };
111 :
112 : #endif // INCLUDED_XMLOFF_INC_XMLCHARTPROPERTYSETMAPPER_HXX
113 :
114 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|