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 #ifndef RPT_XMLCONTROLPROPERTY_HXX
24 #define RPT_XMLCONTROLPROPERTY_HXX
25 
26 #include <xmloff/xmlictxt.hxx>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/uno/Sequence.hxx>
30 #include <com/sun/star/util/Date.hpp>
31 #include <com/sun/star/util/Time.hpp>
32 
33 namespace rptxml
34 {
35 	class ORptFilter;
36 	class OXMLControlProperty : public SvXMLImportContext
37 	{
38 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xControl;
39 		::com::sun::star::beans::PropertyValue m_aSetting;
40 		::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aSequence;
41 		OXMLControlProperty* m_pContainer;
42 		::com::sun::star::uno::Type	m_aPropType;			// the type of the property the instance imports currently
43 		sal_Bool m_bIsList;
44 
45 		ORptFilter& GetOwnImport();
46 		::com::sun::star::uno::Any convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters);
47         OXMLControlProperty(const OXMLControlProperty&);
48         void operator =(const OXMLControlProperty&);
49 	public:
50 
51 		OXMLControlProperty( ORptFilter& rImport
52 					,sal_uInt16 nPrfx
53 					,const ::rtl::OUString& rLName
54 					,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
55 					,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xControl
56 					,OXMLControlProperty* _pContainer = NULL);
57 		virtual ~OXMLControlProperty();
58 
59 		virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
60 					const ::rtl::OUString& rLocalName,
61 					const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
62 
63 		virtual void EndElement();
64 
65 		virtual void Characters( const ::rtl::OUString& rChars );
66 
67 
68 		/** adds value to property
69 			@param	_sValue
70 				The value to add.
71 		*/
72 		void addValue(const ::rtl::OUString& _sValue);
73 
74 	private:
75 		static ::com::sun::star::util::Time implGetTime(double _nValue);
76 		static ::com::sun::star::util::Date implGetDate(double _nValue);
77 	};
78 // -----------------------------------------------------------------------------
79 } // namespace rptxml
80 // -----------------------------------------------------------------------------
81 
82 #endif // RPT_XMLCONTROLPROPERTY_HXX
83