1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 5 * This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 11 * Licensed to the Apache Software Foundation (ASF) under one or more 12 * contributor license agreements. See the NOTICE file distributed 13 * with this work for additional information regarding copyright 14 * ownership. The ASF licenses this file to you under the Apache 15 * License, Version 2.0 (the "License"); you may not use this file 16 * except in compliance with the License. You may obtain a copy of 17 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 18 */ 19 20 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_OCOLUMN_HXX 21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_OCOLUMN_HXX 22 23 #include <rtl/ustring.hxx> 24 #include <sal/types.h> 25 #include <connectivity/dbtoolsdllapi.hxx> 26 27 namespace connectivity 28 { 29 class OOO_DLLPUBLIC_DBTOOLS OColumn 30 { 31 OUString m_TableName; 32 OUString m_ColumnName; 33 OUString m_ColumnLabel; 34 35 sal_Int32 m_Nullable; 36 sal_Int32 m_ColumnDisplaySize; 37 sal_Int32 m_Precision; 38 sal_Int32 m_Scale; 39 sal_Int32 m_ColumnType; 40 41 bool m_AutoIncrement; 42 bool m_CaseSensitive; 43 bool m_Searchable; 44 bool m_Currency; 45 bool m_Signed; 46 bool m_ReadOnly; 47 bool m_Writable; 48 bool m_DefinitelyWritable; 49 50 public: OColumn()51 OColumn() 52 : m_Nullable(0) 53 , m_ColumnDisplaySize(0) 54 , m_Precision(0) 55 , m_Scale(0) 56 , m_ColumnType(0) 57 58 , m_AutoIncrement(false) 59 , m_CaseSensitive(false) 60 , m_Searchable(true) 61 , m_Currency(false) 62 , m_Signed(false) 63 , m_ReadOnly(true) 64 , m_Writable(false) 65 , m_DefinitelyWritable(false) 66 {} 67 OColumn(const OUString & _aTableName,const OUString & _aColumnName,sal_Int32 _aNullable,sal_Int32 _aColumnDisplaySize,sal_Int32 _aPrecision,sal_Int32 _aScale,sal_Int32 _aColumnType)68 OColumn(const OUString &_aTableName, 69 const OUString &_aColumnName, 70 sal_Int32 _aNullable, 71 sal_Int32 _aColumnDisplaySize, 72 sal_Int32 _aPrecision, 73 sal_Int32 _aScale, 74 sal_Int32 _aColumnType) 75 : m_TableName(_aTableName), 76 m_ColumnName(_aColumnName), 77 m_ColumnLabel(), 78 79 m_Nullable(_aNullable), 80 m_ColumnDisplaySize(_aColumnDisplaySize), 81 m_Precision(_aPrecision), 82 m_Scale(_aScale), 83 m_ColumnType(_aColumnType), 84 85 m_AutoIncrement(false), 86 m_CaseSensitive(false), 87 m_Searchable(true), 88 m_Currency(false), 89 m_Signed(false), 90 m_ReadOnly(true), 91 m_Writable(false), 92 m_DefinitelyWritable(false) 93 { 94 if(m_ColumnLabel.isEmpty()) 95 m_ColumnLabel = _aColumnName; 96 } 97 isAutoIncrement() const98 bool isAutoIncrement() const { return m_AutoIncrement; } isCaseSensitive() const99 bool isCaseSensitive() const { return m_CaseSensitive; } isSearchable() const100 bool isSearchable() const { return m_Searchable; } isCurrency() const101 bool isCurrency() const { return m_Currency; } isSigned() const102 bool isSigned() const { return m_Signed; } isReadOnly() const103 bool isReadOnly() const { return m_ReadOnly; } isWritable() const104 bool isWritable() const { return m_Writable; } isDefinitelyWritable() const105 bool isDefinitelyWritable() const { return m_DefinitelyWritable; } 106 isNullable() const107 sal_Int32 isNullable() const { return m_Nullable; } getColumnDisplaySize() const108 sal_Int32 getColumnDisplaySize() const { return m_ColumnDisplaySize; } getPrecision() const109 sal_Int32 getPrecision() const { return m_Precision; } getScale() const110 sal_Int32 getScale() const { return m_Scale; } getColumnType() const111 sal_Int32 getColumnType() const { return m_ColumnType; } 112 getColumnLabel() const113 const OUString& getColumnLabel() const { return m_ColumnLabel; } getColumnName() const114 const OUString& getColumnName() const { return m_ColumnName; } getTableName() const115 const OUString& getTableName() const { return m_TableName; } 116 }; 117 } 118 119 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_OCOLUMN_HXX 120 121 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 122