1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef _CONNECTIVITY_COLUMN_HXX_ 29*cdf0e10cSrcweir #define _CONNECTIVITY_COLUMN_HXX_ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <rtl/ustring.hxx> 32*cdf0e10cSrcweir #include <sal/types.h> 33*cdf0e10cSrcweir #include "connectivity/dbtoolsdllapi.hxx" 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir namespace connectivity 36*cdf0e10cSrcweir { 37*cdf0e10cSrcweir class OOO_DLLPUBLIC_DBTOOLS OColumn 38*cdf0e10cSrcweir { 39*cdf0e10cSrcweir ::rtl::OUString m_CatalogName; 40*cdf0e10cSrcweir ::rtl::OUString m_SchemaName; 41*cdf0e10cSrcweir ::rtl::OUString m_TableName; 42*cdf0e10cSrcweir ::rtl::OUString m_ColumnName; 43*cdf0e10cSrcweir ::rtl::OUString m_ColumnLabel; 44*cdf0e10cSrcweir ::rtl::OUString m_ColumnTypeName; 45*cdf0e10cSrcweir ::rtl::OUString m_ColumnServiceName; 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir sal_Int32 m_Nullable; 48*cdf0e10cSrcweir sal_Int32 m_ColumnDisplaySize; 49*cdf0e10cSrcweir sal_Int32 m_Precision; 50*cdf0e10cSrcweir sal_Int32 m_Scale; 51*cdf0e10cSrcweir sal_Int32 m_ColumnType; 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir sal_Bool m_AutoIncrement; 54*cdf0e10cSrcweir sal_Bool m_CaseSensitive; 55*cdf0e10cSrcweir sal_Bool m_Searchable; 56*cdf0e10cSrcweir sal_Bool m_Currency; 57*cdf0e10cSrcweir sal_Bool m_Signed; 58*cdf0e10cSrcweir sal_Bool m_ReadOnly; 59*cdf0e10cSrcweir sal_Bool m_Writable; 60*cdf0e10cSrcweir sal_Bool m_DefinitelyWritable; 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir public: 63*cdf0e10cSrcweir OColumn() {} 64*cdf0e10cSrcweir OColumn(const ::rtl::OUString &_aTableName, 65*cdf0e10cSrcweir const ::rtl::OUString &_aColumnName, 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir sal_Int32 _aNullable=0, 68*cdf0e10cSrcweir sal_Int32 _aColumnDisplaySize=0, 69*cdf0e10cSrcweir sal_Int32 _aPrecision=0, 70*cdf0e10cSrcweir sal_Int32 _aScale=0, 71*cdf0e10cSrcweir sal_Int32 _aColumnType=0, 72*cdf0e10cSrcweir 73*cdf0e10cSrcweir sal_Bool _aAutoIncrement=sal_False, 74*cdf0e10cSrcweir sal_Bool _aCaseSensitive=sal_False, 75*cdf0e10cSrcweir sal_Bool _aSearchable=sal_True, 76*cdf0e10cSrcweir sal_Bool _aCurrency=sal_False, 77*cdf0e10cSrcweir sal_Bool _aSigned=sal_False, 78*cdf0e10cSrcweir sal_Bool _aReadOnly=sal_True, 79*cdf0e10cSrcweir sal_Bool _aWritable=sal_False, 80*cdf0e10cSrcweir sal_Bool _aDefinitelyWritable=sal_False, 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir const ::rtl::OUString &_aColumnLabel = ::rtl::OUString(), 83*cdf0e10cSrcweir const ::rtl::OUString &_aColumnTypeName = ::rtl::OUString(), 84*cdf0e10cSrcweir const ::rtl::OUString &_aColumnServiceName = ::rtl::OUString()) 85*cdf0e10cSrcweir : m_TableName(_aTableName), 86*cdf0e10cSrcweir m_ColumnName(_aColumnName), 87*cdf0e10cSrcweir m_ColumnLabel(_aColumnLabel), 88*cdf0e10cSrcweir m_ColumnTypeName(_aColumnTypeName), 89*cdf0e10cSrcweir m_ColumnServiceName(_aColumnServiceName), 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir m_Nullable(_aNullable), 92*cdf0e10cSrcweir m_ColumnDisplaySize(_aColumnDisplaySize), 93*cdf0e10cSrcweir m_Precision(_aPrecision), 94*cdf0e10cSrcweir m_Scale(_aScale), 95*cdf0e10cSrcweir m_ColumnType(_aColumnType), 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir m_AutoIncrement(_aAutoIncrement), 98*cdf0e10cSrcweir m_CaseSensitive(_aCaseSensitive), 99*cdf0e10cSrcweir m_Searchable(_aSearchable), 100*cdf0e10cSrcweir m_Currency(_aCurrency), 101*cdf0e10cSrcweir m_Signed(_aSigned), 102*cdf0e10cSrcweir m_ReadOnly(_aReadOnly), 103*cdf0e10cSrcweir m_Writable(_aWritable), 104*cdf0e10cSrcweir m_DefinitelyWritable(_aDefinitelyWritable) 105*cdf0e10cSrcweir { 106*cdf0e10cSrcweir if(!m_ColumnLabel.getLength()) 107*cdf0e10cSrcweir m_ColumnLabel = _aColumnName; 108*cdf0e10cSrcweir } 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW( () ) 111*cdf0e10cSrcweir { return ::rtl_allocateMemory( nSize ); } 112*cdf0e10cSrcweir inline static void * SAL_CALL operator new( size_t ,void* _pHint ) SAL_THROW( () ) 113*cdf0e10cSrcweir { return _pHint; } 114*cdf0e10cSrcweir inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW( () ) 115*cdf0e10cSrcweir { ::rtl_freeMemory( pMem ); } 116*cdf0e10cSrcweir inline static void SAL_CALL operator delete( void *,void* ) SAL_THROW( () ) 117*cdf0e10cSrcweir { } 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir sal_Bool isAutoIncrement() const { return m_AutoIncrement; } 120*cdf0e10cSrcweir sal_Bool isCaseSensitive() const { return m_CaseSensitive; } 121*cdf0e10cSrcweir sal_Bool isSearchable() const { return m_Searchable; } 122*cdf0e10cSrcweir sal_Bool isCurrency() const { return m_Currency; } 123*cdf0e10cSrcweir sal_Bool isSigned() const { return m_Signed; } 124*cdf0e10cSrcweir sal_Bool isReadOnly() const { return m_ReadOnly; } 125*cdf0e10cSrcweir sal_Bool isWritable() const { return m_Writable; } 126*cdf0e10cSrcweir sal_Bool isDefinitelyWritable() const { return m_DefinitelyWritable; } 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir sal_Int32 isNullable() const { return m_Nullable; } 129*cdf0e10cSrcweir sal_Int32 getColumnDisplaySize() const { return m_ColumnDisplaySize; } 130*cdf0e10cSrcweir sal_Int32 getPrecision() const { return m_Precision; } 131*cdf0e10cSrcweir sal_Int32 getScale() const { return m_Scale; } 132*cdf0e10cSrcweir sal_Int32 getColumnType() const { return m_ColumnType; } 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir const ::rtl::OUString& getColumnLabel() const { return m_ColumnLabel; } 135*cdf0e10cSrcweir const ::rtl::OUString& getColumnName() const { return m_ColumnName; } 136*cdf0e10cSrcweir const ::rtl::OUString& getSchemaName() const { return m_SchemaName; } 137*cdf0e10cSrcweir const ::rtl::OUString& getTableName() const { return m_TableName; } 138*cdf0e10cSrcweir const ::rtl::OUString& getCatalogName() const { return m_CatalogName; } 139*cdf0e10cSrcweir const ::rtl::OUString& getColumnTypeName() const { return m_ColumnTypeName; } 140*cdf0e10cSrcweir const ::rtl::OUString& getColumnServiceName() const { return m_ColumnServiceName; } 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir }; 143*cdf0e10cSrcweir } 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir #endif //_CONNECTIVITY_COLUMN_HXX_ 146*cdf0e10cSrcweir 147