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_FORMS_CONTROLPROPERTYHDL_HXX_
25 #define _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
26 
27 #include "sal/config.h"
28 #include "xmloff/dllapi.h"
29 #include <xmloff/prhdlfac.hxx>
30 #include <vos/ref.hxx>
31 #include <rtl/ustring.hxx>
32 #include <xmloff/xmlexppr.hxx>
33 #include <xmloff/XMLConstantsPropertyHandler.hxx>
34 
35 struct SvXMLEnumMapEntry;
36 class Color;
37 //.........................................................................
38 namespace xmloff
39 {
40 //.........................................................................
41 
42 	class IFormsExportContext;
43 	class OFormLayerXMLImport_Impl;
44 
45 	//=====================================================================
46 	//= ORotationAngleHandler
47 	//=====================================================================
48 	class ORotationAngleHandler : public XMLPropertyHandler
49 	{
50 	public:
51 		ORotationAngleHandler();
52 
53 		virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
54 		virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
55 	};
56 
57 	//=====================================================================
58 	//= OFontWidthHandler
59 	//=====================================================================
60 	class OFontWidthHandler : public XMLPropertyHandler
61 	{
62 	public:
63 		OFontWidthHandler();
64 
65 		virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
66 		virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
67 	};
68 
69 	//=====================================================================
70 	//= OControlBorderHandlerBase
71 	//=====================================================================
72 	class OControlBorderHandler : public XMLPropertyHandler
73 	{
74 	public:
75         enum BorderFacet
76         {
77             STYLE,
78             COLOR
79         };
80 
81 		OControlBorderHandler( const BorderFacet _eFacet );
82 
83 		virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
84 		virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
85 
86     private:
87         BorderFacet m_eFacet;
88 	};
89 
90 	//=====================================================================
91 	//= OControlTextEmphasisHandler
92 	//=====================================================================
93 	class OControlTextEmphasisHandler : public XMLPropertyHandler
94 	{
95 	public:
96 		OControlTextEmphasisHandler();
97 
98 		virtual sal_Bool importXML( const ::rtl::OUString& _rStrImpValue, ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
99 		virtual sal_Bool exportXML( ::rtl::OUString& _rStrExpValue, const ::com::sun::star::uno::Any& _rValue, const SvXMLUnitConverter& _rUnitConverter ) const;
100 	};
101 
102 	//=====================================================================
103 	//= ImageScaleModeHandler
104 	//=====================================================================
105     class XMLOFF_DLLPUBLIC ImageScaleModeHandler : public XMLConstantsPropertyHandler
106     {
107     public:
108         ImageScaleModeHandler();
109     };
110 
111 	//=====================================================================
112 	//= OControlPropertyHandlerFactory
113 	//=====================================================================
114 	class XMLOFF_DLLPUBLIC OControlPropertyHandlerFactory : public XMLPropertyHandlerFactory
115 	{
116 	protected:
117 		mutable XMLConstantsPropertyHandler*	m_pTextAlignHandler;
118         mutable OControlBorderHandler*          m_pControlBorderStyleHandler;
119         mutable OControlBorderHandler*          m_pControlBorderColorHandler;
120 		mutable ORotationAngleHandler*			m_pRotationAngleHandler;
121 		mutable OFontWidthHandler*				m_pFontWidthHandler;
122 		mutable XMLConstantsPropertyHandler*	m_pFontEmphasisHandler;
123 		mutable XMLConstantsPropertyHandler*	m_pFontReliefHandler;
124 
125     protected:
126 		virtual ~OControlPropertyHandlerFactory();
127 
128 	public:
129 		OControlPropertyHandlerFactory();
130 
131 		virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const;
132 	};
133 
134 //.........................................................................
135 }	// namespace xmloff
136 //.........................................................................
137 
138 #endif // _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
139 
140