Update ooo320-m1
[ooovba.git] / chart2 / source / controller / main / UndoCommandDispatch.hxx
blob52535f7132c1249ef90b9ff331514487f6f4dd8e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: UndoCommandDispatch.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART2_UNDOCOMMANDDISPATCH_HXX
31 #define CHART2_UNDOCOMMANDDISPATCH_HXX
33 #include "CommandDispatch.hxx"
35 #include <com/sun/star/frame/XModel.hpp>
36 #include <com/sun/star/chart2/XUndoManager.hpp>
38 namespace chart
41 /** This is a CommandDispatch implementation for Undo and Redo.
43 You need to pass an UndoManager to this class that is then used for Undo and
44 Redo. The changes are applied to the given XModel.
46 class UndoCommandDispatch : public CommandDispatch
48 public:
49 explicit UndoCommandDispatch(
50 const ::com::sun::star::uno::Reference<
51 ::com::sun::star::uno::XComponentContext > & xContext,
52 const ::com::sun::star::uno::Reference<
53 ::com::sun::star::frame::XModel > & xModel );
54 virtual ~UndoCommandDispatch();
56 // late initialisation, especially for adding as listener
57 virtual void initialize();
59 protected:
60 // ____ XDispatch ____
61 virtual void SAL_CALL dispatch(
62 const ::com::sun::star::util::URL& URL,
63 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments )
64 throw (::com::sun::star::uno::RuntimeException);
66 // ____ WeakComponentImplHelperBase ____
67 /// is called when this is disposed
68 virtual void SAL_CALL disposing();
70 // ____ XEventListener (base of XModifyListener) ____
71 virtual void SAL_CALL disposing(
72 const ::com::sun::star::lang::EventObject& Source )
73 throw (::com::sun::star::uno::RuntimeException);
75 virtual void fireStatusEvent(
76 const ::rtl::OUString & rURL,
77 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xSingleListener );
79 private:
80 ::com::sun::star::uno::Reference<
81 ::com::sun::star::frame::XModel > m_xModel;
82 ::com::sun::star::uno::Reference<
83 ::com::sun::star::chart2::XUndoManager > m_xUndoManager;
86 } // namespace chart
88 // CHART2_UNDOCOMMANDDISPATCH_HXX
89 #endif