xref: /aoo4110/main/sc/workben/result.hxx (revision b1cdbd2c)
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 SC_RESULT_HXX
25 #define SC_RESULT_HXX
26 
27 #include <svl/svarray.hxx>
28 #include <vcl/timer.hxx>
29 #include <tools/string.hxx>
30 
31 
32 #include <com/sun/star/sheet/XVolatileResult.hpp>
33 
34 #include <cppuhelper/implbase1.hxx>	// helper for implementations
35 
36 
37 //class XResultListenerRef;
38 typedef ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XResultListener >* XResultListenerPtr;
39 SV_DECL_PTRARR_DEL( XResultListenerArr_Impl, XResultListenerPtr, 4, 4 );
40 
41 
42 class ScAddInResult : public cppu::WeakImplHelper1<
43 								com::sun::star::sheet::XVolatileResult>
44 {
45 private:
46 	String					aArg;
47 	long					nTickCount;
48 	XResultListenerArr_Impl	aListeners;
49 	Timer					aTimer;
50 
51 	DECL_LINK( TimeoutHdl, Timer* );
52 
53 	void 					NewValue();
54 
55 public:
56 							ScAddInResult(const String& rStr);
57 	virtual					~ScAddInResult();
58 
59 //							SMART_UNO_DECLARATION( ScAddInResult, UsrObject );
60 
61 //	virtual BOOL			queryInterface( Uik, XInterfaceRef& );
62 //	virtual XIdlClassRef	getIdlClass(void);
63 
64 							// XVolatileResult
65     virtual void SAL_CALL addResultListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XResultListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
66     virtual void SAL_CALL removeResultListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XResultListener >& aListener ) throw(::com::sun::star::uno::RuntimeException);
67 };
68 
69 
70 #endif
71 
72