1 /*************************************************************************
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * Copyright 2000, 2010 Oracle and/or its affiliates.
5  *
6  * OpenOffice.org - a multi-platform office productivity suite
7  *
8  * This file is part of OpenOffice.org.
9  *
10  * OpenOffice.org is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License version 3
12  * only, as published by the Free Software Foundation.
13  *
14  * OpenOffice.org is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License version 3 for more details
18  * (a copy is included in the LICENSE file that accompanied this code).
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with OpenOffice.org.  If not, see
22  * <http://www.openoffice.org/license.html>
23  * for a copy of the LGPLv3 License.
24  *
25  ************************************************************************/
26 
27 #ifndef XMLOFF_PROPERTY_HANDLER_HXX
28 #define XMLOFF_PROPERTY_HANDLER_HXX
29 
30 #include "forms/property_ids.hxx"
31 
32 #include <com/sun/star/uno/Any.hxx>
33 
34 #include <rtl/ref.hxx>
35 
36 #include <map>
37 #include <vector>
38 
39 //......................................................................................................................
40 namespace xmloff
41 {
42 //......................................................................................................................
43 
44     typedef ::std::map< PropertyId, ::com::sun::star::uno::Any >    PropertyValues;
45 
46 	//==================================================================================================================
47 	//= IPropertyHandler
48 	//==================================================================================================================
49     class IPropertyHandler : public ::rtl::IReference
50 	{
51     public:
52         /** retrieves the XML attribute value for the given property values
53         */
54         virtual ::rtl::OUString
55             getAttributeValue( const PropertyValues& i_propertyValues ) const = 0;
56 
57         /** is a convenience method for XML attributes whose value comprises of only one UNO API property
58         */
59         virtual ::rtl::OUString
60             getAttributeValue( const ::com::sun::star::uno::Any& i_propertyValue ) const = 0;
61 
62         /** retrieves the values of the properties controlled by an XML attributed, described by a given attribute value
63         */
64         virtual bool
65             getPropertyValues( const ::rtl::OUString i_attributeValue, PropertyValues& o_propertyValues ) const = 0;
66 
67         virtual ~IPropertyHandler() { }
68 	};
69 
70 	//==================================================================================================================
71 	//= PPropertyHandler
72 	//==================================================================================================================
73     typedef ::rtl::Reference< IPropertyHandler >    PPropertyHandler;
74 
75 	//==================================================================================================================
76 	//= PropertyHandlerFactory
77 	//==================================================================================================================
78     typedef PPropertyHandler (*PropertyHandlerFactory)( const PropertyId i_propertyId );
79 
80 //......................................................................................................................
81 } // namespace xmloff
82 //......................................................................................................................
83 
84 #endif // XMLOFF_PROPERTY_HANDLER_HXX
85