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