merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / TableRow.hxx
blobb451ed83e8bdbff467df26d1283930a304b647e1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableRow.hxx,v $
10 * $Revision: 1.8 $
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>
35 #endif
36 #ifndef _STRING_HXX
37 #include <tools/string.hxx>
38 #endif
39 #ifndef _STREAM_HXX
40 #include <tools/stream.hxx>
41 #endif
42 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
43 #include <com/sun/star/beans/XPropertySet.hpp>
44 #endif
45 #ifndef DBAUI_TYPEINFO_HXX
46 #include "TypeInfo.hxx"
47 #endif
50 namespace dbaui
52 // class OTableRow;
53 // friend SvStream& operator<<( SvStream& rStr, OTableRow& _rRow );
55 class OFieldDescription;
56 class OTypeInfo;
57 class OTableRow
59 private:
60 OFieldDescription* m_pActFieldDescr;
61 long m_nPos;
62 bool m_bReadOnly;
63 bool m_bOwnsDescriptions;
65 protected:
66 public:
67 OTableRow();
68 OTableRow(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAffectedCol);
69 OTableRow( const OTableRow& rRow, long nPosition = -1 );
70 ~OTableRow();
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.
81 @return
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
88 @param _bRead
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
94 @return
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