xref: /AOO41X/main/dbaccess/source/ui/inc/TableDesignControl.hxx (revision 2e2212a7c22e96cf6f6fab0dd042c34a45a64bd6)
1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir #ifndef DBAUI_TABLEDESIGNCONTROL_HXX
24cdf0e10cSrcweir #define DBAUI_TABLEDESIGNCONTROL_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _TABBAR_HXX //autogen
27cdf0e10cSrcweir #include <svtools/tabbar.hxx>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
30cdf0e10cSrcweir #include <svtools/editbrowsebox.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
34cdf0e10cSrcweir #include "IClipBoardTest.hxx"
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #ifndef DBAUI_TYPEINFO_HXX
37cdf0e10cSrcweir #include "TypeInfo.hxx"
38cdf0e10cSrcweir #endif
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #define TABPAGESIZE 70
41cdf0e10cSrcweir namespace dbaui
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 	class OTableDesignView;
44cdf0e10cSrcweir 	class OTypeInfo;
45cdf0e10cSrcweir 	//==================================================================
46cdf0e10cSrcweir 	class OTableRowView : public ::svt::EditBrowseBox
47cdf0e10cSrcweir 						,public IClipboardTest
48cdf0e10cSrcweir 	{
49cdf0e10cSrcweir 		friend class OTableDesignUndoAct;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	protected:
52cdf0e10cSrcweir 		long	m_nDataPos;				// derzeit benoetigte Zeile
53cdf0e10cSrcweir 		long	m_nCurrentPos;			// Aktuelle Position der ausgewaehlten Column
54cdf0e10cSrcweir 	private:
55cdf0e10cSrcweir 		sal_uInt16	m_nCurUndoActId;
56cdf0e10cSrcweir 	protected:
57cdf0e10cSrcweir 		sal_Bool	m_bCurrentModified;
58cdf0e10cSrcweir 		sal_Bool	m_bUpdatable;
59cdf0e10cSrcweir 		sal_Bool	m_bClipboardFilled;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 	public:
62cdf0e10cSrcweir 		OTableRowView(Window* pParent);
63cdf0e10cSrcweir 		virtual ~OTableRowView();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 		virtual void				SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0;
66cdf0e10cSrcweir 		virtual void				SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0;
67cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any			GetCellData( long nRow, sal_uInt16 nColId ) = 0;
68cdf0e10cSrcweir 		virtual void				SetControlText( long nRow, sal_uInt16 nColId, const String& rText ) = 0;
69cdf0e10cSrcweir 		virtual String				GetControlText( long nRow, sal_uInt16 nColId ) = 0;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 		virtual OTableDesignView* GetView() const = 0;
72cdf0e10cSrcweir 
GetCurUndoActId()73cdf0e10cSrcweir 		sal_uInt16	GetCurUndoActId(){ return m_nCurUndoActId; }
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 		// IClipboardTest
76cdf0e10cSrcweir 		virtual void cut();
77cdf0e10cSrcweir 		virtual void copy();
78cdf0e10cSrcweir 		virtual void paste();
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	protected:
81cdf0e10cSrcweir 		void Paste( long nRow );
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 		virtual void CopyRows()								= 0;
84cdf0e10cSrcweir 		virtual void DeleteRows()							= 0;
85cdf0e10cSrcweir 		virtual void InsertRows( long nRow )				= 0;
86cdf0e10cSrcweir 		virtual void InsertNewRows( long nRow )				= 0;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 		virtual sal_Bool IsPrimaryKeyAllowed( long nRow )	= 0;
89cdf0e10cSrcweir 		virtual sal_Bool IsInsertNewAllowed( long nRow )	= 0;
90cdf0e10cSrcweir 		virtual sal_Bool IsDeleteAllowed( long nRow )		= 0;
91cdf0e10cSrcweir 
IsUpdatable() const92cdf0e10cSrcweir 		virtual sal_Bool IsUpdatable() const {return m_bUpdatable;}
93cdf0e10cSrcweir 		virtual void SetUpdatable( sal_Bool bUpdate=sal_True );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 		virtual RowStatus GetRowStatus(long nRow) const;
96cdf0e10cSrcweir 		virtual void KeyInput(const KeyEvent& rEvt);
97cdf0e10cSrcweir 		virtual void Command( const CommandEvent& rEvt );
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 		virtual void Init();
100cdf0e10cSrcweir 	};
101cdf0e10cSrcweir }
102cdf0e10cSrcweir #endif // DBAUI_TABLEDESIGNCONTROL_HXX
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
105