kexi

kexidbfield.h

00001 /***************************************************************************
00002  * kexidbfield.h
00003  * This file is part of the KDE project
00004  * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #ifndef KROSS_KEXIDB_KEXIDBFIELD_H
00021 #define KROSS_KEXIDB_KEXIDBFIELD_H
00022 
00023 #include <qstring.h>
00024 
00025 #include <api/object.h>
00026 #include <api/list.h>
00027 #include <api/class.h>
00028 
00029 #include <kexidb/drivermanager.h>
00030 #include <kexidb/field.h>
00031 
00032 namespace Kross { namespace KexiDB {
00033 
00037     class KexiDBField : public Kross::Api::Class<KexiDBField>
00038     {
00039         public:
00040             KexiDBField(::KexiDB::Field* field);
00041             virtual ~KexiDBField();
00042             virtual const QString getClassName() const;
00043             ::KexiDB::Field* field() { return m_field; }
00044 
00045         private:
00046 
00048             const QString type();
00050             void setType(const QString type);
00051 
00055             const QString subType();
00057             void setSubType(const QString& subtype);
00058 
00060             const QString variantType();
00062             const QString typeGroup();
00063 
00065             bool isAutoInc();
00067             void setAutoInc(bool autoinc);
00068 
00070             bool isUniqueKey();
00072             void setUniqueKey(bool unique);
00073 
00075             bool isPrimaryKey();
00077             void setPrimaryKey(bool primary);
00078 
00080             bool isForeignKey();
00082             void setForeignKey(bool foreign);
00083 
00085             bool isNotNull();
00087             void setNotNull(bool notnull);
00088 
00090             bool isNotEmpty();
00092             void setNotEmpty(bool notempty);
00093 
00095             bool isIndexed();
00097             void setIndexed(bool indexed);
00098 
00100             bool isUnsigned();
00102             void setUnsigned(bool isunsigned);
00103 
00105             const QString name();
00107             void setName(const QString& name);
00108 
00110             const QString caption();
00112             void setCaption(const QString& caption);
00113 
00115             const QString description();
00117             void setDescription(const QString& desc);
00118 
00120             uint length();
00122             void setLength(uint length);
00123 
00126             uint precision();
00128             void setPrecision(uint precision);
00129 
00132             uint width();
00134             void setWidth(uint width);
00135 
00137             QVariant defaultValue();
00139             void setDefaultValue(const QVariant& defaultvalue);
00140 
00141         private:
00142             ::KexiDB::Field* m_field;
00143     };
00144 
00145 }}
00146 
00147 #endif
00148 
KDE Home | KDE Accessibility Home | Description of Access Keys