1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
22 #include <RptModel.hxx>
23 #include <UndoActions.hxx>
26 namespace com::sun::star
{
34 /** \class OSectionUndo
35 * Undo class for section add and remove.
37 class OSectionUndo
: public OCommentUndoAction
39 OSectionUndo(const OSectionUndo
&) = delete;
40 void operator =(const OSectionUndo
&) = delete;
42 ::std::vector
< css::uno::Reference
< css::drawing::XShape
> >
44 ::std::vector
< ::std::pair
< OUString
,css::uno::Any
> >
50 virtual void implReInsert( ) = 0;
51 virtual void implReRemove( ) = 0;
53 void collectControls(const css::uno::Reference
< css::report::XSection
>& _xSection
);
55 OSectionUndo( OReportModel
& rMod
58 ,TranslateId pCommentID
);
59 virtual ~OSectionUndo() override
;
61 virtual void Undo() override
;
62 virtual void Redo() override
;
65 /** Undo action for the group header, footer, page header, footer
67 class OReportSectionUndo
: public OSectionUndo
69 OReportHelper m_aReportHelper
;
70 ::std::function
<css::uno::Reference
< css::report::XSection
>(OReportHelper
*)> m_pMemberFunction
;
72 void implReInsert( ) override
;
73 void implReRemove( ) override
;
74 OReportSectionUndo(const OReportSectionUndo
&) = delete;
75 void operator =(const OReportSectionUndo
&) = delete;
77 //OReportSectionUndo( const css::uno::Reference< css::report::XSection >& _xSection
78 OReportSectionUndo( OReportModel
& rMod
80 ,::std::function
<css::uno::Reference
< css::report::XSection
>(OReportHelper
*)> _pMemberFunction
81 ,const css::uno::Reference
< css::report::XReportDefinition
>& _xReport
83 virtual ~OReportSectionUndo() override
;
86 /** Undo action for the group header, footer
88 class OGroupSectionUndo
: public OSectionUndo
90 OGroupHelper m_aGroupHelper
;
91 ::std::function
<css::uno::Reference
< css::report::XSection
>(OGroupHelper
*)> m_pMemberFunction
;
93 mutable OUString m_sName
;
95 void implReInsert( ) override
;
96 void implReRemove( ) override
;
97 OGroupSectionUndo(const OGroupSectionUndo
&) = delete;
98 void operator =(const OGroupSectionUndo
&) = delete;
100 //OGroupSectionUndo( const css::uno::Reference< css::report::XSection >& _xSection
101 OGroupSectionUndo( OReportModel
& rMod
103 ,::std::function
<css::uno::Reference
< css::report::XSection
>(OGroupHelper
*)> _pMemberFunction
104 ,const css::uno::Reference
< css::report::XGroup
>& _xGroup
106 ,TranslateId pCommentID
);
108 virtual OUString
GetComment() const override
;
111 /** /class OGroupUndo
112 * \brief Undo action for removing a group object.
114 class OGroupUndo
: public OCommentUndoAction
116 css::uno::Reference
< css::report::XGroup
> m_xGroup
; ///<! the group for the undo redo action
117 css::uno::Reference
< css::report::XReportDefinition
> m_xReportDefinition
; ///<! the parent report definition
118 Action m_eAction
; ///<! the current action
119 sal_Int32 m_nLastPosition
; ///<! the last position of the group
121 void implReInsert( );
122 void implReRemove( );
124 OGroupUndo(OReportModel
& rMod
125 ,TranslateId pCommentID
127 ,const css::uno::Reference
< css::report::XGroup
>& _xGroup
128 ,const css::uno::Reference
< css::report::XReportDefinition
>& _xReportDefinition
);
129 virtual void Undo() override
;
130 virtual void Redo() override
;
133 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */