xref: /trunk/main/xmloff/source/draw/sdpropls.hxx (revision 56b35d86)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef _SDPROPLS_HXX
23 #define _SDPROPLS_HXX
24 
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <xmloff/xmlnume.hxx>
27 #include <xmloff/maptype.hxx>
28 #include <xmloff/xmltypes.hxx>
29 #include <xmloff/xmlement.hxx>
30 #include <xmloff/prhdlfac.hxx>
31 #include <xmloff/xmlprmap.hxx>
32 #include "xmloff/XMLTextListAutoStylePool.hxx"
33 #include <xmloff/xmlexppr.hxx>
34 #include <xmlsdtypes.hxx>
35 
36 //////////////////////////////////////////////////////////////////////////////
37 // entry list for graphic properties
38 
39 extern const XMLPropertyMapEntry aXMLSDProperties[];
40 
41 //////////////////////////////////////////////////////////////////////////////
42 // entry list for presentation page properties
43 
44 extern const XMLPropertyMapEntry aXMLSDPresPageProps[];
45 extern const XMLPropertyMapEntry aXMLSDPresPageProps_onlyHeadersFooter[];
46 
47 //////////////////////////////////////////////////////////////////////////////
48 // enum maps for attributes
49 
50 extern SvXMLEnumMapEntry aXML_ConnectionKind_EnumMap[];
51 extern SvXMLEnumMapEntry aXML_CircleKind_EnumMap[];
52 
53 //////////////////////////////////////////////////////////////////////////////
54 
55 /** contains the attribute to property mapping for a drawing layer table */
56 extern const XMLPropertyMapEntry aXMLTableShapeAttributes[];
57 
58 //////////////////////////////////////////////////////////////////////////////
59 // factory for own graphic properties
60 
61 class SvXMLExport;
62 class SvXMLImport;
63 
64 class XMLSdPropHdlFactory : public XMLPropertyHandlerFactory
65 {
66 private:
67 	::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
68 	SvXMLExport* mpExport;
69 	SvXMLImport* mpImport;
70 
71 public:
72 	XMLSdPropHdlFactory( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >, SvXMLExport& rExport );
73 	XMLSdPropHdlFactory( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >, SvXMLImport& rImport );
74 	virtual ~XMLSdPropHdlFactory();
75 	virtual const XMLPropertyHandler* GetPropertyHandler( sal_Int32 nType ) const;
76 };
77 
78 class XMLShapePropertySetMapper : public XMLPropertySetMapper
79 {
80 public:
81 	XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef);
82 	XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef, sal_uInt16 nOffset);
83 	~XMLShapePropertySetMapper();
84 };
85 
86 class XMLShapeExportPropertyMapper : public SvXMLExportPropertyMapper
87 {
88 private:
89 	XMLTextListAutoStylePool *mpListAutoPool;
90 	SvXMLExport& mrExport;
91 	SvxXMLNumRuleExport maNumRuleExp;
92 	sal_Bool mbIsInAutoStyles;
93 
94 	const rtl::OUString msCDATA;
95 	const rtl::OUString msTrue;
96 	const rtl::OUString msFalse;
97 
98 protected:
99 	virtual void ContextFilter(
100 		::std::vector< XMLPropertyState >& rProperties,
101 		::com::sun::star::uno::Reference<
102 			::com::sun::star::beans::XPropertySet > rPropSet ) const;
103 public:
104 	XMLShapeExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, XMLTextListAutoStylePool *pListAutoPool, SvXMLExport& rExport );
105 	virtual ~XMLShapeExportPropertyMapper();
106 
107 	virtual void		handleElementItem(
108                             SvXMLExport& rExport,
109 							const XMLPropertyState& rProperty,
110 							sal_uInt16 nFlags,
111 							const ::std::vector< XMLPropertyState >* pProperties = 0,
112 							sal_uInt32 nIdx = 0
113 							) const;
114 
SetAutoStyles(sal_Bool bIsInAutoStyles)115 	void SetAutoStyles( sal_Bool bIsInAutoStyles ) { mbIsInAutoStyles = bIsInAutoStyles; }
116 
117 	virtual void handleSpecialItem(
118 			SvXMLAttributeList& rAttrList,
119 			const XMLPropertyState& rProperty,
120 			const SvXMLUnitConverter& rUnitConverter,
121 			const SvXMLNamespaceMap& rNamespaceMap,
122 			const ::std::vector< XMLPropertyState > *pProperties = 0,
123 			sal_uInt32 nIdx = 0 ) const;
124 };
125 
126 class XMLPagePropertySetMapper : public XMLPropertySetMapper
127 {
128 public:
129 	XMLPagePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef);
130 	~XMLPagePropertySetMapper();
131 };
132 
133 class XMLPageExportPropertyMapper : public SvXMLExportPropertyMapper
134 {
135 private:
136 	SvXMLExport& mrExport;
137 
138 	const rtl::OUString msCDATA;
139 	const rtl::OUString msTrue;
140 	const rtl::OUString msFalse;
141 
142 protected:
143 	virtual void ContextFilter(
144 		::std::vector< XMLPropertyState >& rProperties,
145 		::com::sun::star::uno::Reference<
146 			::com::sun::star::beans::XPropertySet > rPropSet ) const;
147 public:
148 	XMLPageExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, SvXMLExport& rExport );
149 	virtual ~XMLPageExportPropertyMapper();
150 
151 	virtual void		handleElementItem(
152                             SvXMLExport& rExport,
153                             const XMLPropertyState& rProperty,
154 							sal_uInt16 nFlags,
155 							const ::std::vector< XMLPropertyState >* pProperties = 0,
156 							sal_uInt32 nIdx = 0
157 							) const;
158 };
159 
160 #endif	//  _SDPROPLS_HXX
161