1
/***************************************************************************
3
* This file is part of the KDE project
4
* copyright (C)2004-2006 by Sebastian Sauer (mail@dipe.org)
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Library General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
14
* You should have received a copy of the GNU Library General Public License
15
* along with this program; see the file COPYING. If not, write to
16
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
18
***************************************************************************/
21
#include "kexidbfield.h"
23
using namespace Scripting;
25
KexiDBField::KexiDBField(QObject* parent, KDbField* field, bool owner)
30
setObjectName("KexiDBField");
33
KexiDBField::~KexiDBField()
39
const QString KexiDBField::type()
41
return m_field->typeString();
43
void KexiDBField::setType(const QString type)
45
m_field->setType(KDbField::typeForString(type));
48
const QString KexiDBField::subType()
50
return m_field->subType();
52
void KexiDBField::setSubType(const QString& subtype)
54
m_field->setSubType(subtype);
57
const QString KexiDBField::variantType()
59
return QVariant::typeToName(m_field->variantType());
61
const QString KexiDBField::typeGroup()
63
return m_field->typeGroupString();
66
bool KexiDBField::isAutoInc()
68
return m_field->isAutoIncrement();
70
void KexiDBField::setAutoInc(bool autoinc)
72
m_field->setAutoIncrement(autoinc);
75
bool KexiDBField::isUniqueKey()
77
return m_field->isUniqueKey();
79
void KexiDBField::setUniqueKey(bool unique)
81
m_field->setUniqueKey(unique);
84
bool KexiDBField::isPrimaryKey()
86
return m_field->isPrimaryKey();
88
void KexiDBField::setPrimaryKey(bool primary)
90
m_field->setPrimaryKey(primary);
93
bool KexiDBField::isForeignKey()
95
return m_field->isForeignKey();
97
void KexiDBField::setForeignKey(bool foreign)
99
m_field->setForeignKey(foreign);
102
bool KexiDBField::isNotNull()
104
return m_field->isNotNull();
106
void KexiDBField::setNotNull(bool notnull)
108
m_field->setNotNull(notnull);
111
bool KexiDBField::isNotEmpty()
113
return m_field->isNotEmpty();
115
void KexiDBField::setNotEmpty(bool notempty)
117
m_field->setNotEmpty(notempty);
120
bool KexiDBField::isIndexed()
122
return m_field->isIndexed();
124
void KexiDBField::setIndexed(bool indexed)
126
m_field->setIndexed(indexed);
129
bool KexiDBField::isUnsigned()
131
return m_field->isUnsigned();
133
void KexiDBField::setUnsigned(bool isunsigned)
135
m_field->setUnsigned(isunsigned);
138
const QString KexiDBField::name()
140
return m_field->name();
142
void KexiDBField::setName(const QString& name)
144
m_field->setName(name);
147
const QString KexiDBField::caption()
149
return m_field->caption();
152
void KexiDBField::setCaption(const QString& caption)
154
m_field->setCaption(caption);
157
const QString KexiDBField::description()
159
return m_field->description();
161
void KexiDBField::setDescription(const QString& desc)
163
m_field->setDescription(desc);
166
int KexiDBField::length()
168
return m_field->maxLength();
171
void KexiDBField::setLength(int length)
173
m_field->setMaxLength(length);
176
int KexiDBField::precision()
178
return m_field->precision();
180
void KexiDBField::setPrecision(int precision)
182
m_field->setPrecision(precision);
185
QVariant KexiDBField::defaultValue()
187
return m_field->defaultValue();
189
void KexiDBField::setDefaultValue(const QVariant& defaultvalue)
191
m_field->setDefaultValue(defaultvalue);