xref: /AOO41X/main/framework/inc/dispatch/basedispatcher.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef __FRAMEWORK_DISPATCH_BASEDISPATCHER_HXX_
29*cdf0e10cSrcweir #define __FRAMEWORK_DISPATCH_BASEDISPATCHER_HXX_
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
32*cdf0e10cSrcweir //	my own includes
33*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <classes/taskcreator.hxx>
36*cdf0e10cSrcweir #include <threadhelp/resetableguard.hxx>
37*cdf0e10cSrcweir #include <threadhelp/threadhelpbase.hxx>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #ifndef __FRAMEWORK_THREADHELP_TRANSACTIONBASE_HXX_
40*cdf0e10cSrcweir #include <threadhelp/transactionbase.hxx>
41*cdf0e10cSrcweir #endif
42*cdf0e10cSrcweir #include <macros/xinterface.hxx>
43*cdf0e10cSrcweir #include <macros/xtypeprovider.hxx>
44*cdf0e10cSrcweir #include <macros/debug.hxx>
45*cdf0e10cSrcweir #include <macros/generic.hxx>
46*cdf0e10cSrcweir #include <stdtypes.h>
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
49*cdf0e10cSrcweir //	interface includes
50*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
51*cdf0e10cSrcweir #include <com/sun/star/lang/XTypeProvider.hpp>
52*cdf0e10cSrcweir #include <com/sun/star/frame/XNotifyingDispatch.hpp>
53*cdf0e10cSrcweir #include <com/sun/star/util/URL.hpp>
54*cdf0e10cSrcweir #include <com/sun/star/frame/DispatchDescriptor.hpp>
55*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
56*cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchResultListener.hpp>
57*cdf0e10cSrcweir #include <com/sun/star/frame/XFrameLoader.hpp>
58*cdf0e10cSrcweir #include <com/sun/star/frame/XLoadEventListener.hpp>
59*cdf0e10cSrcweir #include <com/sun/star/frame/XDesktop.hpp>
60*cdf0e10cSrcweir #include <com/sun/star/frame/FeatureStateEvent.hpp>
61*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
64*cdf0e10cSrcweir //	other includes
65*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
66*cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
67*cdf0e10cSrcweir #include <cppuhelper/weakref.hxx>
68*cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.h>
69*cdf0e10cSrcweir /*DRAFT
70*cdf0e10cSrcweir #include <unotools/historyoptions.hxx>
71*cdf0e10cSrcweir */
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
74*cdf0e10cSrcweir //	namespace
75*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir namespace framework{
78*cdf0e10cSrcweir 
79*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
80*cdf0e10cSrcweir //	exported const
81*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
84*cdf0e10cSrcweir //	exported definitions
85*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir /*-************************************************************************************************************//**
88*cdf0e10cSrcweir     @descr      We must support loading of different URLs with different handler or loader into different tasks simultaniously.
89*cdf0e10cSrcweir                 They call us back to return state of operation. We need some informations to distinguish
90*cdf0e10cSrcweir                 between these different "loading threads".
91*cdf0e10cSrcweir                 This is the reason to implement this dynamicly list.
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir     @attention  I maked class LoaderThreads threadsafe! Using will be easier in a multithreaded environment.
94*cdf0e10cSrcweir                 struct DispatchBinding doesn't need that!
95*cdf0e10cSrcweir *//*-*************************************************************************************************************/
96*cdf0e10cSrcweir struct LoadBinding
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
99*cdf0e10cSrcweir     public:
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
102*cdf0e10cSrcweir         inline LoadBinding()
103*cdf0e10cSrcweir         {
104*cdf0e10cSrcweir             free();
105*cdf0e10cSrcweir         }
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
108*cdf0e10cSrcweir         // use to initialize struct for asynchronous dispatching by using handler
109*cdf0e10cSrcweir         inline LoadBinding( const css::util::URL&                                   aNewURL         ,
110*cdf0e10cSrcweir                             const css::uno::Sequence< css::beans::PropertyValue >   lNewDescriptor  ,
111*cdf0e10cSrcweir                             const css::uno::Reference< css::frame::XDispatch >&     xNewHandler     ,
112*cdf0e10cSrcweir                             const css::uno::Any&                                    aNewAsyncInfo   )
113*cdf0e10cSrcweir         {
114*cdf0e10cSrcweir             free();
115*cdf0e10cSrcweir             xHandler    = xNewHandler   ;
116*cdf0e10cSrcweir             aURL        = aNewURL       ;
117*cdf0e10cSrcweir             lDescriptor = lNewDescriptor;
118*cdf0e10cSrcweir             aAsyncInfo  = aNewAsyncInfo ;
119*cdf0e10cSrcweir         }
120*cdf0e10cSrcweir 
121*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
122*cdf0e10cSrcweir         // use to initialize struct for asynchronous loading by using frame loader
123*cdf0e10cSrcweir         inline LoadBinding( const css::util::URL&                                   aNewURL         ,
124*cdf0e10cSrcweir                             const css::uno::Sequence< css::beans::PropertyValue >   lNewDescriptor  ,
125*cdf0e10cSrcweir                             const css::uno::Reference< css::frame::XFrame >&        xNewFrame       ,
126*cdf0e10cSrcweir                             const css::uno::Reference< css::frame::XFrameLoader >&  xNewLoader      ,
127*cdf0e10cSrcweir                             const css::uno::Any&                                    aNewAsyncInfo   )
128*cdf0e10cSrcweir         {
129*cdf0e10cSrcweir             free();
130*cdf0e10cSrcweir             xLoader     = xNewLoader    ;
131*cdf0e10cSrcweir             xFrame      = xNewFrame     ;
132*cdf0e10cSrcweir             aURL        = aNewURL       ;
133*cdf0e10cSrcweir             lDescriptor = lNewDescriptor;
134*cdf0e10cSrcweir             aAsyncInfo  = aNewAsyncInfo ;
135*cdf0e10cSrcweir         }
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
138*cdf0e10cSrcweir         // dont forget toe release used references
139*cdf0e10cSrcweir         inline ~LoadBinding()
140*cdf0e10cSrcweir         {
141*cdf0e10cSrcweir             free();
142*cdf0e10cSrcweir         }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
145*cdf0e10cSrcweir         inline void free()
146*cdf0e10cSrcweir         {
147*cdf0e10cSrcweir             xHandler    = css::uno::Reference< css::frame::XDispatch >()   ;
148*cdf0e10cSrcweir             xLoader     = css::uno::Reference< css::frame::XFrameLoader >();
149*cdf0e10cSrcweir             xFrame      = css::uno::Reference< css::frame::XFrame >()      ;
150*cdf0e10cSrcweir             aURL        = css::util::URL()                                 ;
151*cdf0e10cSrcweir             lDescriptor = css::uno::Sequence< css::beans::PropertyValue >();
152*cdf0e10cSrcweir             aAsyncInfo  = css::uno::Any()                                  ;
153*cdf0e10cSrcweir         }
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
156*cdf0e10cSrcweir     public:
157*cdf0e10cSrcweir         css::uno::Reference< css::frame::XDispatch >        xHandler    ;   // if handler was used, this reference will be valid
158*cdf0e10cSrcweir         css::uno::Reference< css::frame::XFrameLoader >     xLoader     ;   // if loader was used, this reference will be valid
159*cdf0e10cSrcweir         css::uno::Reference< css::frame::XFrame >           xFrame      ;   // Target of loading
160*cdf0e10cSrcweir         css::util::URL                                      aURL        ;   // dispatched URL - neccessary to find listener for status event!
161*cdf0e10cSrcweir         css::uno::Sequence< css::beans::PropertyValue >     lDescriptor ;   // dispatched arguments - neccessary for "reactForLoadingState()"!
162*cdf0e10cSrcweir         css::uno::Any                                       aAsyncInfo  ;   // superclasses could use them to save her own user specific data for these asynchron call-info
163*cdf0e10cSrcweir         css::uno::Reference< css::frame::XDispatchResultListener > xListener;
164*cdf0e10cSrcweir };
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir //*****************************************************************************************************************
167*cdf0e10cSrcweir class LoaderThreads : private ::std::vector< LoadBinding >
168*cdf0e10cSrcweir                     , private ThreadHelpBase
169*cdf0e10cSrcweir {
170*cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
171*cdf0e10cSrcweir     public:
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
174*cdf0e10cSrcweir         inline LoaderThreads()
175*cdf0e10cSrcweir                 : ThreadHelpBase()
176*cdf0e10cSrcweir         {
177*cdf0e10cSrcweir         }
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
180*cdf0e10cSrcweir         inline void append( const LoadBinding& aBinding )
181*cdf0e10cSrcweir         {
182*cdf0e10cSrcweir             ResetableGuard aGuard( m_aLock );
183*cdf0e10cSrcweir             push_back( aBinding );
184*cdf0e10cSrcweir         }
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
187*cdf0e10cSrcweir         /// search for handler thread in list wich match given parameter and delete it
188*cdf0e10cSrcweir         inline sal_Bool searchAndForget( const css::uno::Reference < css::frame::XDispatchResultListener >& rListener, LoadBinding& aBinding )
189*cdf0e10cSrcweir         {
190*cdf0e10cSrcweir             ResetableGuard aGuard( m_aLock );
191*cdf0e10cSrcweir             sal_Bool bFound = sal_False;
192*cdf0e10cSrcweir             for( iterator pItem=begin(); pItem!=end(); ++pItem )
193*cdf0e10cSrcweir             {
194*cdf0e10cSrcweir                 if( pItem->xListener == rListener )
195*cdf0e10cSrcweir                 {
196*cdf0e10cSrcweir                     aBinding = *pItem;
197*cdf0e10cSrcweir                     erase( pItem );
198*cdf0e10cSrcweir                     bFound = sal_True;
199*cdf0e10cSrcweir                     break;
200*cdf0e10cSrcweir                 }
201*cdf0e10cSrcweir             }
202*cdf0e10cSrcweir             return bFound;
203*cdf0e10cSrcweir         }
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
206*cdf0e10cSrcweir         /// search for loader thread in list wich match given parameter and delete it
207*cdf0e10cSrcweir         inline sal_Bool searchAndForget( const css::uno::Reference< css::frame::XFrameLoader > xLoader, LoadBinding& aBinding )
208*cdf0e10cSrcweir         {
209*cdf0e10cSrcweir             ResetableGuard aGuard( m_aLock );
210*cdf0e10cSrcweir             sal_Bool bFound = sal_False;
211*cdf0e10cSrcweir             for( iterator pItem=begin(); pItem!=end(); ++pItem )
212*cdf0e10cSrcweir             {
213*cdf0e10cSrcweir                 if( pItem->xLoader == xLoader )
214*cdf0e10cSrcweir                 {
215*cdf0e10cSrcweir                     aBinding = *pItem;
216*cdf0e10cSrcweir                     erase( pItem );
217*cdf0e10cSrcweir                     bFound = sal_True;
218*cdf0e10cSrcweir                     break;
219*cdf0e10cSrcweir                 }
220*cdf0e10cSrcweir             }
221*cdf0e10cSrcweir             return bFound;
222*cdf0e10cSrcweir         }
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir         //---------------------------------------------------------------------------------------------------------
225*cdf0e10cSrcweir         // free ALL memory ... I hope it
226*cdf0e10cSrcweir         inline void free()
227*cdf0e10cSrcweir         {
228*cdf0e10cSrcweir             ResetableGuard aGuard( m_aLock );
229*cdf0e10cSrcweir             LoaderThreads().swap( *this );
230*cdf0e10cSrcweir         }
231*cdf0e10cSrcweir };
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir /*-************************************************************************************************************//**
234*cdf0e10cSrcweir     @short          base class for dispatcher implementations
235*cdf0e10cSrcweir     @descr          Most of our dispatch implementations do everytime the same. They try to handle or load
236*cdf0e10cSrcweir                     somethinmg into a target ... normaly a frame/task/pluginframe!
237*cdf0e10cSrcweir                     They must do it synchron or sometimes asynchron. They must wait for callbacks and
238*cdf0e10cSrcweir                     notify registered listener with right status events.
239*cdf0e10cSrcweir                     All these things are implemented by this baseclass. You should override some methods
240*cdf0e10cSrcweir                     to change something.
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir                     "dispatch()"                =>  should be you dispatch algorithm
243*cdf0e10cSrcweir                     "reactForLoadingState()"    =>  do something depending from loading state ...
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir 	@implements		XInterface
246*cdf0e10cSrcweir 					XDispatch
247*cdf0e10cSrcweir                     XLoadEventListener
248*cdf0e10cSrcweir 					XEventListener
249*cdf0e10cSrcweir 
250*cdf0e10cSrcweir 	@base			ThreadHelpBase
251*cdf0e10cSrcweir                     TransactionBase
252*cdf0e10cSrcweir 					OWeakObject
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir 	@devstatus		ready to use
255*cdf0e10cSrcweir     @threadsafe     yes
256*cdf0e10cSrcweir *//*-*************************************************************************************************************/
257*cdf0e10cSrcweir class BaseDispatcher    :   // interfaces
258*cdf0e10cSrcweir                             public    css::lang::XTypeProvider                 ,
259*cdf0e10cSrcweir                             public    css::frame::XNotifyingDispatch           ,
260*cdf0e10cSrcweir                             public    css::frame::XLoadEventListener           ,   // => XEventListener too!
261*cdf0e10cSrcweir                             // baseclasses
262*cdf0e10cSrcweir                             // Order is neccessary for right initialization!
263*cdf0e10cSrcweir                             protected ThreadHelpBase                           ,
264*cdf0e10cSrcweir                             protected TransactionBase                          ,
265*cdf0e10cSrcweir                             public    ::cppu::OWeakObject
266*cdf0e10cSrcweir {
267*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
268*cdf0e10cSrcweir 	//	public methods
269*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
270*cdf0e10cSrcweir 	public:
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir 		//	constructor / destructor
273*cdf0e10cSrcweir         BaseDispatcher( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory    ,
274*cdf0e10cSrcweir                         const css::uno::Reference< css::frame::XFrame >&              xOwnerFrame );
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir         void dispatchFinished ( const css::frame::DispatchResultEvent& aEvent, const css::uno::Reference < css::frame::XDispatchResultListener >& rListener );
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 		//	XInterface
279*cdf0e10cSrcweir 		DECLARE_XINTERFACE
280*cdf0e10cSrcweir 		DECLARE_XTYPEPROVIDER
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir         //  XNotifyingDispatch
283*cdf0e10cSrcweir         virtual void SAL_CALL dispatchWithNotification ( const css::util::URL& aURL,
284*cdf0e10cSrcweir                                                       const css::uno::Sequence< css::beans::PropertyValue >& aArgs,
285*cdf0e10cSrcweir                                                       const css::uno::Reference< css::frame::XDispatchResultListener >& Listener ) throw ( css::uno::RuntimeException);
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir         //  XDispatch
288*cdf0e10cSrcweir         virtual void SAL_CALL dispatch              ( const css::util::URL&                                     aURL       ,
289*cdf0e10cSrcweir                                                       const css::uno::Sequence< css::beans::PropertyValue >&    lArguments ) throw( css::uno::RuntimeException ) = 0;
290*cdf0e10cSrcweir         virtual void SAL_CALL addStatusListener     ( const css::uno::Reference< css::frame::XStatusListener >& xListener  ,
291*cdf0e10cSrcweir                                                       const css::util::URL&                                     aURL       ) throw( css::uno::RuntimeException );
292*cdf0e10cSrcweir         virtual void SAL_CALL removeStatusListener  ( const css::uno::Reference< css::frame::XStatusListener >& xListener  ,
293*cdf0e10cSrcweir                                                       const css::util::URL&                                     aURL       ) throw( css::uno::RuntimeException );
294*cdf0e10cSrcweir 
295*cdf0e10cSrcweir         //   XLoadEventListener
296*cdf0e10cSrcweir         virtual void SAL_CALL loadFinished          ( const css::uno::Reference< css::frame::XFrameLoader >&    xLoader    ) throw( css::uno::RuntimeException );
297*cdf0e10cSrcweir         virtual void SAL_CALL loadCancelled         ( const css::uno::Reference< css::frame::XFrameLoader >&    xLoader    ) throw( css::uno::RuntimeException );
298*cdf0e10cSrcweir 
299*cdf0e10cSrcweir 		//	 XEventListener
300*cdf0e10cSrcweir         virtual void SAL_CALL disposing             ( const css::lang::EventObject&                             aEvent     ) throw( css::uno::RuntimeException );
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
303*cdf0e10cSrcweir 	//	protected methods
304*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
305*cdf0e10cSrcweir 	protected:
306*cdf0e10cSrcweir         virtual ~BaseDispatcher();
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir         /*-****************************************************************************************************//**
309*cdf0e10cSrcweir             @short      you should react for successfully or failed load/handle operations.
310*cdf0e10cSrcweir             @descr      These baseclass implement handling of dispatched URLs and synchronous/asynchronous loading
311*cdf0e10cSrcweir                         of it into a target frame. It implement the complete listener mechanism to get events from
312*cdf0e10cSrcweir                         used loader or handler and sending of status events to registered listener too!
313*cdf0e10cSrcweir                         But we couldn't react for this events in all cases.
314*cdf0e10cSrcweir                         May be - you wish to reactivate suspended controllers or wish to delete a new created
315*cdf0e10cSrcweir                         task if operation failed ...!?
316*cdf0e10cSrcweir                         By overwriting these pure virtual methods it's possible to do such things.
317*cdf0e10cSrcweir                         We call you with all available informations ... you should react for it.
318*cdf0e10cSrcweir                         BUT - don't send any status events to your listener! We will do it everytime.
319*cdf0e10cSrcweir                         (other listener could be informed as well!)
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir                         You will called back in: a) "reactForLoadingState()" , if URL was loaded into a frame
322*cdf0e10cSrcweir                                                  b) "reactForHandlingState()", if URL was handled by a registered content handler
323*cdf0e10cSrcweir                                                                                (without using a target frame!)
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir             @seealso    method statusChanged()
326*cdf0e10cSrcweir             @seealso    method loadFinished()
327*cdf0e10cSrcweir             @seealso    method loadCancelled()
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir             @param      "aURL"         , original dispatched URL
330*cdf0e10cSrcweir             @param      "lDescriptor"  , original dispatched arguments
331*cdf0e10cSrcweir             @param      "xTarget"      , target of operation (could be NULL if URL was handled not loaded!)
332*cdf0e10cSrcweir             @param      "bState"       , state of operation
333*cdf0e10cSrcweir             @return     -
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir             @onerror    -
336*cdf0e10cSrcweir             @threadsafe -
337*cdf0e10cSrcweir         *//*-*****************************************************************************************************/
338*cdf0e10cSrcweir         virtual void SAL_CALL reactForLoadingState ( const css::util::URL&                                  aURL          ,
339*cdf0e10cSrcweir                                                      const css::uno::Sequence< css::beans::PropertyValue >& lDescriptor   ,
340*cdf0e10cSrcweir                                                      const css::uno::Reference< css::frame::XFrame >&       xTarget       ,
341*cdf0e10cSrcweir                                                            sal_Bool                                         bState        ,
342*cdf0e10cSrcweir                                                      const css::uno::Any&                                   aAsyncInfo    ) = 0;
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir         virtual void SAL_CALL reactForHandlingState( const css::util::URL&                                  aURL          ,
345*cdf0e10cSrcweir                                                      const css::uno::Sequence< css::beans::PropertyValue >& lDescriptor   ,
346*cdf0e10cSrcweir                                                            sal_Bool                                         bState        ,
347*cdf0e10cSrcweir                                                      const css::uno::Any&                                   aAsyncInfo    ) = 0;
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
350*cdf0e10cSrcweir     //  protected methods
351*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
352*cdf0e10cSrcweir     protected:
353*cdf0e10cSrcweir         ::rtl::OUString implts_detectType           ( const css::util::URL&                                   aURL            ,
354*cdf0e10cSrcweir                                                             css::uno::Sequence< css::beans::PropertyValue >&  lDescriptor     ,
355*cdf0e10cSrcweir                                                             sal_Bool                                          bDeep           );
356*cdf0e10cSrcweir         sal_Bool        implts_handleIt             ( const css::util::URL&                                   aURL            ,
357*cdf0e10cSrcweir                                                             css::uno::Sequence< css::beans::PropertyValue >&  lDescriptor     ,
358*cdf0e10cSrcweir                                                       const ::rtl::OUString&                                  sTypeName       ,
359*cdf0e10cSrcweir                                                       const css::uno::Any&                                    aAsyncInfo      = css::uno::Any() );
360*cdf0e10cSrcweir         sal_Bool        implts_loadIt               ( const css::util::URL&                                   aURL            ,
361*cdf0e10cSrcweir                                                             css::uno::Sequence< css::beans::PropertyValue >&  lDescriptor     ,
362*cdf0e10cSrcweir                                                       const ::rtl::OUString&                                  sTypeName       ,
363*cdf0e10cSrcweir                                                       const css::uno::Reference< css::frame::XFrame >&        xTarget         ,
364*cdf0e10cSrcweir                                                       const css::uno::Any&                                    aAsyncInfo      = css::uno::Any() );
365*cdf0e10cSrcweir         void            implts_enableFrame          ( const css::uno::Reference< css::frame::XFrame >&        xFrame          ,
366*cdf0e10cSrcweir                                                       const css::uno::Sequence< css::beans::PropertyValue >&  lDescriptor     );
367*cdf0e10cSrcweir         void            implts_disableFrame         ( const css::uno::Reference< css::frame::XFrame >&        xFrame          );
368*cdf0e10cSrcweir         sal_Bool        implts_deactivateController ( const css::uno::Reference< css::frame::XController >&   xController     );
369*cdf0e10cSrcweir         sal_Bool        implts_reactivateController ( const css::uno::Reference< css::frame::XController >&   xController     );
370*cdf0e10cSrcweir         void            implts_sendResultEvent      ( const css::uno::Reference< css::frame::XFrame >&        xEventSource    ,
371*cdf0e10cSrcweir                                                       const ::rtl::OUString&                                  sURL            ,
372*cdf0e10cSrcweir                                                             sal_Bool                                          bLoadState      );
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
375*cdf0e10cSrcweir 	//	variables
376*cdf0e10cSrcweir     //  - should be private normaly ...
377*cdf0e10cSrcweir     //  - but some super classes need access to some of them => protected!
378*cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
379*cdf0e10cSrcweir     protected:
380*cdf0e10cSrcweir         css::uno::Reference< css::lang::XMultiServiceFactory >      m_xFactory            ;   /// global uno service manager to create new services
381*cdf0e10cSrcweir         css::uno::WeakReference< css::frame::XFrame >               m_xOwner              ;   /// weakreference to owner (Don't use a hard reference. Owner can't delete us then!)
382*cdf0e10cSrcweir 
383*cdf0e10cSrcweir     private:
384*cdf0e10cSrcweir         LoaderThreads                                               m_aLoaderThreads      ;   /// list of bindings between handler/loader, tasks and loaded URLs
385*cdf0e10cSrcweir         ListenerHash                                                m_aListenerContainer  ;   /// hash table for listener at specified URLs
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir };      //  class BaseDispatcher
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir }		//	namespace framework
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir #endif  //  #ifndef __FRAMEWORK_DISPATCH_BASEDISPATCHER_HXX_
392