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 .
22 #include <com/sun/star/frame/XStatusListener.hpp>
23 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
24 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
25 #include <com/sun/star/util/URL.hpp>
26 #include <com/sun/star/frame/XDispatchResultListener.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <cppuhelper/implbase.hxx>
34 @short helper to handle all URLs related to the StartModule
36 class StartModuleDispatcher final
: public ::cppu::WeakImplHelper
<
37 css::frame::XNotifyingDispatch
, // => XDispatch
38 css::frame::XDispatchInformationProvider
>
45 /** @short reference to a uno service manager,
46 which can be used to create own needed
48 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
54 /** @short connect a new StartModuleDispatcher instance to its "owner frame".
56 @descr Such "owner frame" is used as context for all related operations.
59 a UNO service manager, which is needed to create UNO resource
63 the frame where the corresponding dispatch was started.
65 StartModuleDispatcher(css::uno::Reference
< css::uno::XComponentContext
> xContext
);
67 /** @short does nothing real. */
68 virtual ~StartModuleDispatcher() override
;
75 virtual void SAL_CALL
dispatchWithNotification( const css::util::URL
& aURL
,
76 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
,
77 const css::uno::Reference
< css::frame::XDispatchResultListener
>& xListener
) override
;
80 virtual void SAL_CALL
dispatch ( const css::util::URL
& aURL
,
81 const css::uno::Sequence
< css::beans::PropertyValue
>& lArguments
) override
;
82 virtual void SAL_CALL
addStatusListener ( const css::uno::Reference
< css::frame::XStatusListener
>& xListener
,
83 const css::util::URL
& aURL
) override
;
84 virtual void SAL_CALL
removeStatusListener( const css::uno::Reference
< css::frame::XStatusListener
>& xListener
,
85 const css::util::URL
& aURL
) override
;
87 // XDispatchInformationProvider
88 virtual css::uno::Sequence
< sal_Int16
> SAL_CALL
getSupportedCommandGroups ( ) override
;
89 virtual css::uno::Sequence
< css::frame::DispatchInformation
> SAL_CALL
getConfigurableDispatchInformation( sal_Int16 nCommandGroup
) override
;
95 /** @short check if StartModule can be shown.
97 bool implts_isBackingModePossible();
99 /** @short open the special BackingComponent (now StartModule)
101 void implts_establishBackingMode();
103 /** @short notify a DispatchResultListener.
105 @descr We check the listener reference before we use it.
106 So this method can be called every time!
109 the listener, which should be notified.
113 directly used as css::frame::DispatchResultState value.
116 not used yet really ...
118 void implts_notifyResultListener(const css::uno::Reference
< css::frame::XDispatchResultListener
>& xListener
,
120 const css::uno::Any
& aResult
);
122 }; // class StartModuleDispatcher
124 } // namespace framework
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */