1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef DBAUI_TABLEDESIGNCONTROL_HXX 28*cdf0e10cSrcweir #define DBAUI_TABLEDESIGNCONTROL_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #ifndef _TABBAR_HXX //autogen 31*cdf0e10cSrcweir #include <svtools/tabbar.hxx> 32*cdf0e10cSrcweir #endif 33*cdf0e10cSrcweir #ifndef _SVTOOLS_EDITBROWSEBOX_HXX_ 34*cdf0e10cSrcweir #include <svtools/editbrowsebox.hxx> 35*cdf0e10cSrcweir #endif 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX 38*cdf0e10cSrcweir #include "IClipBoardTest.hxx" 39*cdf0e10cSrcweir #endif 40*cdf0e10cSrcweir #ifndef DBAUI_TYPEINFO_HXX 41*cdf0e10cSrcweir #include "TypeInfo.hxx" 42*cdf0e10cSrcweir #endif 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir #define TABPAGESIZE 70 45*cdf0e10cSrcweir namespace dbaui 46*cdf0e10cSrcweir { 47*cdf0e10cSrcweir class OTableDesignView; 48*cdf0e10cSrcweir class OTypeInfo; 49*cdf0e10cSrcweir //================================================================== 50*cdf0e10cSrcweir class OTableRowView : public ::svt::EditBrowseBox 51*cdf0e10cSrcweir ,public IClipboardTest 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir friend class OTableDesignUndoAct; 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir protected: 56*cdf0e10cSrcweir long m_nDataPos; // derzeit benoetigte Zeile 57*cdf0e10cSrcweir long m_nCurrentPos; // Aktuelle Position der ausgewaehlten Column 58*cdf0e10cSrcweir private: 59*cdf0e10cSrcweir sal_uInt16 m_nCurUndoActId; 60*cdf0e10cSrcweir protected: 61*cdf0e10cSrcweir sal_Bool m_bCurrentModified; 62*cdf0e10cSrcweir sal_Bool m_bUpdatable; 63*cdf0e10cSrcweir sal_Bool m_bClipboardFilled; 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir public: 66*cdf0e10cSrcweir OTableRowView(Window* pParent); 67*cdf0e10cSrcweir virtual ~OTableRowView(); 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; 70*cdf0e10cSrcweir virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; 71*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0; 72*cdf0e10cSrcweir virtual void SetControlText( long nRow, sal_uInt16 nColId, const String& rText ) = 0; 73*cdf0e10cSrcweir virtual String GetControlText( long nRow, sal_uInt16 nColId ) = 0; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir virtual OTableDesignView* GetView() const = 0; 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir sal_uInt16 GetCurUndoActId(){ return m_nCurUndoActId; } 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir // IClipboardTest 80*cdf0e10cSrcweir virtual void cut(); 81*cdf0e10cSrcweir virtual void copy(); 82*cdf0e10cSrcweir virtual void paste(); 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir protected: 85*cdf0e10cSrcweir void Paste( long nRow ); 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir virtual void CopyRows() = 0; 88*cdf0e10cSrcweir virtual void DeleteRows() = 0; 89*cdf0e10cSrcweir virtual void InsertRows( long nRow ) = 0; 90*cdf0e10cSrcweir virtual void InsertNewRows( long nRow ) = 0; 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir virtual sal_Bool IsPrimaryKeyAllowed( long nRow ) = 0; 93*cdf0e10cSrcweir virtual sal_Bool IsInsertNewAllowed( long nRow ) = 0; 94*cdf0e10cSrcweir virtual sal_Bool IsDeleteAllowed( long nRow ) = 0; 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir virtual sal_Bool IsUpdatable() const {return m_bUpdatable;} 97*cdf0e10cSrcweir virtual void SetUpdatable( sal_Bool bUpdate=sal_True ); 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir virtual RowStatus GetRowStatus(long nRow) const; 100*cdf0e10cSrcweir virtual void KeyInput(const KeyEvent& rEvt); 101*cdf0e10cSrcweir virtual void Command( const CommandEvent& rEvt ); 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir virtual void Init(); 104*cdf0e10cSrcweir }; 105*cdf0e10cSrcweir } 106*cdf0e10cSrcweir #endif // DBAUI_TABLEDESIGNCONTROL_HXX 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir 109