1*9ee13d13SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9ee13d13SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9ee13d13SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9ee13d13SAndrew Rist * distributed with this work for additional information 6*9ee13d13SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9ee13d13SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9ee13d13SAndrew Rist * "License"); you may not use this file except in compliance 9*9ee13d13SAndrew Rist * with the License. You may obtain a copy of the License at 10*9ee13d13SAndrew Rist * 11*9ee13d13SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*9ee13d13SAndrew Rist * 13*9ee13d13SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9ee13d13SAndrew Rist * software distributed under the License is distributed on an 15*9ee13d13SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9ee13d13SAndrew Rist * KIND, either express or implied. See the License for the 17*9ee13d13SAndrew Rist * specific language governing permissions and limitations 18*9ee13d13SAndrew Rist * under the License. 19*9ee13d13SAndrew Rist * 20*9ee13d13SAndrew Rist *************************************************************/ 21*9ee13d13SAndrew Rist 22*9ee13d13SAndrew Rist 23cdf0e10cSrcweir #ifndef RPT_XMLCONTROLPROPERTY_HXX 24cdf0e10cSrcweir #define RPT_XMLCONTROLPROPERTY_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <xmloff/xmlictxt.hxx> 27cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 29cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 30cdf0e10cSrcweir #include <com/sun/star/util/Date.hpp> 31cdf0e10cSrcweir #include <com/sun/star/util/Time.hpp> 32cdf0e10cSrcweir 33cdf0e10cSrcweir namespace rptxml 34cdf0e10cSrcweir { 35cdf0e10cSrcweir class ORptFilter; 36cdf0e10cSrcweir class OXMLControlProperty : public SvXMLImportContext 37cdf0e10cSrcweir { 38cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xControl; 39cdf0e10cSrcweir ::com::sun::star::beans::PropertyValue m_aSetting; 40cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aSequence; 41cdf0e10cSrcweir OXMLControlProperty* m_pContainer; 42cdf0e10cSrcweir ::com::sun::star::uno::Type m_aPropType; // the type of the property the instance imports currently 43cdf0e10cSrcweir sal_Bool m_bIsList; 44cdf0e10cSrcweir 45cdf0e10cSrcweir ORptFilter& GetOwnImport(); 46cdf0e10cSrcweir ::com::sun::star::uno::Any convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters); 47cdf0e10cSrcweir OXMLControlProperty(const OXMLControlProperty&); 48cdf0e10cSrcweir void operator =(const OXMLControlProperty&); 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir 51cdf0e10cSrcweir OXMLControlProperty( ORptFilter& rImport 52cdf0e10cSrcweir ,sal_uInt16 nPrfx 53cdf0e10cSrcweir ,const ::rtl::OUString& rLName 54cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList 55cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xControl 56cdf0e10cSrcweir ,OXMLControlProperty* _pContainer = NULL); 57cdf0e10cSrcweir virtual ~OXMLControlProperty(); 58cdf0e10cSrcweir 59cdf0e10cSrcweir virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, 60cdf0e10cSrcweir const ::rtl::OUString& rLocalName, 61cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); 62cdf0e10cSrcweir 63cdf0e10cSrcweir virtual void EndElement(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir virtual void Characters( const ::rtl::OUString& rChars ); 66cdf0e10cSrcweir 67cdf0e10cSrcweir 68cdf0e10cSrcweir /** adds value to property 69cdf0e10cSrcweir @param _sValue 70cdf0e10cSrcweir The value to add. 71cdf0e10cSrcweir */ 72cdf0e10cSrcweir void addValue(const ::rtl::OUString& _sValue); 73cdf0e10cSrcweir 74cdf0e10cSrcweir private: 75cdf0e10cSrcweir static ::com::sun::star::util::Time implGetTime(double _nValue); 76cdf0e10cSrcweir static ::com::sun::star::util::Date implGetDate(double _nValue); 77cdf0e10cSrcweir }; 78cdf0e10cSrcweir // ----------------------------------------------------------------------------- 79cdf0e10cSrcweir } // namespace rptxml 80cdf0e10cSrcweir // ----------------------------------------------------------------------------- 81cdf0e10cSrcweir 82cdf0e10cSrcweir #endif // RPT_XMLCONTROLPROPERTY_HXX 83