1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_STARTMODULEDISPATCHER_HXX
21 #define INCLUDED_FRAMEWORK_INC_DISPATCH_STARTMODULEDISPATCHER_HXX
23 #include <macros/xinterface.hxx>
24 #include <macros/xtypeprovider.hxx>
25 #include <macros/generic.hxx>
29 #include <com/sun/star/lang/XTypeProvider.hpp>
30 #include <com/sun/star/frame/XFrame.hpp>
31 #include <com/sun/star/frame/XStatusListener.hpp>
32 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
33 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
34 #include <com/sun/star/util/URL.hpp>
35 #include <com/sun/star/frame/XDispatchResultListener.hpp>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <com/sun/star/frame/DispatchResultState.hpp>
40 #include <cppuhelper/implbase2.hxx>
41 #include <vcl/evntpost.hxx>
46 @short helper to handle all URLs related to the StartModule
48 class StartModuleDispatcher
: public ::cppu::WeakImplHelper2
<
49 css::frame::XNotifyingDispatch
, // => XDispatch
50 css::frame::XDispatchInformationProvider
>
57 /** @short reference to an uno service manager,
58 which can be used to create own needed
60 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
62 /** @short our "context" frame. */
63 css::uno::WeakReference
< css::frame::XFrame
> m_xOwner
;
65 /** @short list of registered status listener */
67 ListenerHash m_lStatusListener
;
73 /** @short connect a new StartModuleDispatcher instance to its "owner frame".
75 @descr Such "owner frame" is used as context for all related operations.
78 an UNO service manager, which is needed to create UNO resource
82 the frame where the corresponding dispatch was started.
84 StartModuleDispatcher(const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
,
85 const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
87 /** @short does nothing real. */
88 virtual ~StartModuleDispatcher();
95 virtual void SAL_CALL
dispatchWithNotification( const css::util::URL
& aURL
,
96 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
,
97 const css::uno::Reference
< css::frame::XDispatchResultListener
>& xListener
) throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual void SAL_CALL
dispatch ( const css::util::URL
& aURL
,
101 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
) throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
102 virtual void SAL_CALL
addStatusListener ( const css::uno::Reference
< css::frame::XStatusListener
>& xListener
,
103 const css::util::URL
& aURL
) throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 virtual void SAL_CALL
removeStatusListener( const css::uno::Reference
< css::frame::XStatusListener
>& xListener
,
105 const css::util::URL
& aURL
) throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 // XDispatchInformationProvider
108 virtual css::uno::Sequence
< sal_Int16
> SAL_CALL
getSupportedCommandGroups ( ) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
109 virtual css::uno::Sequence
< css::frame::DispatchInformation
> SAL_CALL
getConfigurableDispatchInformation( sal_Int16 nCommandGroup
) throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 /** @short check if StartModule can be shown.
117 bool implts_isBackingModePossible();
119 /** @short open the special BackingComponent (now StartModule)
122 sal_True if operation was successfully.
124 bool implts_establishBackingMode();
126 /** @short notify a DispatchResultListener.
128 @descr We check the listener reference before we use it.
129 So this method can be called every time!
132 the listener, which should be notified.
136 directly used as css::frame::DispatchResultState value.
139 not used yet really ...
141 void implts_notifyResultListener(const css::uno::Reference
< css::frame::XDispatchResultListener
>& xListener
,
143 const css::uno::Any
& aResult
);
145 }; // class StartModuleDispatcher
147 } // namespace framework
149 #endif // INCLUDED_FRAMEWORK_INC_DISPATCH_STARTMODULEDISPATCHER_HXX
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */