1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableRow.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_TABLEROW_HXX
31 #define DBAUI_TABLEROW_HXX
33 #ifndef _COMPHELPER_STLTYPES_HXX_
34 #include <comphelper/stl_types.hxx>
37 #include <tools/string.hxx>
40 #include <tools/stream.hxx>
42 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
43 #include <com/sun/star/beans/XPropertySet.hpp>
45 #ifndef DBAUI_TYPEINFO_HXX
46 #include "TypeInfo.hxx"
53 // friend SvStream& operator<<( SvStream& rStr, OTableRow& _rRow );
55 class OFieldDescription
;
60 OFieldDescription
* m_pActFieldDescr
;
63 bool m_bOwnsDescriptions
;
68 OTableRow(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xAffectedCol
);
69 OTableRow( const OTableRow
& rRow
, long nPosition
= -1 );
72 inline OFieldDescription
* GetActFieldDescr() const { return m_pActFieldDescr
; }
73 inline bool isValid() const { return GetActFieldDescr() != NULL
; }
75 void SetFieldType( const TOTypeInfoSP
& _pType
, sal_Bool _bForce
= sal_False
);
77 void SetPrimaryKey( BOOL bSet
);
78 BOOL
IsPrimaryKey() const;
80 /** returns the current position in the table.
82 the current position in the table
84 inline long GetPos() const { return m_nPos
; }
85 inline void SetPos(sal_Int32 _nPos
) { m_nPos
= _nPos
; }
87 /** set the row readonly
89 if <TRUE/> then the row is redonly, otherwise not
91 inline void SetReadOnly( bool _bRead
=true ){ m_bReadOnly
= _bRead
; }
93 /** returns if the row is readonly
95 <TRUE/> if readonly, otherwise <FALSE/>
97 inline bool IsReadOnly() const { return m_bReadOnly
; }
99 friend SvStream
& operator<<( SvStream
& rStr
,const OTableRow
& _rRow
);
100 friend SvStream
& operator>>( SvStream
& rStr
, OTableRow
& _rRow
);
103 #endif // DBAUI_TABLEROW_HXX