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