kexidbfield.h
1/***************************************************************************
2 * kexidbfield.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
5 *
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 ***************************************************************************/
19
20#ifndef KROSS_KEXIDB_KEXIDBFIELD_H
21#define KROSS_KEXIDB_KEXIDBFIELD_H
22
23#include <tqstring.h>
24
25#include <api/object.h>
26#include <api/list.h>
27#include <api/class.h>
28
29#include <kexidb/drivermanager.h>
30#include <kexidb/field.h>
31
32namespace Kross { namespace KexiDB {
33
37 class KexiDBField : public Kross::Api::Class<KexiDBField>
38 {
39 public:
41 virtual ~KexiDBField();
42 virtual const TQString getClassName() const;
43 ::KexiDB::Field* field() { return m_field; }
44
45 private:
46
48 const TQString type();
50 void setType(const TQString type);
51
55 const TQString subType();
57 void setSubType(const TQString& subtype);
58
60 const TQString variantType();
62 const TQString typeGroup();
63
65 bool isAutoInc();
67 void setAutoInc(bool autoinc);
68
70 bool isUniqueKey();
72 void setUniqueKey(bool unique);
73
75 bool isPrimaryKey();
77 void setPrimaryKey(bool primary);
78
80 bool isForeignKey();
82 void setForeignKey(bool foreign);
83
85 bool isNotNull();
87 void setNotNull(bool notnull);
88
90 bool isNotEmpty();
92 void setNotEmpty(bool notempty);
93
95 bool isIndexed();
97 void setIndexed(bool indexed);
98
100 bool isUnsigned();
102 void setUnsigned(bool isunsigned);
103
105 const TQString name();
107 void setName(const TQString& name);
108
110 const TQString caption();
112 void setCaption(const TQString& caption);
113
115 const TQString description();
117 void setDescription(const TQString& desc);
118
120 uint length();
122 void setLength(uint length);
123
126 uint precision();
128 void setPrecision(uint precision);
129
132 uint width();
134 void setWidth(uint width);
135
137 TQVariant defaultValue();
139 void setDefaultValue(const TQVariant& defaultvalue);
140
141 private:
142 ::KexiDB::Field* m_field;
143 };
144
145}}
146
147#endif
148
Meta-data for a field.
Definition field.h:73
A field in a record.
Definition kexidbfield.h:38
High-level database connectivity library with database backend drivers.