2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-03-22 06:49:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:18:47 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2008-04-10 14:18:47 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2008-04-10 14:18:47 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2008-04-10 14:18:47 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2008-04-10 14:18:47 +00:00
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
2008-04-10 14:18:47 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-03-22 06:49:01 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef DBAUI_TABLEROW_HXX
|
|
|
|
#define DBAUI_TABLEROW_HXX
|
|
|
|
|
|
|
|
#include <comphelper/stl_types.hxx>
|
|
|
|
#include <tools/stream.hxx>
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
2003-03-19 16:57:12 +00:00
|
|
|
#include "TypeInfo.hxx"
|
2001-03-22 06:49:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
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
|
|
|
|
2011-01-14 15:00:11 +01:00
|
|
|
void SetPrimaryKey( sal_Bool bSet );
|
|
|
|
sal_Bool IsPrimaryKey() const;
|
2001-03-22 06:49:01 +00:00
|
|
|
|
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
|
|
|
|
|
2010-10-27 12:33:13 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|