xref: /aoo41x/main/svl/source/numbers/supservs.hxx (revision 39a19a47)
1*39a19a47SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*39a19a47SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*39a19a47SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*39a19a47SAndrew Rist  * distributed with this work for additional information
6*39a19a47SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*39a19a47SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*39a19a47SAndrew Rist  * "License"); you may not use this file except in compliance
9*39a19a47SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*39a19a47SAndrew Rist  *
11*39a19a47SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*39a19a47SAndrew Rist  *
13*39a19a47SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*39a19a47SAndrew Rist  * software distributed under the License is distributed on an
15*39a19a47SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*39a19a47SAndrew Rist  * KIND, either express or implied.  See the License for the
17*39a19a47SAndrew Rist  * specific language governing permissions and limitations
18*39a19a47SAndrew Rist  * under the License.
19*39a19a47SAndrew Rist  *
20*39a19a47SAndrew Rist  *************************************************************/
21*39a19a47SAndrew Rist 
22*39a19a47SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
25cdf0e10cSrcweir #define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svl/numuno.hxx>
28cdf0e10cSrcweir #include <svl/zforlist.hxx>
29cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
30cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
31cdf0e10cSrcweir #include <com/sun/star/io/XPersistObject.hpp>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //=========================================================================
34cdf0e10cSrcweir //= SvNumberFormatsSupplierServiceObject - a number formats supplier which
35cdf0e10cSrcweir //=				- can be instantiated as an service
36cdf0e10cSrcweir //=				- supports the ::com::sun::star::io::XPersistObject interface
37cdf0e10cSrcweir //=				- works with it's own SvNumberFormatter instance
38cdf0e10cSrcweir //=				- can be initialized (::com::sun::star::lang::XInitialization)
39cdf0e10cSrcweir //=					with a specific language (i.e. ::com::sun::star::lang::Locale)
40cdf0e10cSrcweir //=========================================================================
41cdf0e10cSrcweir class SvNumberFormatsSupplierServiceObject
42cdf0e10cSrcweir 			:protected SvNumberFormatsSupplierObj
43cdf0e10cSrcweir 			,public ::com::sun::star::lang::XInitialization
44cdf0e10cSrcweir 			,public ::com::sun::star::io::XPersistObject
45cdf0e10cSrcweir 			,public ::com::sun::star::lang::XServiceInfo
46cdf0e10cSrcweir {	// don't want the Set-/GetNumberFormatter to be accessable from outside
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
49cdf0e10cSrcweir 		SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(
50cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
51cdf0e10cSrcweir 
52cdf0e10cSrcweir protected:
53cdf0e10cSrcweir 	SvNumberFormatter*	m_pOwnFormatter;
54cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
55cdf0e10cSrcweir 						m_xORB;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir public:
58cdf0e10cSrcweir 	SvNumberFormatsSupplierServiceObject(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
59cdf0e10cSrcweir 	~SvNumberFormatsSupplierServiceObject();
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	// XInterface
acquire()62cdf0e10cSrcweir 	virtual void SAL_CALL acquire() throw() { SvNumberFormatsSupplierObj::acquire(); }
release()63cdf0e10cSrcweir 	virtual void SAL_CALL release() throw() { SvNumberFormatsSupplierObj::release(); }
queryInterface(const::com::sun::star::uno::Type & _rType)64cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException)
65cdf0e10cSrcweir 		{ return SvNumberFormatsSupplierObj::queryInterface(_rType); }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	// XAggregation
68cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	// XInitialization
71cdf0e10cSrcweir 	virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	// XServiceInfo
74cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
75cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
76cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	// XPersistObject
79cdf0e10cSrcweir     virtual ::rtl::OUString SAL_CALL getServiceName(  ) throw(::com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir     virtual void SAL_CALL write( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& OutStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir     virtual void SAL_CALL read( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream >& InStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 	// XNumberFormatsSupplier
84cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
85cdf0e10cSrcweir 				getNumberFormatSettings() throw(::com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
87cdf0e10cSrcweir 				getNumberFormats() throw(::com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir 
89cdf0e10cSrcweir 	// XUnoTunnler
90cdf0e10cSrcweir     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
91cdf0e10cSrcweir 
92cdf0e10cSrcweir protected:
93cdf0e10cSrcweir 	void implEnsureFormatter();
94cdf0e10cSrcweir };
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 
97cdf0e10cSrcweir #endif // _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
98cdf0e10cSrcweir 
99