xref: /aoo42x/main/svl/source/numbers/supservs.hxx (revision 86e1cf34)
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 _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
25 #define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
26 
27 #include <svl/numuno.hxx>
28 #include <svl/zforlist.hxx>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/io/XPersistObject.hpp>
32 
33 //=========================================================================
34 //= SvNumberFormatsSupplierServiceObject - a number formats supplier which
35 //=				- can be instantiated as an service
36 //=				- supports the ::com::sun::star::io::XPersistObject interface
37 //=				- works with it's own SvNumberFormatter instance
38 //=				- can be initialized (::com::sun::star::lang::XInitialization)
39 //=					with a specific language (i.e. ::com::sun::star::lang::Locale)
40 //=========================================================================
41 class SvNumberFormatsSupplierServiceObject
42 			:protected SvNumberFormatsSupplierObj
43 			,public ::com::sun::star::lang::XInitialization
44 			,public ::com::sun::star::io::XPersistObject
45 			,public ::com::sun::star::lang::XServiceInfo
46 {	// don't want the Set-/GetNumberFormatter to be accessible from outside
47 
48 	friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
49 		SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(
50 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
51 
52 protected:
53 	SvNumberFormatter*	m_pOwnFormatter;
54 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
55 						m_xORB;
56 
57 public:
58 	SvNumberFormatsSupplierServiceObject(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
59 	~SvNumberFormatsSupplierServiceObject();
60 
61 	// XInterface
acquire()62 	virtual void SAL_CALL acquire() throw() { SvNumberFormatsSupplierObj::acquire(); }
release()63 	virtual void SAL_CALL release() throw() { SvNumberFormatsSupplierObj::release(); }
queryInterface(const::com::sun::star::uno::Type & _rType)64 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException)
65 		{ return SvNumberFormatsSupplierObj::queryInterface(_rType); }
66 
67 	// XAggregation
68 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
69 
70 	// XInitialization
71 	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);
72 
73 	// XServiceInfo
74     virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
75     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
76     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
77 
78 	// XPersistObject
79     virtual ::rtl::OUString SAL_CALL getServiceName(  ) throw(::com::sun::star::uno::RuntimeException);
80     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);
81     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);
82 
83 	// XNumberFormatsSupplier
84 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
85 				getNumberFormatSettings() throw(::com::sun::star::uno::RuntimeException);
86 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
87 				getNumberFormats() throw(::com::sun::star::uno::RuntimeException);
88 
89 	// XUnoTunnler
90     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
91 
92 protected:
93 	void implEnsureFormatter();
94 };
95 
96 
97 #endif // _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
98 
99