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 
23 
24 #ifndef _XMLOFF_XMLIMAGEMAPEXPORT_HXX_
25 #define _XMLOFF_XMLIMAGEMAPEXPORT_HXX_
26 
27 #include <rtl/ustring.hxx>
28 
29 namespace com { namespace sun { namespace star {
30 	namespace uno { template<class X> class Reference; }
31 	namespace beans { class XPropertySet; }
32 	namespace container { class XIndexContainer; }
33 } } }
34 class SvXMLExport;
35 
36 
37 /**
38  * Export an ImageMap as defined by service com.sun.star.image.ImageMap to XML.
39  */
40 class XMLImageMapExport
41 {
42 	const ::rtl::OUString msBoundary;
43 	const ::rtl::OUString msCenter;
44 	const ::rtl::OUString msDescription;
45 	const ::rtl::OUString msImageMap;
46 	const ::rtl::OUString msIsActive;
47 	const ::rtl::OUString msName;
48 	const ::rtl::OUString msPolygon;
49 	const ::rtl::OUString msRadius;
50 	const ::rtl::OUString msTarget;
51 	const ::rtl::OUString msURL;
52 	const ::rtl::OUString msTitle;
53 
54 	SvXMLExport& mrExport;
55 
56 	sal_Bool mbWhiteSpace;	/// use whitespace between image map elements?
57 
58 public:
59 	XMLImageMapExport(SvXMLExport& rExport);
60 
61 	~XMLImageMapExport();
62 
63 	/**
64 	 * Get the ImageMap object from the "ImageMap" property and subsequently
65 	 * export the map (if present).
66 	 */
67 	void Export(
68 		/// the property set containing the ImageMap property
69 		const ::com::sun::star::uno::Reference<
70 			::com::sun::star::beans::XPropertySet> & rPropertySet);
71 	/**
72 	 * Export an ImageMap (XIndexContainer).
73 	 */
74 	void Export(
75 		/// the container containing the image map elements
76 		const ::com::sun::star::uno::Reference<
77 			::com::sun::star::container::XIndexContainer> & rContainer);
78 
79 protected:
80 
81 	/**
82 	 * Export a single, named map entry.
83 	 * (as given by com.sun.star.image.ImageMapObject)
84 	 * Calls methods for specific image map entries.
85 	 */
86 	void ExportMapEntry(
87 		const ::com::sun::star::uno::Reference<
88 			::com::sun::star::beans::XPropertySet> & rPropertySet);
89 
90 	/**
91 	 * Export the specifics of a rectangular image map entry.
92 	 * To be called by ExportMapEntry.
93 	 */
94 	void ExportRectangle(
95 		const ::com::sun::star::uno::Reference<
96 			::com::sun::star::beans::XPropertySet> & rPropertySet);
97 
98 	/**
99 	 * Export the specifics of a circular image map entry.
100 	 * To be called by ExportMapEntry.
101 	 */
102 	void ExportCircle(
103 		const ::com::sun::star::uno::Reference<
104 			::com::sun::star::beans::XPropertySet> & rPropertySet);
105 
106 	/**
107 	 * Export the specifics of a polygonal image map entry;
108 	 * To be called by ExportMapEntry.
109 	 */
110 	void ExportPolygon(
111 		const ::com::sun::star::uno::Reference<
112 			::com::sun::star::beans::XPropertySet> & rPropertySet);
113 };
114 
115 #endif
116