merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / TableDesignControl.hxx
blob825a6d9f9fc1dca0829ebb9133ef61802595f4be
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: TableDesignControl.hxx,v $
10 * $Revision: 1.10 $
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_TABLEDESIGNCONTROL_HXX
31 #define DBAUI_TABLEDESIGNCONTROL_HXX
33 #ifndef _TABBAR_HXX //autogen
34 #include <svtools/tabbar.hxx>
35 #endif
36 #ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
37 #include <svtools/editbrowsebox.hxx>
38 #endif
40 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
41 #include "IClipBoardTest.hxx"
42 #endif
43 #ifndef DBAUI_TYPEINFO_HXX
44 #include "TypeInfo.hxx"
45 #endif
47 #define TABPAGESIZE 70
48 namespace dbaui
50 class OTableDesignView;
51 class OTypeInfo;
52 //==================================================================
53 class OTableRowView : public ::svt::EditBrowseBox
54 ,public IClipboardTest
56 friend class OTableDesignUndoAct;
58 protected:
59 long m_nDataPos; // derzeit benoetigte Zeile
60 long m_nCurrentPos; // Aktuelle Position der ausgewaehlten Column
61 private:
62 USHORT m_nCurUndoActId;
63 protected:
64 BOOL m_bCurrentModified;
65 BOOL m_bUpdatable;
66 BOOL m_bClipboardFilled;
68 public:
69 OTableRowView(Window* pParent);
70 virtual ~OTableRowView();
72 virtual void SetCellData( long nRow, USHORT nColId, const TOTypeInfoSP& _pTypeInfo ) = 0;
73 virtual void SetCellData( long nRow, USHORT nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0;
74 virtual ::com::sun::star::uno::Any GetCellData( long nRow, USHORT nColId ) = 0;
75 virtual void SetControlText( long nRow, USHORT nColId, const String& rText ) = 0;
76 virtual String GetControlText( long nRow, USHORT nColId ) = 0;
78 virtual OTableDesignView* GetView() const = 0;
80 USHORT GetCurUndoActId(){ return m_nCurUndoActId; }
82 // IClipboardTest
83 virtual void cut();
84 virtual void copy();
85 virtual void paste();
87 protected:
88 void Paste( long nRow );
90 virtual void CopyRows() = 0;
91 virtual void DeleteRows() = 0;
92 virtual void InsertRows( long nRow ) = 0;
93 virtual void InsertNewRows( long nRow ) = 0;
95 virtual sal_Bool IsPrimaryKeyAllowed( long nRow ) = 0;
96 virtual sal_Bool IsInsertNewAllowed( long nRow ) = 0;
97 virtual sal_Bool IsDeleteAllowed( long nRow ) = 0;
99 virtual BOOL IsUpdatable() const {return m_bUpdatable;}
100 virtual void SetUpdatable( BOOL bUpdate=TRUE );
102 virtual RowStatus GetRowStatus(long nRow) const;
103 virtual void KeyInput(const KeyEvent& rEvt);
104 virtual void Command( const CommandEvent& rEvt );
106 virtual void Init();
109 #endif // DBAUI_TABLEDESIGNCONTROL_HXX