kexi
tableschema.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEXIDB_TABLE_H
00022 #define KEXIDB_TABLE_H
00023
00024 #include <qvaluelist.h>
00025 #include <qptrlist.h>
00026 #include <qstring.h>
00027 #include <qguardedptr.h>
00028
00029 #include <kexidb/fieldlist.h>
00030 #include <kexidb/schemadata.h>
00031 #include <kexidb/indexschema.h>
00032 #include <kexidb/relationship.h>
00033
00034 namespace KexiDB {
00035
00036 class Connection;
00037
00042 class KEXI_DB_EXPORT TableSchema : public FieldList, public SchemaData
00043 {
00044 public:
00045 typedef QPtrList<TableSchema> List;
00046 typedef QPtrListIterator<TableSchema> ListIterator;
00047
00048 TableSchema(const QString & name);
00049 TableSchema(const SchemaData& sdata);
00050 TableSchema();
00051
00053 TableSchema(const TableSchema& ts);
00054
00055 virtual ~TableSchema();
00056
00059 virtual FieldList& insertField(uint index, Field *field);
00060
00062 virtual void removeField(KexiDB::Field *field);
00063
00068 IndexSchema* primaryKey() const { return m_pkey; }
00069
00080 void setPrimaryKey(IndexSchema *pkey);
00081
00082 const IndexSchema::ListIterator indicesIterator() const
00083 { return IndexSchema::ListIterator(m_indices); }
00084
00085 const IndexSchema::List* indices() { return &m_indices; }
00086
00089 virtual void clear();
00090
00092 virtual QString debugString();
00093
00096 Connection* connection() const { return m_conn; }
00097
00112 bool isKexiDBSystem() const { return m_isKexiDBSystem; }
00113
00117 void setKexiDBSystem(bool set);
00118
00121 virtual bool isNative() const { return m_native || m_isKexiDBSystem; }
00122
00123
00124 virtual void setNative(bool set);
00125
00130 QuerySchema* query();
00131
00134 Field* anyNonPKField();
00135
00136 protected:
00138 TableSchema(Connection *conn, const QString & name = QString::null);
00139
00140 void init();
00141
00142 IndexSchema::List m_indices;
00143
00144 QGuardedPtr<Connection> m_conn;
00145
00146 IndexSchema *m_pkey;
00147
00148 QuerySchema *m_query;
00149
00150 class Private;
00151 Private *d;
00152
00153 private:
00154 bool m_isKexiDBSystem : 1;
00155
00156 friend class Connection;
00157 };
00158
00163 class KEXI_DB_EXPORT InternalTableSchema : public TableSchema
00164 {
00165 public:
00166 InternalTableSchema(const QString& name);
00167 virtual ~InternalTableSchema();
00168 };
00169
00170 }
00171
00172 #endif
|