2001-03-22 06:49:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* $RCSfile: TableRow.hxx,v $
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2006-01-16 14:28:26 +00:00
|
|
|
* $Revision: 1.7 $
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2006-01-16 14:28:26 +00:00
|
|
|
* last change: $Author: obo $ $Date: 2006-01-16 15:28:26 $
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2005-09-08 14:37:29 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef DBAUI_TABLEROW_HXX
|
|
|
|
#define DBAUI_TABLEROW_HXX
|
|
|
|
|
|
|
|
#ifndef _COMPHELPER_STLTYPES_HXX_
|
|
|
|
#include <comphelper/stl_types.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _STRING_HXX
|
|
|
|
#include <tools/string.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _STREAM_HXX
|
|
|
|
#include <tools/stream.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
2003-03-19 16:57:12 +00:00
|
|
|
#ifndef DBAUI_TYPEINFO_HXX
|
|
|
|
#include "TypeInfo.hxx"
|
|
|
|
#endif
|
2001-03-22 06:49:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
// class OTableRow;
|
|
|
|
// friend SvStream& operator<<( SvStream& rStr, OTableRow& _rRow );
|
|
|
|
|
|
|
|
class OFieldDescription;
|
|
|
|
class OTypeInfo;
|
|
|
|
class OTableRow
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
OFieldDescription* m_pActFieldDescr;
|
|
|
|
long m_nPos;
|
2002-06-27 06:42:49 +00:00
|
|
|
bool m_bReadOnly;
|
|
|
|
bool m_bOwnsDescriptions;
|
2001-03-22 06:49:01 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
public:
|
|
|
|
OTableRow();
|
|
|
|
OTableRow(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAffectedCol);
|
|
|
|
OTableRow( const OTableRow& rRow, long nPosition = -1 );
|
2002-06-27 06:42:49 +00:00
|
|
|
~OTableRow();
|
2001-03-22 06:49:01 +00:00
|
|
|
|
2002-04-02 05:25:49 +00:00
|
|
|
inline OFieldDescription* GetActFieldDescr() const { return m_pActFieldDescr; }
|
|
|
|
inline bool isValid() const { return GetActFieldDescr() != NULL; }
|
2001-03-22 06:49:01 +00:00
|
|
|
|
2003-03-19 16:57:12 +00:00
|
|
|
void SetFieldType( const TOTypeInfoSP& _pType, sal_Bool _bForce = sal_False );
|
2001-03-22 06:49:01 +00:00
|
|
|
|
|
|
|
void SetPrimaryKey( BOOL bSet );
|
|
|
|
BOOL IsPrimaryKey() const;
|
|
|
|
|
2002-06-27 06:42:49 +00:00
|
|
|
/** returns the current position in the table.
|
|
|
|
@return
|
|
|
|
the current position in the table
|
|
|
|
*/
|
2002-04-02 05:25:49 +00:00
|
|
|
inline long GetPos() const { return m_nPos; }
|
2006-01-16 14:28:26 +00:00
|
|
|
inline void SetPos(sal_Int32 _nPos) { m_nPos = _nPos; }
|
2001-03-22 06:49:01 +00:00
|
|
|
|
2002-06-27 06:42:49 +00:00
|
|
|
/** set the row readonly
|
|
|
|
@param _bRead
|
|
|
|
if <TRUE/> then the row is redonly, otherwise not
|
|
|
|
*/
|
|
|
|
inline void SetReadOnly( bool _bRead=true ){ m_bReadOnly = _bRead; }
|
2001-03-22 06:49:01 +00:00
|
|
|
|
2002-06-27 06:42:49 +00:00
|
|
|
/** returns if the row is readonly
|
|
|
|
@return
|
|
|
|
<TRUE/> if readonly, otherwise <FALSE/>
|
|
|
|
*/
|
|
|
|
inline bool IsReadOnly() const { return m_bReadOnly; }
|
2001-03-22 06:49:01 +00:00
|
|
|
|
|
|
|
friend SvStream& operator<<( SvStream& rStr,const OTableRow& _rRow );
|
|
|
|
friend SvStream& operator>>( SvStream& rStr, OTableRow& _rRow );
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // DBAUI_TABLEROW_HXX
|
|
|
|
|