merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / tabledesign / TableUndo.hxx
blob31b7faa5cc20e0522cd252f0bee88bb1789abbbc
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableUndo.hxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
30 #ifndef DBAUI_TABLEUNDO_HXX
31 #define DBAUI_TABLEUNDO_HXX
33 #ifndef DBAUI_GENERALUNDO_HXX
34 #include "GeneralUndo.hxx"
35 #endif
36 #ifndef _SV_MULTISEL_HXX
37 #include <tools/multisel.hxx>
38 #endif
40 #include <vector>
42 #ifndef _COM_SUN_STAR_UNO_ANY_H_
43 #include <com/sun/star/uno/Any.h>
44 #endif
45 #ifndef DBAUI_TYPEINFO_HXX
46 #include "TypeInfo.hxx"
47 #endif
49 namespace dbaui
51 //========================================================================
52 class OTableRowView;
53 class OTableRow;
54 class OTableDesignUndoAct : public OCommentUndoAction
56 protected:
57 OTableRowView* m_pTabDgnCtrl;
59 virtual void Undo();
60 virtual void Redo();
61 public:
62 TYPEINFO();
63 OTableDesignUndoAct( OTableRowView* pOwner ,USHORT nCommentID);
64 virtual ~OTableDesignUndoAct();
67 //========================================================================
68 class OTableEditorCtrl;
69 class OTableEditorUndoAct : public OTableDesignUndoAct
71 protected:
72 OTableEditorCtrl* pTabEdCtrl;
74 public:
75 TYPEINFO();
76 OTableEditorUndoAct( OTableEditorCtrl* pOwner,USHORT nCommentID );
77 virtual ~OTableEditorUndoAct();
81 //========================================================================
82 class OTableDesignCellUndoAct : public OTableDesignUndoAct
84 protected:
85 USHORT m_nCol;
86 long m_nRow;
87 ::com::sun::star::uno::Any m_sOldText;
88 ::com::sun::star::uno::Any m_sNewText;
90 virtual void Undo();
91 virtual void Redo();
92 public:
93 TYPEINFO();
94 OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, USHORT nColumn );
95 virtual ~OTableDesignCellUndoAct();
98 class OTypeInfo;
99 //========================================================================
100 class OTableEditorTypeSelUndoAct : public OTableEditorUndoAct
102 protected:
103 USHORT m_nCol;
104 long m_nRow;
105 TOTypeInfoSP m_pOldType;
106 TOTypeInfoSP m_pNewType;
108 virtual void Undo();
109 virtual void Redo();
110 public:
111 TYPEINFO();
112 OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, USHORT nColumn, const TOTypeInfoSP& _pOldType );
113 virtual ~OTableEditorTypeSelUndoAct();
116 //========================================================================
117 class OTableEditorDelUndoAct : public OTableEditorUndoAct
119 protected:
120 ::std::vector< ::boost::shared_ptr<OTableRow> > m_aDeletedRows;
122 virtual void Undo();
123 virtual void Redo();
124 public:
125 TYPEINFO();
126 OTableEditorDelUndoAct( OTableEditorCtrl* pOwner );
127 virtual ~OTableEditorDelUndoAct();
130 //========================================================================
131 class OTableEditorInsUndoAct : public OTableEditorUndoAct
133 protected:
134 ::std::vector< ::boost::shared_ptr<OTableRow> > m_vInsertedRows;
135 long m_nInsPos;
137 virtual void Undo();
138 virtual void Redo();
139 public:
140 TYPEINFO();
141 OTableEditorInsUndoAct( OTableEditorCtrl* pOwner,
142 long nInsertPosition,
143 const ::std::vector< ::boost::shared_ptr<OTableRow> >& _vInsertedRows);
144 virtual ~OTableEditorInsUndoAct();
147 //========================================================================
148 class OTableEditorInsNewUndoAct : public OTableEditorUndoAct
150 protected:
151 long m_nInsPos;
152 long m_nInsRows;
154 virtual void Undo();
155 virtual void Redo();
156 public:
157 TYPEINFO();
158 OTableEditorInsNewUndoAct( OTableEditorCtrl* pOwner, long nInsertPosition, long nInsertedRows );
159 virtual ~OTableEditorInsNewUndoAct();
162 //========================================================================
163 class OPrimKeyUndoAct : public OTableEditorUndoAct
165 protected:
166 MultiSelection m_aDelKeys,
167 m_aInsKeys;
168 BOOL m_bActPrimKeySet;
169 OTableEditorCtrl* m_pEditorCtrl;
171 virtual void Undo();
172 virtual void Redo();
173 public:
174 TYPEINFO();
175 OPrimKeyUndoAct( OTableEditorCtrl* pOwner, MultiSelection aDeletedKeys, MultiSelection aInsertedKeys );
176 virtual ~OPrimKeyUndoAct();
179 #endif // DBAUI_TABLEUNDO_HXX