fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / controller / main / UndoActions.hxx
blobdc8945da62287e155096afed28a63871fc82e096
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 "ConfigItemListener.hxx"
24 #include <com/sun/star/frame/XModel.hpp>
25 #include <com/sun/star/document/XUndoAction.hpp>
26 #include <com/sun/star/uno/Sequence.hxx>
28 #include <rtl/ustring.hxx>
29 #include <unotools/configitem.hxx>
30 #include <cppuhelper/compbase1.hxx>
31 #include <cppuhelper/basemutex.hxx>
33 #include <utility>
34 #include <deque>
36 #include <boost/noncopyable.hpp>
37 #include <boost/shared_ptr.hpp>
39 class SdrUndoAction;
41 namespace chart
43 class ChartModelClone;
45 namespace impl
48 typedef ::cppu::BaseMutex UndoElement_MBase;
49 typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > UndoElement_TBase;
51 class UndoElement :public UndoElement_MBase
52 ,public UndoElement_TBase
53 ,public ::boost::noncopyable
55 public:
56 /** creates a new undo action
58 @param i_actionString
59 is the title of the Undo action
60 @param i_documentModel
61 is the actual document model which the undo actions operates on
62 @param i_modelClone
63 is the cloned model from before the changes, which the Undo action represents, have been applied.
64 Upon <member>invoking</member>, the clone model is applied to the document model.
66 UndoElement( const OUString & i_actionString,
67 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_documentModel,
68 const ::boost::shared_ptr< ChartModelClone >& i_modelClone
71 // XUndoAction
72 virtual OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 // OComponentHelper
77 virtual void SAL_CALL disposing() SAL_OVERRIDE;
79 protected:
80 virtual ~UndoElement();
82 private:
83 void impl_toggleModelState();
85 private:
86 OUString m_sActionString;
87 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocumentModel;
88 ::boost::shared_ptr< ChartModelClone > m_pModelClone;
91 typedef ::cppu::BaseMutex ShapeUndoElement_MBase;
92 typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > ShapeUndoElement_TBase;
93 class ShapeUndoElement :public ShapeUndoElement_MBase
94 ,public ShapeUndoElement_TBase
96 public:
97 ShapeUndoElement( SdrUndoAction& i_sdrUndoAction );
99 // XUndoAction
100 virtual OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 // OComponentHelper
105 virtual void SAL_CALL disposing() SAL_OVERRIDE;
107 protected:
108 virtual ~ShapeUndoElement();
110 private:
111 SdrUndoAction* m_pAction;
114 } // namespace impl
115 } // namespace chart
117 // INCLUDED_CHART2_SOURCE_CONTROLLER_MAIN_UNDOACTIONS_HXX
118 #endif
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */