LibreOffice Module chart2 (master) 1
CommandDispatch.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
23#include <com/sun/star/frame/XDispatch.hpp>
24#include <com/sun/star/util/XModifyListener.hpp>
25
26#include <map>
27#include <memory>
28
29namespace com::sun::star::uno { class XComponentContext; }
30namespace com::sun::star::util { class XURLTransformer; }
31
32namespace chart
33{
34
35namespace impl
36{
38 css::frame::XDispatch,
39 css::util::XModifyListener >
41}
42
46{
47public:
48 explicit CommandDispatch( const css::uno::Reference< css::uno::XComponentContext > & xContext );
49 virtual ~CommandDispatch() override;
50
51 // late initialisation, especially for adding as listener
52 virtual void initialize();
53
54protected:
71 virtual void fireStatusEvent(
72 const OUString & rURL,
73 const css::uno::Reference< css::frame::XStatusListener > & xSingleListener ) = 0;
74
78 const css::uno::Reference< css::frame::XStatusListener > & xSingleListener );
79
89 const OUString & rURL,
90 const css::uno::Any & rState,
91 bool bEnabled,
92 const css::uno::Reference< css::frame::XStatusListener > & xSingleListener );
93
94 // ____ XDispatch ____
95 virtual void SAL_CALL dispatch(
96 const css::util::URL& URL,
97 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
98 virtual void SAL_CALL addStatusListener(
99 const css::uno::Reference< css::frame::XStatusListener >& Control,
100 const css::util::URL& URL ) override;
101 virtual void SAL_CALL removeStatusListener(
102 const css::uno::Reference< css::frame::XStatusListener >& Control,
103 const css::util::URL& URL ) override;
104
105 // ____ WeakComponentImplHelperBase ____
107 virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
108
109 // ____ XModifyListener ____
110 virtual void SAL_CALL modified(
111 const css::lang::EventObject& aEvent ) override;
112
113 // ____ XEventListener (base of XModifyListener) ____
114 virtual void SAL_CALL disposing(
115 const css::lang::EventObject& Source ) override;
116
117private:
118 css::uno::Reference< css::uno::XComponentContext > m_xContext;
119 css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer;
120
121 typedef std::map< OUString, ::comphelper::OInterfaceContainerHelper4<css::frame::XStatusListener> >
123
125
126};
127
128} // namespace chart
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This is the base class for an XDispatch.
css::uno::Reference< css::uno::XComponentContext > m_xContext
CommandDispatch(const css::uno::Reference< css::uno::XComponentContext > &xContext)
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void fireStatusEvent(const OUString &rURL, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)=0
sends a status event for a specific command to all registered listeners or only the one given when se...
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
void fireAllStatusEvents(const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)
calls fireStatusEvent( OUString, xSingleListener )
virtual ~CommandDispatch() override
void fireStatusEventForURL(const OUString &rURL, const css::uno::Any &rState, bool bEnabled, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener)
sends a status event for a specific command to all registered listeners or only the one given when se...
std::map< OUString, ::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener > > tListenerMap
virtual void disposing(std::unique_lock< std::mutex > &rGuard) override
is called when this is disposed
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &Control, const css::util::URL &URL) override
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer
::comphelper::WeakComponentImplHelper< css::frame::XDispatch, css::util::XModifyListener > CommandDispatch_Base