1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: Undo.hxx,v $
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"
36 FORWARD_DECLARE_INTERFACE(awt
,XControl
)
37 FORWARD_DECLARE_INTERFACE(awt
,XControlContainer
)
38 FORWARD_DECLARE_INTERFACE(drawing
,XShape
)
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
&);
56 ::std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> >
58 ::std::vector
< ::std::pair
< ::rtl::OUString
,::com::sun::star::uno::Any
> >
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
);
70 OSectionUndo( OReportModel
& rMod
74 virtual ~OSectionUndo();
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
;
90 OReportSectionUndo(const OReportSectionUndo
&);
91 void operator =(const OReportSectionUndo
&);
94 //OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
95 OReportSectionUndo( OReportModel
& rMod
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
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
&);
121 //OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
122 OGroupSectionUndo( OReportModel
& rMod
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
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( );
147 OGroupUndo(OReportModel
& rMod
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
);
156 #endif // RPTUI_UNDO_HXX