Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef RPTUI_UNDO_HXX
29 : : #define RPTUI_UNDO_HXX
30 : :
31 : : #include "UndoActions.hxx"
32 : : #include <functional>
33 : :
34 : : namespace com { namespace sun { namespace star {
35 : : namespace drawing {
36 : : class XShape;
37 : : }
38 : : }}}
39 : :
40 : : namespace rptui
41 : : {
42 : : /** \class OSectionUndo
43 : : * Undo class for section add and remove.
44 : : */
45 : : class OSectionUndo : public OCommentUndoAction
46 : : {
47 : : OSectionUndo(const OSectionUndo&);
48 : : void operator =(const OSectionUndo&);
49 : : protected:
50 : : ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> >
51 : : m_aControls;
52 : : ::std::vector< ::std::pair< ::rtl::OUString ,::com::sun::star::uno::Any> >
53 : : m_aValues;
54 : : Action m_eAction;
55 : : sal_uInt16 m_nSlot;
56 : : bool m_bInserted;
57 : :
58 : : virtual void implReInsert( ) = 0;
59 : : virtual void implReRemove( ) = 0;
60 : :
61 : : void collectControls(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
62 : : public:
63 : : TYPEINFO();
64 : : OSectionUndo( OReportModel& rMod
65 : : ,sal_uInt16 _nSlot
66 : : ,Action _eAction
67 : : ,sal_uInt16 nCommentID);
68 : : virtual ~OSectionUndo();
69 : :
70 : : virtual void Undo();
71 : : virtual void Redo();
72 : : };
73 : :
74 : : /** Undo action for the group header, footer, page header, footer
75 : : */
76 : : class OReportSectionUndo : public OSectionUndo
77 : : {
78 : : OReportHelper m_aReportHelper;
79 : : ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
80 : : ,OReportHelper> m_pMemberFunction;
81 : :
82 : : void implReInsert( );
83 : : void implReRemove( );
84 : : OReportSectionUndo(const OReportSectionUndo&);
85 : : void operator =(const OReportSectionUndo&);
86 : : public:
87 : : TYPEINFO();
88 : : //OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
89 : : OReportSectionUndo( OReportModel& rMod
90 : : ,sal_uInt16 _nSlot
91 : : ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
92 : : ,OReportHelper> _pMemberFunction
93 : : ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
94 : : ,Action _eAction
95 : : ,sal_uInt16 nCommentID);
96 : : virtual ~OReportSectionUndo();
97 : : };
98 : :
99 : : /** Undo action for the group header, footer
100 : : */
101 : 0 : class OGroupSectionUndo : public OSectionUndo
102 : : {
103 : : OGroupHelper m_aGroupHelper;
104 : : ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
105 : : ,OGroupHelper> m_pMemberFunction;
106 : :
107 : : mutable ::rtl::OUString m_sName;
108 : :
109 : : void implReInsert( );
110 : : void implReRemove( );
111 : : OGroupSectionUndo(const OGroupSectionUndo&);
112 : : void operator =(const OGroupSectionUndo&);
113 : : public:
114 : : TYPEINFO();
115 : : //OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
116 : : OGroupSectionUndo( OReportModel& rMod
117 : : ,sal_uInt16 _nSlot
118 : : ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
119 : : ,OGroupHelper> _pMemberFunction
120 : : ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
121 : : ,Action _eAction
122 : : ,sal_uInt16 nCommentID);
123 : :
124 : : virtual rtl::OUString GetComment() const;
125 : : };
126 : :
127 : : /** /class OGroupUndo
128 : : * \brief Undo action for removing a group object.
129 : : */
130 : 0 : class OGroupUndo : public OCommentUndoAction
131 : : {
132 : : ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> m_xGroup; ///<! the group for the undo redo action
133 : : ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; ///<! the parent report definition
134 : : Action m_eAction; ///<! the current action
135 : : sal_Int32 m_nLastPosition; ///<! the last position of the group
136 : :
137 : : void implReInsert( );
138 : : void implReRemove( );
139 : : public:
140 : : TYPEINFO();
141 : : OGroupUndo(OReportModel& rMod
142 : : ,sal_uInt16 nCommentID
143 : : ,Action _eAction
144 : : ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup
145 : : ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
146 : : virtual void Undo();
147 : : virtual void Redo();
148 : : };
149 : : }
150 : : #endif // RPTUI_UNDO_HXX
151 : :
152 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|