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"
29 #include <svx/sdrobjectuser.hxx>
31 #include "celltypes.hxx"
33 namespace sdr
{ namespace properties
{
37 class OutlinerParaObject
;
41 namespace sdr
{ namespace table
{
43 class CellUndo
: public SdrUndoAction
, public sdr::ObjectUser
46 CellUndo( const SdrObjectWeakRef
& xObjRef
, const CellRef
& xCell
);
49 virtual void Undo() SAL_OVERRIDE
;
50 virtual void Redo() SAL_OVERRIDE
;
51 virtual bool Merge( SfxUndoAction
*pNextAction
) SAL_OVERRIDE
;
54 virtual void ObjectInDestruction(const SdrObject
& rObject
) SAL_OVERRIDE
;
59 sdr::properties::TextProperties
* mpProperties
;
60 OutlinerParaObject
* mpOutlinerParaObject
;
62 ::com::sun::star::table::CellContentType mnCellContentType
;
68 ::sal_Int32 mnRowSpan
;
69 ::sal_Int32 mnColSpan
;
73 , mpOutlinerParaObject(NULL
)
74 , mnCellContentType(css::table::CellContentType_EMPTY
)
84 void setDataToCell( const Data
& rData
);
85 void getDataFromCell( Data
& rData
);
87 SdrObjectWeakRef mxObjRef
;
96 class InsertRowUndo
: public SdrUndoAction
99 InsertRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aNewRows
);
100 virtual ~InsertRowUndo();
102 virtual void Undo() SAL_OVERRIDE
;
103 virtual void Redo() SAL_OVERRIDE
;
106 TableModelRef mxTable
;
114 class RemoveRowUndo
: public SdrUndoAction
117 RemoveRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aRemovedRows
);
118 virtual ~RemoveRowUndo();
120 virtual void Undo() SAL_OVERRIDE
;
121 virtual void Redo() SAL_OVERRIDE
;
124 TableModelRef mxTable
;
132 class InsertColUndo
: public SdrUndoAction
135 InsertColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
136 virtual ~InsertColUndo();
138 virtual void Undo() SAL_OVERRIDE
;
139 virtual void Redo() SAL_OVERRIDE
;
142 TableModelRef mxTable
;
144 ColumnVector maColumns
;
151 class RemoveColUndo
: public SdrUndoAction
154 RemoveColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
155 virtual ~RemoveColUndo();
157 virtual void Undo() SAL_OVERRIDE
;
158 virtual void Redo() SAL_OVERRIDE
;
161 TableModelRef mxTable
;
163 ColumnVector maColumns
;
170 class TableColumnUndo
: public SdrUndoAction
173 TableColumnUndo( const TableColumnRef
& xCol
);
174 virtual ~TableColumnUndo();
176 virtual void Undo() SAL_OVERRIDE
;
177 virtual void Redo() SAL_OVERRIDE
;
178 virtual bool Merge( SfxUndoAction
*pNextAction
) SAL_OVERRIDE
;
187 bool mbIsStartOfNewPage
;
191 void setData( const Data
& rData
);
192 void getData( Data
& rData
);
194 TableColumnRef mxCol
;
202 class TableRowUndo
: public SdrUndoAction
205 TableRowUndo( const TableRowRef
& xRow
);
206 virtual ~TableRowUndo();
208 virtual void Undo() SAL_OVERRIDE
;
209 virtual void Redo() SAL_OVERRIDE
;
210 virtual bool Merge( SfxUndoAction
*pNextAction
) SAL_OVERRIDE
;
218 bool mbOptimalHeight
;
220 bool mbIsStartOfNewPage
;
224 void setData( const Data
& rData
);
225 void getData( Data
& rData
);
235 class TableStyleUndo
: public SdrUndoAction
238 TableStyleUndo( const SdrTableObj
& rTableObj
);
240 virtual void Undo() SAL_OVERRIDE
;
241 virtual void Redo() SAL_OVERRIDE
;
244 SdrObjectWeakRef mxObjRef
;
248 TableStyleSettings maSettings
;
249 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> mxTableStyle
;
252 void setData( const Data
& rData
);
253 void getData( Data
& rData
);
264 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */