Update git submodules
[LibreOffice.git] / connectivity / source / inc / OColumn.hxx
blob2131b3e15254eea79f32dd6d1acfeb2aa6bf2347
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <rtl/ustring.hxx>
23 #include <sal/types.h>
24 #include <connectivity/dbtoolsdllapi.hxx>
25 #include <utility>
27 namespace connectivity
29 class OOO_DLLPUBLIC_DBTOOLS OColumn
31 OUString m_TableName;
32 OUString m_ColumnName;
33 OUString m_ColumnLabel;
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;
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;
50 public:
51 OColumn()
52 : m_Nullable(0)
53 , m_ColumnDisplaySize(0)
54 , m_Precision(0)
55 , m_Scale(0)
56 , m_ColumnType(0)
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)
68 OColumn(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(std::move(_aTableName)),
76 m_ColumnName(_aColumnName),
77 m_ColumnLabel(),
79 m_Nullable(_aNullable),
80 m_ColumnDisplaySize(_aColumnDisplaySize),
81 m_Precision(_aPrecision),
82 m_Scale(_aScale),
83 m_ColumnType(_aColumnType),
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)
94 if(m_ColumnLabel.isEmpty())
95 m_ColumnLabel = _aColumnName;
98 bool isAutoIncrement() const { return m_AutoIncrement; }
99 bool isCaseSensitive() const { return m_CaseSensitive; }
100 bool isSearchable() const { return m_Searchable; }
101 bool isCurrency() const { return m_Currency; }
102 bool isSigned() const { return m_Signed; }
103 bool isReadOnly() const { return m_ReadOnly; }
104 bool isWritable() const { return m_Writable; }
105 bool isDefinitelyWritable() const { return m_DefinitelyWritable; }
107 sal_Int32 isNullable() const { return m_Nullable; }
108 sal_Int32 getColumnDisplaySize() const { return m_ColumnDisplaySize; }
109 sal_Int32 getPrecision() const { return m_Precision; }
110 sal_Int32 getScale() const { return m_Scale; }
111 sal_Int32 getColumnType() const { return m_ColumnType; }
113 const OUString& getColumnLabel() const { return m_ColumnLabel; }
114 const OUString& getColumnName() const { return m_ColumnName; }
115 const OUString& getTableName() const { return m_TableName; }
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */