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 .
20 #ifndef INCLUDED_SVX_SOURCE_TABLE_TABLEUNDO_HXX
21 #define INCLUDED_SVX_SOURCE_TABLE_TABLEUNDO_HXX
23 #include <com/sun/star/container/XIndexAccess.hpp>
24 #include <com/sun/star/table/CellContentType.hpp>
26 #include "svx/svdotable.hxx"
27 #include "svx/svdobj.hxx"
28 #include "svx/svdundo.hxx"
30 #include "celltypes.hxx"
32 namespace sdr
{ namespace properties
{
36 class OutlinerParaObject
;
40 namespace sdr
{ namespace table
{
42 class CellUndo
: public SdrUndoAction
, public sdr::ObjectUser
45 CellUndo( const SdrObjectWeakRef
& xObjRef
, const CellRef
& xCell
);
48 virtual void Undo() SAL_OVERRIDE
;
49 virtual void Redo() SAL_OVERRIDE
;
50 virtual bool Merge( SfxUndoAction
*pNextAction
) SAL_OVERRIDE
;
53 virtual void ObjectInDestruction(const SdrObject
& rObject
) SAL_OVERRIDE
;
58 sdr::properties::TextProperties
* mpProperties
;
59 OutlinerParaObject
* mpOutlinerParaObject
;
61 ::com::sun::star::table::CellContentType mnCellContentType
;
67 ::sal_Int32 mnRowSpan
;
68 ::sal_Int32 mnColSpan
;
72 , mpOutlinerParaObject(NULL
)
73 , mnCellContentType(css::table::CellContentType_EMPTY
)
83 void setDataToCell( const Data
& rData
);
84 void getDataFromCell( Data
& rData
);
86 SdrObjectWeakRef mxObjRef
;
95 class InsertRowUndo
: public SdrUndoAction
98 InsertRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aNewRows
);
99 virtual ~InsertRowUndo();
101 virtual void Undo() SAL_OVERRIDE
;
102 virtual void Redo() SAL_OVERRIDE
;
105 TableModelRef mxTable
;
113 class RemoveRowUndo
: public SdrUndoAction
116 RemoveRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aRemovedRows
);
117 virtual ~RemoveRowUndo();
119 virtual void Undo() SAL_OVERRIDE
;
120 virtual void Redo() SAL_OVERRIDE
;
123 TableModelRef mxTable
;
131 class InsertColUndo
: public SdrUndoAction
134 InsertColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
135 virtual ~InsertColUndo();
137 virtual void Undo() SAL_OVERRIDE
;
138 virtual void Redo() SAL_OVERRIDE
;
141 TableModelRef mxTable
;
143 ColumnVector maColumns
;
150 class RemoveColUndo
: public SdrUndoAction
153 RemoveColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
154 virtual ~RemoveColUndo();
156 virtual void Undo() SAL_OVERRIDE
;
157 virtual void Redo() SAL_OVERRIDE
;
160 TableModelRef mxTable
;
162 ColumnVector maColumns
;
169 class TableColumnUndo
: public SdrUndoAction
172 TableColumnUndo( const TableColumnRef
& xCol
);
173 virtual ~TableColumnUndo();
175 virtual void Undo() SAL_OVERRIDE
;
176 virtual void Redo() SAL_OVERRIDE
;
177 virtual bool Merge( SfxUndoAction
*pNextAction
) SAL_OVERRIDE
;
186 bool mbIsStartOfNewPage
;
190 void setData( const Data
& rData
);
191 void getData( Data
& rData
);
193 TableColumnRef mxCol
;
201 class TableRowUndo
: public SdrUndoAction
204 TableRowUndo( const TableRowRef
& xRow
);
205 virtual ~TableRowUndo();
207 virtual void Undo() SAL_OVERRIDE
;
208 virtual void Redo() SAL_OVERRIDE
;
209 virtual bool Merge( SfxUndoAction
*pNextAction
) SAL_OVERRIDE
;
217 bool mbOptimalHeight
;
219 bool mbIsStartOfNewPage
;
223 void setData( const Data
& rData
);
224 void getData( Data
& rData
);
234 class TableStyleUndo
: public SdrUndoAction
237 TableStyleUndo( const SdrTableObj
& rTableObj
);
239 virtual void Undo() SAL_OVERRIDE
;
240 virtual void Redo() SAL_OVERRIDE
;
243 SdrObjectWeakRef mxObjRef
;
247 TableStyleSettings maSettings
;
248 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> mxTableStyle
;
251 void setData( const Data
& rData
);
252 void getData( Data
& rData
);
263 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */