merge the formfield patch from ooo-build
[ooovba.git] / svtools / source / numbers / supservs.hxx
blob6efa2de4c62dcd2d2ab9dde626622c55ac711991
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: supservs.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
32 #define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
34 #include "numuno.hxx"
35 #include <svtools/zforlist.hxx>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 #include <com/sun/star/io/XPersistObject.hpp>
40 //=========================================================================
41 //= SvNumberFormatsSupplierServiceObject - a number formats supplier which
42 //= - can be instantiated as an service
43 //= - supports the ::com::sun::star::io::XPersistObject interface
44 //= - works with it's own SvNumberFormatter instance
45 //= - can be initialized (::com::sun::star::lang::XInitialization)
46 //= with a specific language (i.e. ::com::sun::star::lang::Locale)
47 //=========================================================================
48 class SvNumberFormatsSupplierServiceObject
49 :protected SvNumberFormatsSupplierObj
50 ,public ::com::sun::star::lang::XInitialization
51 ,public ::com::sun::star::io::XPersistObject
52 ,public ::com::sun::star::lang::XServiceInfo
53 { // don't want the Set-/GetNumberFormatter to be accessable from outside
55 friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
56 SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(
57 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
59 protected:
60 SvNumberFormatter* m_pOwnFormatter;
61 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
62 m_xORB;
64 public:
65 SvNumberFormatsSupplierServiceObject(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
66 ~SvNumberFormatsSupplierServiceObject();
68 // XInterface
69 virtual void SAL_CALL acquire() throw() { SvNumberFormatsSupplierObj::acquire(); }
70 virtual void SAL_CALL release() throw() { SvNumberFormatsSupplierObj::release(); }
71 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException)
72 { return SvNumberFormatsSupplierObj::queryInterface(_rType); }
74 // XAggregation
75 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
77 // XInitialization
78 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);
80 // XServiceInfo
81 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
82 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
85 // XPersistObject
86 virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException);
87 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);
88 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);
90 // XNumberFormatsSupplier
91 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
92 getNumberFormatSettings() throw(::com::sun::star::uno::RuntimeException);
93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
94 getNumberFormats() throw(::com::sun::star::uno::RuntimeException);
96 // XUnoTunnler
97 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException);
99 protected:
100 void implEnsureFormatter();
104 #endif // _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_