1f8e07b45SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f8e07b45SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f8e07b45SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f8e07b45SAndrew Rist  * distributed with this work for additional information
6f8e07b45SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f8e07b45SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f8e07b45SAndrew Rist  * "License"); you may not use this file except in compliance
9f8e07b45SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f8e07b45SAndrew Rist  *
11f8e07b45SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f8e07b45SAndrew Rist  *
13f8e07b45SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f8e07b45SAndrew Rist  * software distributed under the License is distributed on an
15f8e07b45SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f8e07b45SAndrew Rist  * KIND, either express or implied.  See the License for the
17f8e07b45SAndrew Rist  * specific language governing permissions and limitations
18f8e07b45SAndrew Rist  * under the License.
19f8e07b45SAndrew Rist  *
20f8e07b45SAndrew Rist  *************************************************************/
21f8e07b45SAndrew Rist 
22f8e07b45SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef __FRAMEWORK_DISPATCH_CREATEDISPATCHER_HXX_
25cdf0e10cSrcweir #define __FRAMEWORK_DISPATCH_CREATEDISPATCHER_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir //_________________________________________________________________________________________________________________
28cdf0e10cSrcweir //	my own includes
29cdf0e10cSrcweir //_________________________________________________________________________________________________________________
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <dispatch/basedispatcher.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir //_________________________________________________________________________________________________________________
34cdf0e10cSrcweir //	interface includes
35cdf0e10cSrcweir //_________________________________________________________________________________________________________________
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //_________________________________________________________________________________________________________________
38cdf0e10cSrcweir //	other includes
39cdf0e10cSrcweir //_________________________________________________________________________________________________________________
40cdf0e10cSrcweir 
41cdf0e10cSrcweir //_________________________________________________________________________________________________________________
42cdf0e10cSrcweir //	namespace
43cdf0e10cSrcweir //_________________________________________________________________________________________________________________
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace framework{
46cdf0e10cSrcweir 
47cdf0e10cSrcweir //_________________________________________________________________________________________________________________
48cdf0e10cSrcweir //	exported const
49cdf0e10cSrcweir //_________________________________________________________________________________________________________________
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //_________________________________________________________________________________________________________________
52cdf0e10cSrcweir //	exported definitions
53cdf0e10cSrcweir //_________________________________________________________________________________________________________________
54cdf0e10cSrcweir 
55cdf0e10cSrcweir /*-************************************************************************************************************//**
56cdf0e10cSrcweir     @short          helper to create new frames by using non special target name and CREATE flag
57cdf0e10cSrcweir     @descr          If user whish to find any frame by name or will create it, if it not already exist ...
58cdf0e10cSrcweir                     these dispatch helper should be used. Because - a frame must be created at dispatch call ...
59cdf0e10cSrcweir                     not on queryDispatch()! So we hold weakreferences to the possible parent frame, safe the name
60cdf0e10cSrcweir                     of new frame. If user call dispatch at us - we check a weakreference to our last created frame
61cdf0e10cSrcweir                     (he should have same name!) ... if he exist - we do nothing ... if not - we create it again.
62cdf0e10cSrcweir                     But if possible parent for new created task doesn't exist - we couldn't do anything!
63cdf0e10cSrcweir                     Then we wait for our own dispose and do nothing.
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     @attention      Use this class as member only! Never use it as baseclass.
66*b12a77c9Smseidel 					XInterface will be ambiguous and we hold a weakreference to our OWNER - not to our SUPERCLASS!
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	@implements		XInterface
69cdf0e10cSrcweir 					XDispatch
70cdf0e10cSrcweir                     XStatusListener
71cdf0e10cSrcweir                     XLoadEventListener
72cdf0e10cSrcweir 					XEventListener
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     @base           BaseDispatcher
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 	@devstatus		ready to use
77cdf0e10cSrcweir     @threadsafe     yes
78cdf0e10cSrcweir *//*-*************************************************************************************************************/
79cdf0e10cSrcweir class CreateDispatcher  :   // -interfaces  ... are supported by our BaseDispatcher!
8007a3d7f1SPedro Giffuni                             // -baseclasses ... order is necessary for right initialization!
81cdf0e10cSrcweir                             public BaseDispatcher
82cdf0e10cSrcweir {
83cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
84cdf0e10cSrcweir 	//	public methods
85cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
86cdf0e10cSrcweir 	public:
87cdf0e10cSrcweir         //  ctor
88cdf0e10cSrcweir                               CreateDispatcher    ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory    ,
89cdf0e10cSrcweir                                                     const css::uno::Reference< css::frame::XFrame >&              xParent     ,
90cdf0e10cSrcweir                                                     const rtl::OUString&                                          sName       );
91cdf0e10cSrcweir 		//	XDispatch
92cdf0e10cSrcweir         virtual void SAL_CALL dispatch            ( const css::util::URL&                                         aURL        ,
93cdf0e10cSrcweir                                                     const css::uno::Sequence< css::beans::PropertyValue >&        lArguments  ) throw( css::uno::RuntimeException );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     //-------------------------------------------------------------------------------------------------------------
96cdf0e10cSrcweir     //  protected methods
97cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
98cdf0e10cSrcweir     protected:
99cdf0e10cSrcweir         virtual void SAL_CALL reactForLoadingState ( const css::util::URL&                                        aURL        ,
100cdf0e10cSrcweir                                                      const css::uno::Sequence< css::beans::PropertyValue >&       lDescriptor ,
101cdf0e10cSrcweir                                                      const css::uno::Reference< css::frame::XFrame >&             xTarget     ,
102cdf0e10cSrcweir                                                            sal_Bool                                               bState      ,
103cdf0e10cSrcweir                                                      const css::uno::Any&                                         aAsyncInfo  = css::uno::Any() );
104cdf0e10cSrcweir 
reactForHandlingState(const css::util::URL & aURL,const css::uno::Sequence<css::beans::PropertyValue> & lDescriptor,sal_Bool bState,const css::uno::Any & aAsyncInfo=css::uno::Any ())105cdf0e10cSrcweir         virtual void SAL_CALL reactForHandlingState( const css::util::URL&                                        aURL        ,
106cdf0e10cSrcweir                                                      const css::uno::Sequence< css::beans::PropertyValue >&       lDescriptor ,
107cdf0e10cSrcweir                                                            sal_Bool                                               bState      ,
108cdf0e10cSrcweir                                                      const css::uno::Any&                                         aAsyncInfo  = css::uno::Any() )
109cdf0e10cSrcweir         { LOG_WARNING( "CreateDispatcher::reactForHandlingState()", "Who call this function! It's a non used pure virtual function overload ..." ) }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
112cdf0e10cSrcweir 	//	variables
113cdf0e10cSrcweir 	//	(should be private everyway!)
114cdf0e10cSrcweir 	//-------------------------------------------------------------------------------------------------------------
115cdf0e10cSrcweir 	private:
116cdf0e10cSrcweir         css::uno::WeakReference< css::frame::XFrame >   m_xTarget       ;   /// new created frame (Don't hold hard reference ... target frame couldn't die then!)
117cdf0e10cSrcweir         ::rtl::OUString                                 m_sTargetName   ;   /// name of new created frame
118cdf0e10cSrcweir 
119cdf0e10cSrcweir };      //  class CreateDispatcher
120cdf0e10cSrcweir 
121cdf0e10cSrcweir }		//	namespace framework
122cdf0e10cSrcweir 
123cdf0e10cSrcweir #endif  //  #ifndef __FRAMEWORK_DISPATCH_CREATEDISPATCHER_HXX_
124