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 _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
25 #define _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
26 
27 #include <com/sun/star/i18n/XNumberFormatCode.hpp>
28 #include "unotools/unotoolsdllapi.h"
29 
30 namespace com { namespace sun { namespace star {
31 	namespace lang {
32 		class XMultiServiceFactory;
33 	}
34 }}}
35 
36 
37 class UNOTOOLS_DLLPUBLIC NumberFormatCodeWrapper
38 {
39 	::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
40 	::com::sun::star::uno::Reference< ::com::sun::star::i18n::XNumberFormatCode >	xNFC;
41 	::com::sun::star::lang::Locale			aLocale;
42 
43 								// not implemented, prevent usage
44 								NumberFormatCodeWrapper( const NumberFormatCodeWrapper& );
45 			NumberFormatCodeWrapper&	operator=( const NumberFormatCodeWrapper& );
46 
47 public:
48 								NumberFormatCodeWrapper(
49 									const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
50 									const ::com::sun::star::lang::Locale& rLocale
51 									);
52 
53 								~NumberFormatCodeWrapper();
54 
55 
56 	/// set a new Locale
57 			void				setLocale( const ::com::sun::star::lang::Locale& rLocale );
58 
59 	/// get current Locale
getLocale() const60 	const ::com::sun::star::lang::Locale& getLocale() const	{ return aLocale; }
61 
62 
63 	// Wrapper implementations of class NumberFormatCodeMapper
64 
65 	::com::sun::star::i18n::NumberFormatCode getDefault( sal_Int16 nFormatType, sal_Int16 nFormatUsage ) const;
66 	::com::sun::star::i18n::NumberFormatCode getFormatCode( sal_Int16 nFormatIndex ) const;
67 	::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > getAllFormatCode( sal_Int16 nFormatUsage ) const;
68 	::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > getAllFormatCodes() const;
69 
70 };
71 
72 #endif // _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
73