1*caf5cd79SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*caf5cd79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*caf5cd79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*caf5cd79SAndrew Rist  * distributed with this work for additional information
6*caf5cd79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*caf5cd79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*caf5cd79SAndrew Rist  * "License"); you may not use this file except in compliance
9*caf5cd79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*caf5cd79SAndrew Rist  *
11*caf5cd79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*caf5cd79SAndrew Rist  *
13*caf5cd79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*caf5cd79SAndrew Rist  * software distributed under the License is distributed on an
15*caf5cd79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*caf5cd79SAndrew Rist  * KIND, either express or implied.  See the License for the
17*caf5cd79SAndrew Rist  * specific language governing permissions and limitations
18*caf5cd79SAndrew Rist  * under the License.
19*caf5cd79SAndrew Rist  *
20*caf5cd79SAndrew Rist  *************************************************************/
21*caf5cd79SAndrew Rist 
22*caf5cd79SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _CONNECTIVITY_COLUMN_HXX_
25cdf0e10cSrcweir #define _CONNECTIVITY_COLUMN_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <rtl/ustring.hxx>
28cdf0e10cSrcweir #include <sal/types.h>
29cdf0e10cSrcweir #include "connectivity/dbtoolsdllapi.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace connectivity
32cdf0e10cSrcweir {
33cdf0e10cSrcweir 	class OOO_DLLPUBLIC_DBTOOLS OColumn
34cdf0e10cSrcweir 	{
35cdf0e10cSrcweir 		::rtl::OUString m_CatalogName;
36cdf0e10cSrcweir 		::rtl::OUString m_SchemaName;
37cdf0e10cSrcweir 		::rtl::OUString m_TableName;
38cdf0e10cSrcweir 		::rtl::OUString m_ColumnName;
39cdf0e10cSrcweir 		::rtl::OUString m_ColumnLabel;
40cdf0e10cSrcweir 		::rtl::OUString m_ColumnTypeName;
41cdf0e10cSrcweir 		::rtl::OUString m_ColumnServiceName;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir 		sal_Int32		m_Nullable;
44cdf0e10cSrcweir 		sal_Int32		m_ColumnDisplaySize;
45cdf0e10cSrcweir 		sal_Int32		m_Precision;
46cdf0e10cSrcweir 		sal_Int32		m_Scale;
47cdf0e10cSrcweir 		sal_Int32		m_ColumnType;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 		sal_Bool		m_AutoIncrement;
50cdf0e10cSrcweir 		sal_Bool		m_CaseSensitive;
51cdf0e10cSrcweir 		sal_Bool		m_Searchable;
52cdf0e10cSrcweir 		sal_Bool		m_Currency;
53cdf0e10cSrcweir 		sal_Bool 		m_Signed;
54cdf0e10cSrcweir 		sal_Bool		m_ReadOnly;
55cdf0e10cSrcweir 		sal_Bool		m_Writable;
56cdf0e10cSrcweir 		sal_Bool		m_DefinitelyWritable;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	public:
OColumn()59cdf0e10cSrcweir 		OColumn() {}
OColumn(const::rtl::OUString & _aTableName,const::rtl::OUString & _aColumnName,sal_Int32 _aNullable=0,sal_Int32 _aColumnDisplaySize=0,sal_Int32 _aPrecision=0,sal_Int32 _aScale=0,sal_Int32 _aColumnType=0,sal_Bool _aAutoIncrement=sal_False,sal_Bool _aCaseSensitive=sal_False,sal_Bool _aSearchable=sal_True,sal_Bool _aCurrency=sal_False,sal_Bool _aSigned=sal_False,sal_Bool _aReadOnly=sal_True,sal_Bool _aWritable=sal_False,sal_Bool _aDefinitelyWritable=sal_False,const::rtl::OUString & _aColumnLabel=::rtl::OUString (),const::rtl::OUString & _aColumnTypeName=::rtl::OUString (),const::rtl::OUString & _aColumnServiceName=::rtl::OUString ())60cdf0e10cSrcweir 		OColumn(const ::rtl::OUString &_aTableName,
61cdf0e10cSrcweir 				const ::rtl::OUString &_aColumnName,
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 				sal_Int32		_aNullable=0,
64cdf0e10cSrcweir 				sal_Int32		_aColumnDisplaySize=0,
65cdf0e10cSrcweir 				sal_Int32		_aPrecision=0,
66cdf0e10cSrcweir 				sal_Int32		_aScale=0,
67cdf0e10cSrcweir 				sal_Int32		_aColumnType=0,
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 				sal_Bool		_aAutoIncrement=sal_False,
70cdf0e10cSrcweir 				sal_Bool		_aCaseSensitive=sal_False,
71cdf0e10cSrcweir 				sal_Bool		_aSearchable=sal_True,
72cdf0e10cSrcweir 				sal_Bool		_aCurrency=sal_False,
73cdf0e10cSrcweir 				sal_Bool 		_aSigned=sal_False,
74cdf0e10cSrcweir 				sal_Bool		_aReadOnly=sal_True,
75cdf0e10cSrcweir 				sal_Bool		_aWritable=sal_False,
76cdf0e10cSrcweir 				sal_Bool		_aDefinitelyWritable=sal_False,
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 				const ::rtl::OUString &_aColumnLabel = ::rtl::OUString(),
79cdf0e10cSrcweir 				const ::rtl::OUString &_aColumnTypeName = ::rtl::OUString(),
80cdf0e10cSrcweir 				const ::rtl::OUString &_aColumnServiceName = ::rtl::OUString())
81cdf0e10cSrcweir 		:	m_TableName(_aTableName),
82cdf0e10cSrcweir 			m_ColumnName(_aColumnName),
83cdf0e10cSrcweir 			m_ColumnLabel(_aColumnLabel),
84cdf0e10cSrcweir 			m_ColumnTypeName(_aColumnTypeName),
85cdf0e10cSrcweir 			m_ColumnServiceName(_aColumnServiceName),
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 			m_Nullable(_aNullable),
88cdf0e10cSrcweir 			m_ColumnDisplaySize(_aColumnDisplaySize),
89cdf0e10cSrcweir 			m_Precision(_aPrecision),
90cdf0e10cSrcweir 			m_Scale(_aScale),
91cdf0e10cSrcweir 			m_ColumnType(_aColumnType),
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 			m_AutoIncrement(_aAutoIncrement),
94cdf0e10cSrcweir 			m_CaseSensitive(_aCaseSensitive),
95cdf0e10cSrcweir 			m_Searchable(_aSearchable),
96cdf0e10cSrcweir 			m_Currency(_aCurrency),
97cdf0e10cSrcweir 			m_Signed(_aSigned),
98cdf0e10cSrcweir 			m_ReadOnly(_aReadOnly),
99cdf0e10cSrcweir 			m_Writable(_aWritable),
100cdf0e10cSrcweir 			m_DefinitelyWritable(_aDefinitelyWritable)
101cdf0e10cSrcweir 		{
102cdf0e10cSrcweir 			if(!m_ColumnLabel.getLength())
103cdf0e10cSrcweir 				m_ColumnLabel = _aColumnName;
104cdf0e10cSrcweir 		}
105cdf0e10cSrcweir 
operator new(size_t nSize)106cdf0e10cSrcweir 		inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () )
107cdf0e10cSrcweir 			{ return ::rtl_allocateMemory( nSize ); }
operator new(size_t,void * _pHint)108cdf0e10cSrcweir 		inline static void * SAL_CALL operator new( size_t ,void* _pHint ) SAL_THROW( () )
109cdf0e10cSrcweir 			{ return _pHint; }
operator delete(void * pMem)110cdf0e10cSrcweir 		inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () )
111cdf0e10cSrcweir 			{ ::rtl_freeMemory( pMem ); }
operator delete(void *,void *)112cdf0e10cSrcweir 		inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () )
113cdf0e10cSrcweir 			{  }
114cdf0e10cSrcweir 
isAutoIncrement() const115cdf0e10cSrcweir 		sal_Bool isAutoIncrement()				const { return m_AutoIncrement; }
isCaseSensitive() const116cdf0e10cSrcweir 		sal_Bool isCaseSensitive()				const { return m_CaseSensitive; }
isSearchable() const117cdf0e10cSrcweir 		sal_Bool isSearchable()					const { return m_Searchable; }
isCurrency() const118cdf0e10cSrcweir 		sal_Bool isCurrency()					const { return m_Currency; }
isSigned() const119cdf0e10cSrcweir 		sal_Bool isSigned()						const { return m_Signed; }
isReadOnly() const120cdf0e10cSrcweir 		sal_Bool isReadOnly()					const { return m_ReadOnly; }
isWritable() const121cdf0e10cSrcweir 		sal_Bool isWritable()					const { return m_Writable; }
isDefinitelyWritable() const122cdf0e10cSrcweir 		sal_Bool isDefinitelyWritable()			const { return m_DefinitelyWritable; }
123cdf0e10cSrcweir 
isNullable() const124cdf0e10cSrcweir 		sal_Int32 isNullable()					const { return m_Nullable; }
getColumnDisplaySize() const125cdf0e10cSrcweir 		sal_Int32 getColumnDisplaySize()		const { return m_ColumnDisplaySize; }
getPrecision() const126cdf0e10cSrcweir 		sal_Int32 getPrecision()				const { return m_Precision; }
getScale() const127cdf0e10cSrcweir 		sal_Int32 getScale()					const { return m_Scale; }
getColumnType() const128cdf0e10cSrcweir 		sal_Int32 getColumnType()				const { return m_ColumnType; }
129cdf0e10cSrcweir 
getColumnLabel() const130cdf0e10cSrcweir 		const ::rtl::OUString& getColumnLabel()			const { return m_ColumnLabel; }
getColumnName() const131cdf0e10cSrcweir 		const ::rtl::OUString& getColumnName()			const { return m_ColumnName; }
getSchemaName() const132cdf0e10cSrcweir 		const ::rtl::OUString& getSchemaName()			const { return m_SchemaName; }
getTableName() const133cdf0e10cSrcweir 		const ::rtl::OUString& getTableName()			const { return m_TableName; }
getCatalogName() const134cdf0e10cSrcweir 		const ::rtl::OUString& getCatalogName()			const { return m_CatalogName; }
getColumnTypeName() const135cdf0e10cSrcweir 		const ::rtl::OUString& getColumnTypeName()		const { return m_ColumnTypeName; }
getColumnServiceName() const136cdf0e10cSrcweir 		const ::rtl::OUString& getColumnServiceName()	const { return m_ColumnServiceName; }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 	};
139cdf0e10cSrcweir }
140cdf0e10cSrcweir 
141cdf0e10cSrcweir #endif //_CONNECTIVITY_COLUMN_HXX_
142cdf0e10cSrcweir 
143