1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tableundo.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_TABLEUNDO_HXX_
32 #define _SVX_TABLEUNDO_HXX_
34 #include <com/sun/star/container/XIndexAccess.hpp>
35 #include <com/sun/star/table/CellContentType.hpp>
37 #include "svx/svdotable.hxx"
38 #include "svx/svdobj.hxx"
39 #include "svx/svdundo.hxx"
41 #include "celltypes.hxx"
43 namespace sdr
{ namespace properties
{
47 class OutlinerParaObject
;
49 // -----------------------------------------------------------------------------
51 namespace sdr
{ namespace table
{
53 class CellUndo
: public SdrUndoAction
, public sdr::ObjectUser
56 CellUndo( const SdrObjectWeakRef
& xObjRef
, const CellRef
& xCell
);
61 virtual BOOL
Merge( SfxUndoAction
*pNextAction
);
64 virtual void ObjectInDestruction(const SdrObject
& rObject
);
69 sdr::properties::TextProperties
* mpProperties
;
70 OutlinerParaObject
* mpOutlinerParaObject
;
72 ::com::sun::star::table::CellContentType mnCellContentType
;
74 ::rtl::OUString msFormula
;
78 ::sal_Int32 mnRowSpan
;
79 ::sal_Int32 mnColSpan
;
81 Data() : mpProperties(0), mpOutlinerParaObject(0) {};
84 void setDataToCell( const Data
& rData
);
85 void getDataFromCell( Data
& rData
);
87 SdrObjectWeakRef mxObjRef
;
94 // -----------------------------------------------------------------------------
96 class InsertRowUndo
: public SdrUndoAction
99 InsertRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aNewRows
);
100 virtual ~InsertRowUndo();
106 TableModelRef mxTable
;
112 // -----------------------------------------------------------------------------
114 class RemoveRowUndo
: public SdrUndoAction
117 RemoveRowUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, RowVector
& aRemovedRows
);
118 virtual ~RemoveRowUndo();
124 TableModelRef mxTable
;
130 // -----------------------------------------------------------------------------
132 class InsertColUndo
: public SdrUndoAction
135 InsertColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
136 virtual ~InsertColUndo();
142 TableModelRef mxTable
;
144 ColumnVector maColumns
;
149 // -----------------------------------------------------------------------------
151 class RemoveColUndo
: public SdrUndoAction
154 RemoveColUndo( const TableModelRef
& xTable
, sal_Int32 nIndex
, ColumnVector
& aNewCols
, CellVector
& aCells
);
155 virtual ~RemoveColUndo();
161 TableModelRef mxTable
;
163 ColumnVector maColumns
;
168 // -----------------------------------------------------------------------------
170 class TableColumnUndo
: public SdrUndoAction
173 TableColumnUndo( const TableColumnRef
& xCol
);
174 virtual ~TableColumnUndo();
178 virtual BOOL
Merge( SfxUndoAction
*pNextAction
);
185 sal_Bool mbOptimalWidth
;
186 sal_Bool mbIsVisible
;
187 sal_Bool mbIsStartOfNewPage
;
188 ::rtl::OUString maName
;
191 void setData( const Data
& rData
);
192 void getData( Data
& rData
);
194 TableColumnRef mxCol
;
200 // -----------------------------------------------------------------------------
202 class TableRowUndo
: public SdrUndoAction
205 TableRowUndo( const TableRowRef
& xRow
);
206 virtual ~TableRowUndo();
210 virtual BOOL
Merge( SfxUndoAction
*pNextAction
);
218 sal_Bool mbOptimalHeight
;
219 sal_Bool mbIsVisible
;
220 sal_Bool mbIsStartOfNewPage
;
221 ::rtl::OUString maName
;
224 void setData( const Data
& rData
);
225 void getData( Data
& rData
);
233 // -----------------------------------------------------------------------------
235 class TableStyleUndo
: public SdrUndoAction
238 TableStyleUndo( const SdrTableObj
& rTableObj
);
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
);