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 _SVX_TABLEUNDO_HXX_
21 #define _SVX_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
;
38 // -----------------------------------------------------------------------------
40 namespace sdr
{ namespace table
{
42 class CellUndo
: public SdrUndoAction
, public sdr::ObjectUser
45 CellUndo( const SdrObjectWeakRef
& xObjRef
, const CellRef
& xCell
);
50 virtual sal_Bool
Merge( SfxUndoAction
*pNextAction
);
53 virtual void ObjectInDestruction(const SdrObject
& rObject
);
58 sdr::properties::TextProperties
* mpProperties
;
59 OutlinerParaObject
* mpOutlinerParaObject
;
61 ::com::sun::star::table::CellContentType mnCellContentType
;
67 ::sal_Int32 mnRowSpan
;
68 ::sal_Int32 mnColSpan
;
70 Data() : mpProperties(NULL
), mpOutlinerParaObject(NULL
), mfValue(0) {};
73 void setDataToCell( const Data
& rData
);
74 void getDataFromCell( Data
& rData
);
76 SdrObjectWeakRef mxObjRef
;
83 // -----------------------------------------------------------------------------
85 class InsertRowUndo
: public SdrUndoAction
88 InsertRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aNewRows
);
89 virtual ~InsertRowUndo();
95 TableModelRef mxTable
;
101 // -----------------------------------------------------------------------------
103 class RemoveRowUndo
: public SdrUndoAction
106 RemoveRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aRemovedRows
);
107 virtual ~RemoveRowUndo();
113 TableModelRef mxTable
;
119 // -----------------------------------------------------------------------------
121 class InsertColUndo
: public SdrUndoAction
124 InsertColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
125 virtual ~InsertColUndo();
131 TableModelRef mxTable
;
133 ColumnVector maColumns
;
138 // -----------------------------------------------------------------------------
140 class RemoveColUndo
: public SdrUndoAction
143 RemoveColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
144 virtual ~RemoveColUndo();
150 TableModelRef mxTable
;
152 ColumnVector maColumns
;
157 // -----------------------------------------------------------------------------
159 class TableColumnUndo
: public SdrUndoAction
162 TableColumnUndo( const TableColumnRef
& xCol
);
163 virtual ~TableColumnUndo();
167 virtual sal_Bool
Merge( SfxUndoAction
*pNextAction
);
174 sal_Bool mbOptimalWidth
;
175 sal_Bool mbIsVisible
;
176 sal_Bool mbIsStartOfNewPage
;
180 void setData( const Data
& rData
);
181 void getData( Data
& rData
);
183 TableColumnRef mxCol
;
189 // -----------------------------------------------------------------------------
191 class TableRowUndo
: public SdrUndoAction
194 TableRowUndo( const TableRowRef
& xRow
);
195 virtual ~TableRowUndo();
199 virtual sal_Bool
Merge( SfxUndoAction
*pNextAction
);
207 sal_Bool mbOptimalHeight
;
208 sal_Bool mbIsVisible
;
209 sal_Bool mbIsStartOfNewPage
;
213 void setData( const Data
& rData
);
214 void getData( Data
& rData
);
222 // -----------------------------------------------------------------------------
224 class TableStyleUndo
: public SdrUndoAction
227 TableStyleUndo( const SdrTableObj
& rTableObj
);
233 SdrObjectWeakRef mxObjRef
;
237 TableStyleSettings maSettings
;
238 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> mxTableStyle
;
241 void setData( const Data
& rData
);
242 void getData( Data
& rData
);
253 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */