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_PROPERTY_HANDLER_HXX
25 #define XMLOFF_PROPERTY_HANDLER_HXX
26 
27 #include "forms/property_ids.hxx"
28 
29 #include <com/sun/star/uno/Any.hxx>
30 
31 #include <rtl/ref.hxx>
32 
33 #include <map>
34 #include <vector>
35 
36 //......................................................................................................................
37 namespace xmloff
38 {
39 //......................................................................................................................
40 
41     typedef ::std::map< PropertyId, ::com::sun::star::uno::Any >    PropertyValues;
42 
43 	//==================================================================================================================
44 	//= IPropertyHandler
45 	//==================================================================================================================
46     class IPropertyHandler : public ::rtl::IReference
47 	{
48     public:
49         /** retrieves the XML attribute value for the given property values
50         */
51         virtual ::rtl::OUString
52             getAttributeValue( const PropertyValues& i_propertyValues ) const = 0;
53 
54         /** is a convenience method for XML attributes whose value comprises of only one UNO API property
55         */
56         virtual ::rtl::OUString
57             getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const = 0;
58 
59         /** retrieves the values of the properties controlled by an XML attributed, described by a given attribute value
60         */
61         virtual bool
62             getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const = 0;
63 
~IPropertyHandler()64         virtual ~IPropertyHandler() { }
65 	};
66 
67 	//==================================================================================================================
68 	//= PPropertyHandler
69 	//==================================================================================================================
70     typedef ::rtl::Reference< IPropertyHandler >    PPropertyHandler;
71 
72 	//==================================================================================================================
73 	//= PropertyHandlerFactory
74 	//==================================================================================================================
75     typedef PPropertyHandler (*PropertyHandlerFactory)( const PropertyId i_propertyId );
76 
77 //......................................................................................................................
78 } // namespace xmloff
79 //......................................................................................................................
80 
81 #endif // XMLOFF_PROPERTY_HANDLER_HXX
82