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 
26 namespace com::sun::star {
27  namespace drawing {
28  class XShape;
29  }
30 }
31 
32 namespace 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;
74  OReportSectionUndo(const OReportSectionUndo&) = delete;
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;
97  OGroupSectionUndo(const OGroupSectionUndo&) = delete;
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  ,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;
131  };
132 }
133 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_RPTUNDO_HXX
134 
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void implReInsert()
Definition: RptUndo.cxx:329
virtual void Redo() override
Definition: RptUndo.cxx:192
virtual void implReRemove()=0
void implReRemove() override
Definition: RptUndo.cxx:299
::std::function< css::uno::Reference< css::report::XSection >OReportHelper *)> m_pMemberFunction
Definition: RptUndo.hxx:70
virtual ~OReportSectionUndo() override
Definition: RptUndo.cxx:225
::std::vector< css::uno::Reference< css::drawing::XShape > > m_aControls
Definition: RptUndo.hxx:43
Undo action for the group header, footer, page header, footer.
Definition: RptUndo.hxx:67
virtual void implReInsert()=0
Undo action for the group header, footer.
Definition: RptUndo.hxx:88
Helper class to allow std::mem_fun for SAL_CALL.
Definition: UndoActions.hxx:70
SdrModel & rMod
::std::vector< ::std::pair< OUString,css::uno::Any > > m_aValues
Definition: RptUndo.hxx:45
virtual ~OSectionUndo() override
Definition: RptUndo.cxx:124
OSectionUndo(const OSectionUndo &)=delete
exports com.sun.star. drawing
virtual void Redo() override
Definition: RptUndo.cxx:368
virtual OUString GetComment() const override
Definition: RptUndo.cxx:265
void collectControls(const css::uno::Reference< css::report::XSection > &_xSection)
Definition: RptUndo.cxx:151
::std::function< css::uno::Reference< css::report::XSection >OGroupHelper *)> m_pMemberFunction
Definition: RptUndo.hxx:91
OGroupSectionUndo(const OGroupSectionUndo &)=delete
void operator=(const OReportSectionUndo &)=delete
OGroupHelper m_aGroupHelper
Definition: RptUndo.hxx:90
void operator=(const OGroupSectionUndo &)=delete
void operator=(const OSectionUndo &)=delete
OGroupUndo(OReportModel &rMod, TranslateId pCommentID, Action _eAction, const css::uno::Reference< css::report::XGroup > &_xGroup, const css::uno::Reference< css::report::XReportDefinition > &_xReportDefinition)
Definition: RptUndo.cxx:316
sal_uInt16 m_nSlot
Definition: RptUndo.hxx:47
Undo class for section add and remove.
Definition: RptUndo.hxx:37
Action m_eAction
! the current action
Definition: RptUndo.hxx:118
sal_Int32 m_nLastPosition
! the last position of the group
Definition: RptUndo.hxx:119
void implReInsert() override
Definition: RptUndo.cxx:229
void implReInsert() override
Definition: RptUndo.cxx:283
css::uno::Reference< css::report::XGroup > m_xGroup
! the group for the undo redo action
Definition: RptUndo.hxx:116
void implReRemove() override
Definition: RptUndo.cxx:239
virtual void Undo() override
Definition: RptUndo.cxx:171
virtual void Undo() override
Definition: RptUndo.cxx:353
css::uno::Reference< css::report::XReportDefinition > m_xReportDefinition
! the parent report definition
Definition: RptUndo.hxx:117
void implReRemove()
Definition: RptUndo.cxx:341
OReportHelper m_aReportHelper
Definition: RptUndo.hxx:69
OReportSectionUndo(const OReportSectionUndo &)=delete
/class OGroupUndo
Definition: RptUndo.hxx:114
Helper class to allow std::mem_fun for SAL_CALL.
Definition: UndoActions.hxx:47