xref: /trunk/main/framework/inc/dispatch/blankdispatcher.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef __FRAMEWORK_DISPATCH_BLANKDISPATCHER_HXX_
29 #define __FRAMEWORK_DISPATCH_BLANKDISPATCHER_HXX_
30 
31 //_________________________________________________________________________________________________________________
32 //  my own includes
33 //_________________________________________________________________________________________________________________
34 
35 #include <dispatch/basedispatcher.hxx>
36 
37 //_________________________________________________________________________________________________________________
38 //  interface includes
39 //_________________________________________________________________________________________________________________
40 
41 //_________________________________________________________________________________________________________________
42 //  other includes
43 //_________________________________________________________________________________________________________________
44 
45 //_________________________________________________________________________________________________________________
46 //  namespace
47 //_________________________________________________________________________________________________________________
48 
49 namespace framework{
50 
51 //_________________________________________________________________________________________________________________
52 //  exported const
53 //_________________________________________________________________________________________________________________
54 
55 //_________________________________________________________________________________________________________________
56 //  exported definitions
57 //_________________________________________________________________________________________________________________
58 
59 /*-************************************************************************************************************//**
60     @short          helper for desktop only(!) to create new tasks on demand for dispatches
61     @descr          Use this class as member only! Never use it as baseclass.
62                     XInterface will be ambigous and we hold a weakreference to ouer OWNER - not to ouer SUPERCLASS!
63 
64     @implements     XInterface
65                     XDispatch
66                     XStatusListener
67                     XLoadEventListener
68                     XEventListener
69 
70     @base           BaseDispatcher
71                     OWeakObject
72 
73     @devstatus      ready to use
74     @threadsafe     yes
75 *//*-*************************************************************************************************************/
76 class BlankDispatcher   :   // -interfaces  ... are supported by our BaseDispatcher!
77                             // -baseclasses ... order is neccessary for right initialization!
78                             public BaseDispatcher
79 {
80     //-------------------------------------------------------------------------------------------------------------
81     //  public methods
82     //-------------------------------------------------------------------------------------------------------------
83     public:
84         //  ctor
85                               BlankDispatcher     ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory    ,
86                                                     const css::uno::Reference< css::frame::XFrame >&              xDesktop,
87                                                     sal_Bool bIsDefaultDispatcher    );
88         //  XDispatch
89         virtual void SAL_CALL dispatch            ( const css::util::URL&                                         aURL        ,
90                                                     const css::uno::Sequence< css::beans::PropertyValue >&        lArguments  ) throw( css::uno::RuntimeException );
91 
92     //-------------------------------------------------------------------------------------------------------------
93     //  protected methods
94     //-------------------------------------------------------------------------------------------------------------
95     protected:
96         virtual void SAL_CALL reactForLoadingState ( const css::util::URL&                                        aURL        ,
97                                                      const css::uno::Sequence< css::beans::PropertyValue >&       lDescriptor ,
98                                                      const css::uno::Reference< css::frame::XFrame >&             xTarget     ,
99                                                            sal_Bool                                               bState      ,
100                                                      const css::uno::Any&                                         aAsyncInfo  );
101 
102         virtual void SAL_CALL reactForHandlingState( const css::util::URL&                                        aURL        ,
103                                                      const css::uno::Sequence< css::beans::PropertyValue >&       lDescriptor ,
104                                                            sal_Bool                                               bState      ,
105                                                      const css::uno::Any&                                         aAsyncInfo  );
106 
107     //-------------------------------------------------------------------------------------------------------------
108     //  protected methods
109     //-------------------------------------------------------------------------------------------------------------
110     private:
111         sal_Bool implts_findAndActivateAlreadyLoadedTask( const css::util::URL&                                   aURL       ,
112                                                           const css::uno::Sequence< css::beans::PropertyValue >&  lArguments ,
113                                                           const css::uno::Reference< css::frame::XFrame >         xDesktop   );
114 
115         css::uno::Reference< css::frame::XFrame > implts_findAndLockRecycleTask( const css::util::URL&                                   aURL       ,
116                                                                                  const css::uno::Sequence< css::beans::PropertyValue >&  lArguments ,
117                                                                                  const css::uno::Reference< css::frame::XFrame >         xDesktop   );
118 
119     //-------------------------------------------------------------------------------------------------------------
120     //  variables
121     //  (should be private everyway!)
122     //-------------------------------------------------------------------------------------------------------------
123     private:
124         sal_Bool        m_bIsDefaultDispatcher;
125 };      //  class BlankDispatcher
126 
127 }       //  namespace framework
128 
129 #endif  //  #ifndef __FRAMEWORK_DISPATCH_BLANKDISPATCHER_HXX_
130