1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVL_SOURCE_NUMBERS_SUPSERVS_HXX
21 #define INCLUDED_SVL_SOURCE_NUMBERS_SUPSERVS_HXX
23 #include <svl/numuno.hxx>
24 #include <svl/zforlist.hxx>
25 #include <com/sun/star/lang/XInitialization.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/io/XPersistObject.hpp>
30 * SvNumberFormatsSupplierServiceObject - a number formats supplier which
31 * - can be instantiated as an service
32 * - supports the ::com::sun::star::io::XPersistObject interface
33 * - works with it's own SvNumberFormatter instance
34 * - can be initialized (::com::sun::star::lang::XInitialization)
35 * with a specific language (i.e. ::com::sun::star::lang::Locale)
37 class SvNumberFormatsSupplierServiceObject
38 :protected SvNumberFormatsSupplierObj
39 ,public ::com::sun::star::lang::XInitialization
40 ,public ::com::sun::star::io::XPersistObject
41 ,public ::com::sun::star::lang::XServiceInfo
42 { // don't want the Set-/GetNumberFormatter to be accessible from outside
44 friend ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
45 SAL_CALL
SvNumberFormatsSupplierServiceObject_CreateInstance(
46 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>&);
49 SvNumberFormatter
* m_pOwnFormatter
;
50 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
54 SvNumberFormatsSupplierServiceObject(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rxORB
);
55 ~SvNumberFormatsSupplierServiceObject();
58 virtual void SAL_CALL
acquire() throw() { SvNumberFormatsSupplierObj::acquire(); }
59 virtual void SAL_CALL
release() throw() { SvNumberFormatsSupplierObj::release(); }
60 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& _rType
) throw(::com::sun::star::uno::RuntimeException
)
61 { return SvNumberFormatsSupplierObj::queryInterface(_rType
); }
64 virtual ::com::sun::star::uno::Any SAL_CALL
queryAggregation( const ::com::sun::star::uno::Type
& _rType
) throw(::com::sun::star::uno::RuntimeException
);
67 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
);
70 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
71 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
72 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
75 virtual OUString SAL_CALL
getServiceName( ) throw(::com::sun::star::uno::RuntimeException
);
76 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
);
77 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
);
79 // XNumberFormatsSupplier
80 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> SAL_CALL
81 getNumberFormatSettings() throw(::com::sun::star::uno::RuntimeException
);
82 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormats
> SAL_CALL
83 getNumberFormats() throw(::com::sun::star::uno::RuntimeException
);
86 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw (::com::sun::star::uno::RuntimeException
);
89 void implEnsureFormatter();
93 #endif // INCLUDED_SVL_SOURCE_NUMBERS_SUPSERVS_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */