LibreOffice Module chart2 (master) 1
UndoCommandDispatch.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
21#include "CommandDispatch.hxx"
22#include <rtl/ref.hxx>
23
24namespace com::sun::star::document { class XUndoManager; }
25namespace com::sun::star::frame { class XModel; }
26
27namespace chart
28{
29class ChartModel;
30
34{
35public:
36 explicit UndoCommandDispatch(
37 const css::uno::Reference< css::uno::XComponentContext > & xContext,
39 virtual ~UndoCommandDispatch() override;
40
41 // late initialisation, especially for adding as listener
42 virtual void initialize() override;
43
44protected:
45 // ____ XDispatch ____
46 virtual void SAL_CALL dispatch(
47 const css::util::URL& URL,
48 const css::uno::Sequence< css::beans::PropertyValue >& Arguments ) override;
49
50 // ____ WeakComponentImplHelperBase ____
52 virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
53
54 // ____ XEventListener (base of XModifyListener) ____
55 virtual void SAL_CALL disposing(
56 const css::lang::EventObject& Source ) override;
57
58 virtual void fireStatusEvent(
59 const OUString & rURL,
60 const css::uno::Reference< css::frame::XStatusListener > & xSingleListener ) override;
61
62private:
64 css::uno::Reference< css::document::XUndoManager > m_xUndoManager;
65};
66
67} // namespace chart
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This is the base class for an XDispatch.
This is a CommandDispatch implementation for Undo and Redo.
rtl::Reference<::chart::ChartModel > m_xModel
virtual ~UndoCommandDispatch() override
css::uno::Reference< css::document::XUndoManager > m_xUndoManager
virtual void disposing(std::unique_lock< std::mutex > &rGuard) override
is called when this is disposed
UndoCommandDispatch(const css::uno::Reference< css::uno::XComponentContext > &xContext, rtl::Reference<::chart::ChartModel > xModel)
virtual void SAL_CALL dispatch(const css::util::URL &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
virtual void initialize() override
virtual void fireStatusEvent(const OUString &rURL, const css::uno::Reference< css::frame::XStatusListener > &xSingleListener) override
sends a status event for a specific command to all registered listeners or only the one given when se...
Reference< XModel > xModel