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 .
21 #include <GeneralUndo.hxx>
22 #include <tools/multisel.hxx>
26 #include <com/sun/star/uno/Any.h>
27 #include <TypeInfo.hxx>
28 #include <vcl/vclptr.hxx>
34 class OTableDesignUndoAct
: public OCommentUndoAction
37 VclPtr
<OTableRowView
> m_pTabDgnCtrl
;
39 virtual void Undo() override
;
40 virtual void Redo() override
;
42 OTableDesignUndoAct(OTableRowView
* pOwner
, TranslateId pCommentID
);
43 virtual ~OTableDesignUndoAct() override
;
46 class OTableEditorCtrl
;
47 class OTableEditorUndoAct
: public OTableDesignUndoAct
50 VclPtr
<OTableEditorCtrl
> pTabEdCtrl
;
53 OTableEditorUndoAct(OTableEditorCtrl
* pOwner
, TranslateId pCommentID
);
54 virtual ~OTableEditorUndoAct() override
;
57 class OTableDesignCellUndoAct final
: public OTableDesignUndoAct
61 css::uno::Any m_sOldText
;
62 css::uno::Any m_sNewText
;
64 virtual void Undo() override
;
65 virtual void Redo() override
;
67 OTableDesignCellUndoAct( OTableRowView
* pOwner
, sal_Int32 nRowID
, sal_uInt16 nColumn
);
68 virtual ~OTableDesignCellUndoAct() override
;
71 class OTableEditorTypeSelUndoAct final
: public OTableEditorUndoAct
75 TOTypeInfoSP m_pOldType
;
76 TOTypeInfoSP m_pNewType
;
78 virtual void Undo() override
;
79 virtual void Redo() override
;
81 OTableEditorTypeSelUndoAct( OTableEditorCtrl
* pOwner
, sal_Int32 nRowID
, sal_uInt16 nColumn
, TOTypeInfoSP _pOldType
);
82 virtual ~OTableEditorTypeSelUndoAct() override
;
85 class OTableEditorDelUndoAct final
: public OTableEditorUndoAct
87 std::vector
< std::shared_ptr
<OTableRow
> > m_aDeletedRows
;
89 virtual void Undo() override
;
90 virtual void Redo() override
;
92 explicit OTableEditorDelUndoAct( OTableEditorCtrl
* pOwner
);
93 virtual ~OTableEditorDelUndoAct() override
;
96 class OTableEditorInsUndoAct final
: public OTableEditorUndoAct
98 std::vector
< std::shared_ptr
<OTableRow
> > m_vInsertedRows
;
99 tools::Long m_nInsPos
;
101 virtual void Undo() override
;
102 virtual void Redo() override
;
104 OTableEditorInsUndoAct( OTableEditorCtrl
* pOwner
,
105 tools::Long nInsertPosition
,
106 std::vector
< std::shared_ptr
<OTableRow
> >&& _vInsertedRows
);
107 virtual ~OTableEditorInsUndoAct() override
;
110 class OTableEditorInsNewUndoAct final
: public OTableEditorUndoAct
113 sal_Int32 m_nInsRows
;
115 virtual void Undo() override
;
116 virtual void Redo() override
;
118 OTableEditorInsNewUndoAct( OTableEditorCtrl
* pOwner
, sal_Int32 nInsertPosition
, sal_Int32 nInsertedRows
);
119 virtual ~OTableEditorInsNewUndoAct() override
;
122 class OPrimKeyUndoAct final
: public OTableEditorUndoAct
124 MultiSelection m_aDelKeys
,
126 VclPtr
<OTableEditorCtrl
> m_pEditorCtrl
;
128 virtual void Undo() override
;
129 virtual void Redo() override
;
131 OPrimKeyUndoAct( OTableEditorCtrl
* pOwner
, const MultiSelection
& aDeletedKeys
, const MultiSelection
& aInsertedKeys
);
132 virtual ~OPrimKeyUndoAct() override
;
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */