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