merge the formfield patch from ooo-build
[ooovba.git] / reportdesign / source / ui / inc / Undo.hxx
blobc01cd5e750f069074d1e3777eb0ad459071da00f
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: Undo.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 RPTUI_UNDO_HXX
31 #define RPTUI_UNDO_HXX
33 #include "UndoActions.hxx"
34 #include <functional>
36 FORWARD_DECLARE_INTERFACE(awt,XControl)
37 FORWARD_DECLARE_INTERFACE(awt,XControlContainer)
38 FORWARD_DECLARE_INTERFACE(drawing,XShape)
39 namespace dbaui
41 class IController;
43 namespace rptui
45 class OObjectBase;
48 /** \class OSectionUndo
49 * Undo class for section add and remove.
51 class OSectionUndo : public OCommentUndoAction
53 OSectionUndo(const OSectionUndo&);
54 void operator =(const OSectionUndo&);
55 protected:
56 ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> >
57 m_aControls;
58 ::std::vector< ::std::pair< ::rtl::OUString ,::com::sun::star::uno::Any> >
59 m_aValues;
60 Action m_eAction;
61 sal_uInt16 m_nSlot;
62 bool m_bInserted;
64 virtual void implReInsert( ) = 0;
65 virtual void implReRemove( ) = 0;
67 void collectControls(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
68 public:
69 TYPEINFO();
70 OSectionUndo( OReportModel& rMod
71 ,sal_uInt16 _nSlot
72 ,Action _eAction
73 ,USHORT nCommentID);
74 virtual ~OSectionUndo();
76 virtual void Undo();
77 virtual void Redo();
80 /** Undo action for the group header, footer, page header, footer
82 class OReportSectionUndo : public OSectionUndo
84 OReportHelper m_aReportHelper;
85 ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
86 ,OReportHelper> m_pMemberFunction;
88 void implReInsert( );
89 void implReRemove( );
90 OReportSectionUndo(const OReportSectionUndo&);
91 void operator =(const OReportSectionUndo&);
92 public:
93 TYPEINFO();
94 //OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
95 OReportSectionUndo( OReportModel& rMod
96 ,sal_uInt16 _nSlot
97 ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
98 ,OReportHelper> _pMemberFunction
99 ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
100 ,Action _eAction
101 ,USHORT nCommentID);
102 virtual ~OReportSectionUndo();
105 /** Undo action for the group header, footer
107 class OGroupSectionUndo : public OSectionUndo
109 OGroupHelper m_aGroupHelper;
110 ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
111 ,OGroupHelper> m_pMemberFunction;
113 mutable ::rtl::OUString m_sName;
115 void implReInsert( );
116 void implReRemove( );
117 OGroupSectionUndo(const OGroupSectionUndo&);
118 void operator =(const OGroupSectionUndo&);
119 public:
120 TYPEINFO();
121 //OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
122 OGroupSectionUndo( OReportModel& rMod
123 ,sal_uInt16 _nSlot
124 ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
125 ,OGroupHelper> _pMemberFunction
126 ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
127 ,Action _eAction
128 ,USHORT nCommentID);
130 virtual String GetComment() const;
133 /** /class OGroupUndo
134 * \brief Undo action for removing a group object.
136 class OGroupUndo : public OCommentUndoAction
138 ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> m_xGroup; ///<! the group for the undo redo action
139 ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; ///<! the parent report definition
140 Action m_eAction; ///<! the current action
141 sal_Int32 m_nLastPosition; ///<! the last position of the group
143 void implReInsert( );
144 void implReRemove( );
145 public:
146 TYPEINFO();
147 OGroupUndo(OReportModel& rMod
148 ,USHORT nCommentID
149 ,Action _eAction
150 ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup
151 ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
152 virtual void Undo();
153 virtual void Redo();
156 #endif // RPTUI_UNDO_HXX