xref: /trunk/main/svl/inc/svl/numuno.hxx (revision 39a19a47)
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 #ifndef _NUMUNO_HXX
24 #define _NUMUNO_HXX
25 
26 #include "svl/svldllapi.h"
27 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
28 #include <com/sun/star/lang/XUnoTunnel.hpp>
29 #include <cppuhelper/implbase2.hxx>
30 
31 class SvNumberFormatter;
32 class SvNumFmtSuppl_Impl;
33 
34 namespace comphelper
35 {
36     class SharedMutex;
37 }
38 
39 //------------------------------------------------------------------
40 
41 //	SvNumberFormatterServiceObj must be registered as service somewhere
42 
43 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
44 	SvNumberFormatterServiceObj_NewInstance(
45 		const com::sun::star::uno::Reference<
46 			com::sun::star::lang::XMultiServiceFactory>& rSMgr );
47 
48 //------------------------------------------------------------------
49 
50 //	SvNumberFormatsSupplierObj: aggregate to document,
51 //	construct with SvNumberFormatter
52 
53 class SVL_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2<
54 									com::sun::star::util::XNumberFormatsSupplier,
55 									com::sun::star::lang::XUnoTunnel>
56 {
57 private:
58 	SvNumFmtSuppl_Impl*	pImpl;
59 
60 public:
61 								SvNumberFormatsSupplierObj();
62 								SvNumberFormatsSupplierObj(SvNumberFormatter* pForm);
63 	virtual						~SvNumberFormatsSupplierObj();
64 
65 	void						SetNumberFormatter(SvNumberFormatter* pNew);
66 	SvNumberFormatter*			GetNumberFormatter() const;
67 
68 								// ueberladen, um Attribute im Dokument anzupassen
69 	virtual void				NumberFormatDeleted(sal_uInt32 nKey);
70 								// ueberladen, um evtl. neu zu formatieren
71 	virtual void				SettingsChanged();
72 
73 								// XNumberFormatsSupplier
74 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
75 								getNumberFormatSettings()
76 									throw(::com::sun::star::uno::RuntimeException);
77 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
78 								getNumberFormats()
79 									throw(::com::sun::star::uno::RuntimeException);
80 
81 								// XUnoTunnel
82 	virtual sal_Int64 SAL_CALL	getSomething( const ::com::sun::star::uno::Sequence<
83 									sal_Int8 >& aIdentifier )
84 										throw(::com::sun::star::uno::RuntimeException);
85 
86 	static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
87 	static SvNumberFormatsSupplierObj* getImplementation( const com::sun::star::uno::Reference<
88 									com::sun::star::util::XNumberFormatsSupplier> xObj );
89 
90     ::comphelper::SharedMutex&  getSharedMutex() const;
91 };
92 
93 #endif // #ifndef _NUMUNO_HXX
94 
95 
96