LibreOffice Module reportdesign (master) 1
RptUndo.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
20#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
21
22#include <RptModel.hxx>
23#include <UndoActions.hxx>
24#include <functional>
25
26namespace com::sun::star {
27 namespace drawing {
28 class XShape;
29 }
30}
31
32namespace rptui
33{
38 {
39 OSectionUndo(const OSectionUndo&) = delete;
40 void operator =(const OSectionUndo&) = delete;
41 protected:
42 ::std::vector< css::uno::Reference< css::drawing::XShape> >
44 ::std::vector< ::std::pair< OUString ,css::uno::Any> >
47 sal_uInt16 m_nSlot;
49
50 virtual void implReInsert( ) = 0;
51 virtual void implReRemove( ) = 0;
52
53 void collectControls(const css::uno::Reference< css::report::XSection >& _xSection);
54 public:
56 ,sal_uInt16 _nSlot
57 ,Action _eAction
58 ,TranslateId pCommentID);
59 virtual ~OSectionUndo() override;
60
61 virtual void Undo() override;
62 virtual void Redo() override;
63 };
64
68 {
70 ::std::function<css::uno::Reference< css::report::XSection >(OReportHelper *)> m_pMemberFunction;
71
72 void implReInsert( ) override;
73 void implReRemove( ) override;
75 void operator =(const OReportSectionUndo&) = delete;
76 public:
77 //OReportSectionUndo( const css::uno::Reference< css::report::XSection >& _xSection
79 ,sal_uInt16 _nSlot
80 ,::std::function<css::uno::Reference< css::report::XSection >(OReportHelper *)> _pMemberFunction
81 ,const css::uno::Reference< css::report::XReportDefinition >& _xReport
82 ,Action _eAction);
83 virtual ~OReportSectionUndo() override;
84 };
85
89 {
91 ::std::function<css::uno::Reference< css::report::XSection >(OGroupHelper *)> m_pMemberFunction;
92
93 mutable OUString m_sName;
94
95 void implReInsert( ) override;
96 void implReRemove( ) override;
98 void operator =(const OGroupSectionUndo&) = delete;
99 public:
100 //OGroupSectionUndo( const css::uno::Reference< css::report::XSection >& _xSection
102 ,sal_uInt16 _nSlot
103 ,::std::function<css::uno::Reference< css::report::XSection >(OGroupHelper *)> _pMemberFunction
104 ,const css::uno::Reference< css::report::XGroup >& _xGroup
105 ,Action _eAction
106 ,TranslateId pCommentID);
107
108 virtual OUString GetComment() const override;
109 };
110
115 {
116 css::uno::Reference< css::report::XGroup> m_xGroup;
117 css::uno::Reference< css::report::XReportDefinition > m_xReportDefinition;
119 sal_Int32 m_nLastPosition;
120
121 void implReInsert( );
122 void implReRemove( );
123 public:
125 ,TranslateId pCommentID
126 ,Action _eAction
127 ,css::uno::Reference< css::report::XGroup> _xGroup
128 ,css::uno::Reference< css::report::XReportDefinition > _xReportDefinition);
129 virtual void Undo() override;
130 virtual void Redo() override;
131 };
132}
133#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrModel & rMod
Helper class to allow std::mem_fun for SAL_CALL.
Definition: UndoActions.hxx:49
Undo action for the group header, footer.
Definition: RptUndo.hxx:89
void implReInsert() override
Definition: RptUndo.cxx:277
OGroupHelper m_aGroupHelper
Definition: RptUndo.hxx:90
::std::function< css::uno::Reference< css::report::XSection >(OGroupHelper *)> m_pMemberFunction
Definition: RptUndo.hxx:91
OGroupSectionUndo(OReportModel &rMod, sal_uInt16 _nSlot,::std::function< css::uno::Reference< css::report::XSection >(OGroupHelper *)> _pMemberFunction, const css::uno::Reference< css::report::XGroup > &_xGroup, Action _eAction, TranslateId pCommentID)
void implReRemove() override
Definition: RptUndo.cxx:292
void operator=(const OGroupSectionUndo &)=delete
virtual OUString GetComment() const override
Definition: RptUndo.cxx:259
OGroupSectionUndo(const OGroupSectionUndo &)=delete
/class OGroupUndo
Definition: RptUndo.hxx:115
virtual void Redo() override
Definition: RptUndo.cxx:360
virtual void Undo() override
Definition: RptUndo.cxx:345
void implReRemove()
Definition: RptUndo.cxx:333
Action m_eAction
! the current action
Definition: RptUndo.hxx:118
css::uno::Reference< css::report::XGroup > m_xGroup
! the group for the undo redo action
Definition: RptUndo.hxx:116
OGroupUndo(OReportModel &rMod, TranslateId pCommentID, Action _eAction, css::uno::Reference< css::report::XGroup > _xGroup, css::uno::Reference< css::report::XReportDefinition > _xReportDefinition)
Definition: RptUndo.cxx:308
css::uno::Reference< css::report::XReportDefinition > m_xReportDefinition
! the parent report definition
Definition: RptUndo.hxx:117
sal_Int32 m_nLastPosition
! the last position of the group
Definition: RptUndo.hxx:119
void implReInsert()
Definition: RptUndo.cxx:321
Helper class to allow std::mem_fun for SAL_CALL.
Definition: UndoActions.hxx:72
Undo action for the group header, footer, page header, footer.
Definition: RptUndo.hxx:68
::std::function< css::uno::Reference< css::report::XSection >(OReportHelper *)> m_pMemberFunction
Definition: RptUndo.hxx:70
OReportHelper m_aReportHelper
Definition: RptUndo.hxx:69
void implReRemove() override
Definition: RptUndo.cxx:233
void implReInsert() override
Definition: RptUndo.cxx:223
OReportSectionUndo(OReportModel &rMod, sal_uInt16 _nSlot,::std::function< css::uno::Reference< css::report::XSection >(OReportHelper *)> _pMemberFunction, const css::uno::Reference< css::report::XReportDefinition > &_xReport, Action _eAction)
OReportSectionUndo(const OReportSectionUndo &)=delete
virtual ~OReportSectionUndo() override
Definition: RptUndo.cxx:219
void operator=(const OReportSectionUndo &)=delete
Undo class for section add and remove.
Definition: RptUndo.hxx:38
virtual void implReInsert()=0
virtual void Redo() override
Definition: RptUndo.cxx:186
::std::vector< css::uno::Reference< css::drawing::XShape > > m_aControls
Definition: RptUndo.hxx:43
void operator=(const OSectionUndo &)=delete
virtual void implReRemove()=0
OSectionUndo(const OSectionUndo &)=delete
void collectControls(const css::uno::Reference< css::report::XSection > &_xSection)
Definition: RptUndo.cxx:145
virtual ~OSectionUndo() override
Definition: RptUndo.cxx:125
::std::vector< ::std::pair< OUString,css::uno::Any > > m_aValues
Definition: RptUndo.hxx:45
virtual void Undo() override
Definition: RptUndo.cxx:165
sal_uInt16 m_nSlot
Definition: RptUndo.hxx:47