Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _XMLOFF_CHARTPROPERTYSETMAPPER_HXX_
29 : : #define _XMLOFF_CHARTPROPERTYSETMAPPER_HXX_
30 : :
31 : : #include <xmloff/uniref.hxx>
32 : : #include <xmloff/xmlprmap.hxx>
33 : : #include <xmloff/xmlexppr.hxx>
34 : : #include <xmloff/xmlimppr.hxx>
35 : : #include <xmloff/xmlimp.hxx>
36 : :
37 : : namespace rtl { class OUString; }
38 : :
39 : : extern const XMLPropertyMapEntry aXMLChartPropMap[];
40 : :
41 : : class SvXMLExport;
42 : :
43 : : // ----------------------------------------
44 : :
45 : 60 : class XMLChartPropHdlFactory : public XMLPropertyHandlerFactory
46 : : {
47 : : private:
48 : : const XMLPropertyHandler* GetShapePropertyHandler( sal_Int32 nType ) const;
49 : :
50 : : public:
51 : : virtual ~XMLChartPropHdlFactory();
52 : : virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const;
53 : : };
54 : :
55 : : // ----------------------------------------
56 : :
57 : : class XMLChartPropertySetMapper : public XMLPropertySetMapper
58 : : {
59 : : public:
60 : : XMLChartPropertySetMapper();
61 : : ~XMLChartPropertySetMapper();
62 : : };
63 : :
64 : : // ----------------------------------------
65 : :
66 : : class XMLChartExportPropertyMapper : public SvXMLExportPropertyMapper
67 : : {
68 : : private:
69 : : const rtl::OUString msTrue;
70 : : const rtl::OUString msFalse;
71 : : bool mbAdaptPercentage;
72 : :
73 : : SvXMLExport& mrExport;
74 : :
75 : : protected:
76 : : virtual void ContextFilter(
77 : : ::std::vector< XMLPropertyState >& rProperties,
78 : : ::com::sun::star::uno::Reference<
79 : : ::com::sun::star::beans::XPropertySet > rPropSet ) const;
80 : :
81 : : private:
82 : : /// this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set
83 : : virtual void handleElementItem(
84 : : SvXMLExport& rExport,
85 : : const XMLPropertyState& rProperty, sal_uInt16 nFlags,
86 : : const ::std::vector< XMLPropertyState > *pProperties = 0,
87 : : sal_uInt32 nIdx = 0 ) const;
88 : :
89 : : /// this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set
90 : : virtual void handleSpecialItem(
91 : : SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
92 : : const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap,
93 : : const ::std::vector< XMLPropertyState > *pProperties = 0,
94 : : sal_uInt32 nIdx = 0 ) const;
95 : :
96 : : public:
97 : : XMLChartExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper,
98 : : SvXMLExport& rExport );
99 : : virtual ~XMLChartExportPropertyMapper();
100 : :
101 : : void setAdaptPercentage( bool bNewValue );
102 : : };
103 : :
104 : : // ----------------------------------------
105 : :
106 : : class XMLChartImportPropertyMapper : public SvXMLImportPropertyMapper
107 : : {
108 : : private:
109 : : SvXMLImport& mrImport;
110 : :
111 : : public:
112 : : XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper,
113 : : const SvXMLImport& rImport );
114 : : virtual ~XMLChartImportPropertyMapper();
115 : :
116 : : virtual bool handleSpecialItem(
117 : : XMLPropertyState& rProperty,
118 : : ::std::vector< XMLPropertyState >& rProperties,
119 : : const ::rtl::OUString& rValue,
120 : : const SvXMLUnitConverter& rUnitConverter,
121 : : const SvXMLNamespaceMap& rNamespaceMap ) const;
122 : :
123 : : virtual void finished(
124 : : ::std::vector< XMLPropertyState >& rProperties,
125 : : sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const;
126 : : };
127 : :
128 : : #endif // _XMLOFF_CHARTPROPERTYSETMAPPER_HXX_
129 : :
130 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|