Bump for 3.6-28
[LibreOffice.git] / chart2 / source / controller / main / UndoActions.hxx
blob9862f37bfbb4cd30a7374d1b8045e8bd618aa5ca
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef CHART2_IMPLUNDOMANAGER_HXX
29 #define CHART2_IMPLUNDOMANAGER_HXX
31 #include "ConfigItemListener.hxx"
33 #include <com/sun/star/frame/XModel.hpp>
34 #include <com/sun/star/document/XUndoAction.hpp>
35 #include <com/sun/star/uno/Sequence.hxx>
37 #include <rtl/ustring.hxx>
38 #include <unotools/configitem.hxx>
39 #include <cppuhelper/compbase1.hxx>
40 #include <cppuhelper/basemutex.hxx>
42 #include <utility>
43 #include <deque>
45 #include <boost/noncopyable.hpp>
46 #include <boost/shared_ptr.hpp>
48 class SdrUndoAction;
50 namespace com { namespace sun { namespace star {
51 namespace chart2 {
52 class XInternalDataProvider;
54 }}}
57 namespace chart
59 class ChartModelClone;
61 namespace impl
64 typedef ::cppu::BaseMutex UndoElement_MBase;
65 typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > UndoElement_TBase;
67 class UndoElement :public UndoElement_MBase
68 ,public UndoElement_TBase
69 ,public ::boost::noncopyable
71 public:
72 /** creates a new undo action
74 @param i_actionString
75 is the title of the Undo action
76 @param i_documentModel
77 is the actual document model which the undo actions operates on
78 @param i_modelClone
79 is the cloned model from before the changes, which the Undo action represents, have been applied.
80 Upon <member>invoking</member>, the clone model is applied to the document model.
82 UndoElement( const ::rtl::OUString & i_actionString,
83 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& i_documentModel,
84 const ::boost::shared_ptr< ChartModelClone >& i_modelClone
87 // XUndoAction
88 virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
89 virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
90 virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
92 // OComponentHelper
93 virtual void SAL_CALL disposing();
95 protected:
96 virtual ~UndoElement();
98 private:
99 void impl_toggleModelState();
101 private:
102 ::rtl::OUString m_sActionString;
103 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocumentModel;
104 ::boost::shared_ptr< ChartModelClone > m_pModelClone;
108 typedef ::cppu::BaseMutex ShapeUndoElement_MBase;
109 typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::document::XUndoAction > ShapeUndoElement_TBase;
110 class ShapeUndoElement :public ShapeUndoElement_MBase
111 ,public ShapeUndoElement_TBase
113 public:
114 ShapeUndoElement( SdrUndoAction& i_sdrUndoAction );
116 // XUndoAction
117 virtual ::rtl::OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException);
118 virtual void SAL_CALL undo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
119 virtual void SAL_CALL redo( ) throw (::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException);
121 // OComponentHelper
122 virtual void SAL_CALL disposing();
124 protected:
125 virtual ~ShapeUndoElement();
127 private:
128 SdrUndoAction* m_pAction;
131 } // namespace impl
132 } // namespace chart
134 // CHART2_IMPLUNDOMANAGER_HXX
135 #endif
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */