update dev300-m58
[ooovba.git] / framework / source / inc / dispatch / loaddispatcher.hxx
blobfbd2bf61f482d7e1d21a24ac0ca73ad6750e287b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: loaddispatcher.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __FRAMEWORK_DISPATCH_LOADDISPATCHER_HXX_
32 #define __FRAMEWORK_DISPATCH_LOADDISPATCHER_HXX_
34 //_______________________________________________
35 // my own includes
37 #include <loadenv/loadenv.hxx>
39 //_______________________________________________
40 // interface includes
41 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
42 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
44 //_______________________________________________
45 // other includes
47 #include <cppuhelper/implbase2.hxx>
49 //_______________________________________________
50 // namespace
52 namespace framework{
54 namespace css = ::com::sun::star;
56 //_______________________________________________
57 // exported const
59 //_______________________________________________
60 // exported definitions
62 /** @short implements a dispatch object which can be used to load
63 non-visible components (by using the mechanism of ContentHandler)
64 or visible-components (by using the mechanism of FrameLoader).
66 @author as96863
68 class LoadDispatcher : private ThreadHelpBase
69 , public ::cppu::WeakImplHelper2< css::frame::XNotifyingDispatch, // => XDispatch => XInterface
70 css::frame::XSynchronousDispatch >
72 //___________________________________________
73 // member
75 private:
77 /** @short can be used to create own needed services on demand. */
78 css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
80 /** @short TODO document me */
81 css::uno::WeakReference< css::frame::XFrame > m_xOwnerFrame;
83 /** @short TODO document me */
84 ::rtl::OUString m_sTarget;
86 /** @short TODO document me */
87 sal_Int32 m_nSearchFlags;
89 /** @short TODO document me */
90 LoadEnv m_aLoader;
92 //___________________________________________
93 // native interface
95 public:
97 /** @short creates a new instance and initialize it with all neccessary parameters.
99 @descr Every instance of such LoadDispatcher can be used for the specified context only.
100 That means: It can be used to load any further requested content into tzhe here(!)
101 specified target frame.
103 @param xSMGR
104 will be used to create own needed services on demand.
106 @param xOwnerFrame
107 used as startpoit to locate the right target frame.
109 @param sTargetName
110 the name or the target frame for loading or a special qualifier
111 which define such target.
113 @param nSearchFlags
114 used in case sTargetFrame isnt a special one.
116 LoadDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
117 const css::uno::Reference< css::frame::XFrame >& xOwnerFrame ,
118 const ::rtl::OUString sTargetName ,
119 sal_Int32 nSearchFlags);
121 //_______________________________________
123 /** @short used to free internal resources.
125 virtual ~LoadDispatcher();
127 //___________________________________________
128 // uno interface
130 public:
132 // XNotifyingDispatch
133 virtual void SAL_CALL dispatchWithNotification(const css::util::URL& aURL ,
134 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
135 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
136 throw(css::uno::RuntimeException);
138 // XDispatch
139 virtual void SAL_CALL dispatch(const css::util::URL& aURL ,
140 const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
141 throw(css::uno::RuntimeException);
143 virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
144 const css::util::URL& aURL )
145 throw(css::uno::RuntimeException);
147 virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener >& xListener,
148 const css::util::URL& aURL )
149 throw(css::uno::RuntimeException);
151 // XSynchronousDispatch
152 virtual css::uno::Any SAL_CALL dispatchWithReturnValue( const css::util::URL& aURL ,
153 const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
154 throw( css::uno::RuntimeException );
156 private:
157 css::uno::Any impl_dispatch( const css::util::URL& rURL,
158 const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
159 const css::uno::Reference< css::frame::XDispatchResultListener >& xListener );
160 }; // class LoadDispatcher
162 } // namespace framework
164 #endif // #ifndef __FRAMEWORK_DISPATCH_LOADDISPATCHER_HXX_