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>
45 #include <boost/noncopyable.hpp>
46 #include <boost/shared_ptr.hpp>
50 namespace com
{ namespace sun
{ namespace star
{
52 class XInternalDataProvider
;
59 class ChartModelClone
;
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
72 /** creates a new undo action
75 is the title of the Undo action
76 @param i_documentModel
77 is the actual document model which the undo actions operates on
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
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
);
93 virtual void SAL_CALL
disposing();
96 virtual ~UndoElement();
99 void impl_toggleModelState();
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
114 ShapeUndoElement( SdrUndoAction
& i_sdrUndoAction
);
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
);
122 virtual void SAL_CALL
disposing();
125 virtual ~ShapeUndoElement();
128 SdrUndoAction
* m_pAction
;
134 // CHART2_IMPLUNDOMANAGER_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */