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 .
19 #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_UNDOACTIONS_HXX
20 #define INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_UNDOACTIONS_HXX
22 #include <com/sun/star/frame/XModel.hpp>
23 #include <com/sun/star/document/XUndoAction.hpp>
25 #include <rtl/ustring.hxx>
26 #include <unotools/configitem.hxx>
27 #include <cppuhelper/compbase.hxx>
28 #include <cppuhelper/basemutex.hxx>
38 class ChartModelClone
;
43 typedef ::cppu::BaseMutex UndoElement_MBase
;
44 typedef ::cppu::WeakComponentImplHelper
< css::document::XUndoAction
> UndoElement_TBase
;
46 class UndoElement
:public UndoElement_MBase
47 ,public UndoElement_TBase
50 /** creates a new undo action
53 is the title of the Undo action
54 @param i_documentModel
55 is the actual document model which the undo actions operates on
57 is the cloned model from before the changes, which the Undo action represents, have been applied.
58 Upon <member>invoking</member>, the clone model is applied to the document model.
60 UndoElement( const OUString
& i_actionString
,
61 const css::uno::Reference
< css::frame::XModel
>& i_documentModel
,
62 const std::shared_ptr
< ChartModelClone
>& i_modelClone
65 UndoElement(const UndoElement
&) = delete;
66 const UndoElement
& operator=(const UndoElement
&) = delete;
69 virtual OUString SAL_CALL
getTitle() override
;
70 virtual void SAL_CALL
undo( ) override
;
71 virtual void SAL_CALL
redo( ) override
;
74 virtual void SAL_CALL
disposing() override
;
77 virtual ~UndoElement() override
;
80 void impl_toggleModelState();
83 OUString m_sActionString
;
84 css::uno::Reference
< css::frame::XModel
> m_xDocumentModel
;
85 std::shared_ptr
< ChartModelClone
> m_pModelClone
;
88 typedef ::cppu::BaseMutex ShapeUndoElement_MBase
;
89 typedef ::cppu::WeakComponentImplHelper
< css::document::XUndoAction
> ShapeUndoElement_TBase
;
90 class ShapeUndoElement
:public ShapeUndoElement_MBase
91 ,public ShapeUndoElement_TBase
94 explicit ShapeUndoElement( SdrUndoAction
& i_sdrUndoAction
);
97 virtual OUString SAL_CALL
getTitle() override
;
98 virtual void SAL_CALL
undo( ) override
;
99 virtual void SAL_CALL
redo( ) override
;
102 virtual void SAL_CALL
disposing() override
;
105 virtual ~ShapeUndoElement() override
;
108 SdrUndoAction
* m_pAction
;
114 // INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_UNDOACTIONS_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */