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_SELFDISPATCHER_HXX_ 29 #define __FRAMEWORK_DISPATCH_SELFDISPATCHER_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 to dispatch into an existing owner frame 61 @descr You should use it as dispatcher for "_self", flag::SELF ... cases, to load a document into an 62 owner frame without creation of a new one. 63 Use this class as member only! Never use it as baseclass. 64 XInterface will be ambigous and we hold a weakreference to ouer OWNER - not to ouer SUPERCLASS! 65 66 @implements XInterface 67 XDispatch 68 XStatusListener 69 XLoadEventListener 70 XEventListener 71 72 @base BaseDispatcher 73 OWeakObject 74 75 @devstatus ready to use 76 @threadsafe yes 77 *//*-*************************************************************************************************************/ 78 class SelfDispatcher : // -interfaces ... are supported by our BaseDispatcher! 79 // -baseclasses ... order is neccessary for right initialization! 80 public BaseDispatcher 81 { 82 //------------------------------------------------------------------------------------------------------------- 83 // public methods 84 //------------------------------------------------------------------------------------------------------------- 85 public: 86 // ctor 87 SelfDispatcher ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory , 88 const css::uno::Reference< css::frame::XFrame >& xTarget ); 89 // XDispatch 90 virtual void SAL_CALL dispatch ( const css::util::URL& aURL , 91 const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException ); 92 93 //------------------------------------------------------------------------------------------------------------- 94 // protected methods 95 //------------------------------------------------------------------------------------------------------------- 96 protected: 97 virtual void SAL_CALL reactForLoadingState ( const css::util::URL& aURL , 98 const css::uno::Sequence< css::beans::PropertyValue >& lDescriptor , 99 const css::uno::Reference< css::frame::XFrame >& xTarget , 100 sal_Bool bState , 101 const css::uno::Any& aAsyncInfo ); 102 103 virtual void SAL_CALL reactForHandlingState( const css::util::URL& aURL , 104 const css::uno::Sequence< css::beans::PropertyValue >& lDescriptor , 105 sal_Bool bState , 106 const css::uno::Any& aAsyncInfo ); 107 108 }; // class SelfDispatcher 109 110 } // namespace framework 111 112 #endif // #ifndef __FRAMEWORK_DISPATCH_SELFDISPATCHER_HXX_ 113