1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: loaddispatcher.hxx,v $
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 //_______________________________________________
37 #include <loadenv/loadenv.hxx>
39 //_______________________________________________
41 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
42 #include <com/sun/star/frame/XSynchronousDispatch.hpp>
44 //_______________________________________________
47 #include <cppuhelper/implbase2.hxx>
49 //_______________________________________________
54 namespace css
= ::com::sun::star
;
56 //_______________________________________________
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).
68 class LoadDispatcher
: private ThreadHelpBase
69 , public ::cppu::WeakImplHelper2
< css::frame::XNotifyingDispatch
, // => XDispatch => XInterface
70 css::frame::XSynchronousDispatch
>
72 //___________________________________________
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 */
92 //___________________________________________
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.
104 will be used to create own needed services on demand.
107 used as startpoit to locate the right target frame.
110 the name or the target frame for loading or a special qualifier
111 which define such target.
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 //___________________________________________
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
);
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
);
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_