LibreOffice Module chart2 (master) 1
UndoActions.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 <com/sun/star/document/XUndoAction.hpp>
22
23#include <rtl/ref.hxx>
24#include <rtl/ustring.hxx>
26
27#include <memory>
28
29namespace com::sun::star::frame { class XModel; }
30
31class SdrUndoAction;
32
33namespace chart
34{
35class ChartModel;
36class ChartModelClone;
37
38namespace impl
39{
40
42
43class UndoElement final : public UndoElement_TBase
44{
45public:
56 UndoElement( OUString i_actionString,
58 std::shared_ptr< ChartModelClone > i_modelClone
59 );
60 virtual ~UndoElement() override;
61
62 UndoElement(const UndoElement&) = delete;
63 const UndoElement& operator=(const UndoElement&) = delete;
64
65 // XUndoAction
66 virtual OUString SAL_CALL getTitle() override;
67 virtual void SAL_CALL undo( ) override;
68 virtual void SAL_CALL redo( ) override;
69
70 // WeakComponentImplHelper
71 virtual void disposing(std::unique_lock<std::mutex>&) override;
72
73private:
75
76private:
79 std::shared_ptr< ChartModelClone > m_pModelClone;
80};
81
84{
85public:
86 explicit ShapeUndoElement( std::unique_ptr<SdrUndoAction> xSdrUndoAction );
87 virtual ~ShapeUndoElement() override;
88
89 // XUndoAction
90 virtual OUString SAL_CALL getTitle() override;
91 virtual void SAL_CALL undo( ) override;
92 virtual void SAL_CALL redo( ) override;
93
94private:
95 std::unique_ptr<SdrUndoAction> m_xAction;
96};
97
98} // namespace impl
99} // namespace chart
100
101/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL redo() override
std::unique_ptr< SdrUndoAction > m_xAction
Definition: UndoActions.hxx:95
virtual ~ShapeUndoElement() override
Definition: UndoActions.cxx:88
ShapeUndoElement(std::unique_ptr< SdrUndoAction > xSdrUndoAction)
Definition: UndoActions.cxx:83
virtual void SAL_CALL undo() override
Definition: UndoActions.cxx:99
virtual OUString SAL_CALL getTitle() override
Definition: UndoActions.cxx:92
const UndoElement & operator=(const UndoElement &)=delete
virtual ~UndoElement() override
Definition: UndoActions.cxx:44
virtual void SAL_CALL undo() override
Definition: UndoActions.cxx:71
UndoElement(OUString i_actionString, rtl::Reference<::chart::ChartModel > i_documentModel, std::shared_ptr< ChartModelClone > i_modelClone)
creates a new undo action
Definition: UndoActions.cxx:37
rtl::Reference<::chart::ChartModel > m_xDocumentModel
Definition: UndoActions.hxx:78
std::shared_ptr< ChartModelClone > m_pModelClone
Definition: UndoActions.hxx:79
virtual void disposing(std::unique_lock< std::mutex > &) override
Definition: UndoActions.cxx:48
virtual OUString SAL_CALL getTitle() override
Definition: UndoActions.cxx:56
virtual void SAL_CALL redo() override
Definition: UndoActions.cxx:76
UndoElement(const UndoElement &)=delete
comphelper::WeakComponentImplHelper< css::document::XUndoAction > ShapeUndoElement_TBase
Definition: UndoActions.hxx:82
comphelper::WeakComponentImplHelper< css::document::XUndoAction > UndoElement_TBase
Definition: UndoActions.hxx:41