update dev300-m58
[ooovba.git] / connectivity / source / inc / OColumn.hxx
blobe915df56df2ff41aa84f7c0e0077be1822fed913
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: OColumn.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
31 #ifndef _CONNECTIVITY_COLUMN_HXX_
32 #define _CONNECTIVITY_COLUMN_HXX_
34 #include <rtl/ustring.hxx>
35 #include <sal/types.h>
36 #include "connectivity/dbtoolsdllapi.hxx"
38 namespace connectivity
40 class OOO_DLLPUBLIC_DBTOOLS OColumn
42 ::rtl::OUString m_CatalogName;
43 ::rtl::OUString m_SchemaName;
44 ::rtl::OUString m_TableName;
45 ::rtl::OUString m_ColumnName;
46 ::rtl::OUString m_ColumnLabel;
47 ::rtl::OUString m_ColumnTypeName;
48 ::rtl::OUString m_ColumnServiceName;
50 sal_Int32 m_Nullable;
51 sal_Int32 m_ColumnDisplaySize;
52 sal_Int32 m_Precision;
53 sal_Int32 m_Scale;
54 sal_Int32 m_ColumnType;
56 sal_Bool m_AutoIncrement;
57 sal_Bool m_CaseSensitive;
58 sal_Bool m_Searchable;
59 sal_Bool m_Currency;
60 sal_Bool m_Signed;
61 sal_Bool m_ReadOnly;
62 sal_Bool m_Writable;
63 sal_Bool m_DefinitelyWritable;
65 public:
66 OColumn() {}
67 OColumn(const ::rtl::OUString &_aTableName,
68 const ::rtl::OUString &_aColumnName,
70 sal_Int32 _aNullable=0,
71 sal_Int32 _aColumnDisplaySize=0,
72 sal_Int32 _aPrecision=0,
73 sal_Int32 _aScale=0,
74 sal_Int32 _aColumnType=0,
76 sal_Bool _aAutoIncrement=sal_False,
77 sal_Bool _aCaseSensitive=sal_False,
78 sal_Bool _aSearchable=sal_True,
79 sal_Bool _aCurrency=sal_False,
80 sal_Bool _aSigned=sal_False,
81 sal_Bool _aReadOnly=sal_True,
82 sal_Bool _aWritable=sal_False,
83 sal_Bool _aDefinitelyWritable=sal_False,
85 const ::rtl::OUString &_aColumnLabel = ::rtl::OUString(),
86 const ::rtl::OUString &_aColumnTypeName = ::rtl::OUString(),
87 const ::rtl::OUString &_aColumnServiceName = ::rtl::OUString())
88 : m_TableName(_aTableName),
89 m_ColumnName(_aColumnName),
90 m_ColumnLabel(_aColumnLabel),
91 m_ColumnTypeName(_aColumnTypeName),
92 m_ColumnServiceName(_aColumnServiceName),
94 m_Nullable(_aNullable),
95 m_ColumnDisplaySize(_aColumnDisplaySize),
96 m_Precision(_aPrecision),
97 m_Scale(_aScale),
98 m_ColumnType(_aColumnType),
100 m_AutoIncrement(_aAutoIncrement),
101 m_CaseSensitive(_aCaseSensitive),
102 m_Searchable(_aSearchable),
103 m_Currency(_aCurrency),
104 m_Signed(_aSigned),
105 m_ReadOnly(_aReadOnly),
106 m_Writable(_aWritable),
107 m_DefinitelyWritable(_aDefinitelyWritable)
109 if(!m_ColumnLabel.getLength())
110 m_ColumnLabel = _aColumnName;
113 inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
114 { return ::rtl_allocateMemory( nSize ); }
115 inline static void * SAL_CALL operator new( size_t ,void* _pHint ) SAL_THROW( () )
116 { return _pHint; }
117 inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
118 { ::rtl_freeMemory( pMem ); }
119 inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
122 sal_Bool isAutoIncrement() const { return m_AutoIncrement; }
123 sal_Bool isCaseSensitive() const { return m_CaseSensitive; }
124 sal_Bool isSearchable() const { return m_Searchable; }
125 sal_Bool isCurrency() const { return m_Currency; }
126 sal_Bool isSigned() const { return m_Signed; }
127 sal_Bool isReadOnly() const { return m_ReadOnly; }
128 sal_Bool isWritable() const { return m_Writable; }
129 sal_Bool isDefinitelyWritable() const { return m_DefinitelyWritable; }
131 sal_Int32 isNullable() const { return m_Nullable; }
132 sal_Int32 getColumnDisplaySize() const { return m_ColumnDisplaySize; }
133 sal_Int32 getPrecision() const { return m_Precision; }
134 sal_Int32 getScale() const { return m_Scale; }
135 sal_Int32 getColumnType() const { return m_ColumnType; }
137 const ::rtl::OUString& getColumnLabel() const { return m_ColumnLabel; }
138 const ::rtl::OUString& getColumnName() const { return m_ColumnName; }
139 const ::rtl::OUString& getSchemaName() const { return m_SchemaName; }
140 const ::rtl::OUString& getTableName() const { return m_TableName; }
141 const ::rtl::OUString& getCatalogName() const { return m_CatalogName; }
142 const ::rtl::OUString& getColumnTypeName() const { return m_ColumnTypeName; }
143 const ::rtl::OUString& getColumnServiceName() const { return m_ColumnServiceName; }
148 #endif //_CONNECTIVITY_COLUMN_HXX_