kexi

kexidbschema.h
1/***************************************************************************
2 * kexidbschema.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_KEXIDBSCHEMA_H
21#define KROSS_KEXIDB_KEXIDBSCHEMA_H
22
23#include <tqstring.h>
24
25#include <api/object.h>
26#include <api/class.h>
27
28#include <kexidb/drivermanager.h>
29#include <kexidb/schemadata.h>
30#include <kexidb/tableschema.h>
31#include <kexidb/queryschema.h>
32
33namespace Kross { namespace KexiDB {
34
35 // Forward-declarations.
36 class KexiDBFieldList;
38
58 template<class T>
59 class KexiDBSchema : public Kross::Api::Class<T>
60 {
61 public:
62 KexiDBSchema(const TQString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist);
63 virtual ~KexiDBSchema();
64
65 private:
66
68 const TQString name() const;
70 void setName(const TQString& name);
71
73 const TQString caption() const;
75 void setCaption(const TQString& caption);
76
78 const TQString description() const;
80 void setDescription(const TQString& description);
81
83 KexiDBFieldList* fieldlist() const;
84
85 protected:
86 ::KexiDB::SchemaData* m_schema;
87 ::KexiDB::FieldList* m_fieldlist;
88 };
89
93 class KexiDBTableSchema : public KexiDBSchema<KexiDBTableSchema>
94 {
95 public:
96 KexiDBTableSchema(::KexiDB::TableSchema* tableschema);
97 virtual ~KexiDBTableSchema();
98 virtual const TQString getClassName() const;
99 ::KexiDB::TableSchema* tableschema();
100
101 private:
102
105 KexiDBQuerySchema* query();
106
107 };
108
112 class KexiDBQuerySchema : public KexiDBSchema<KexiDBQuerySchema>
113 {
114 public:
115 KexiDBQuerySchema(::KexiDB::QuerySchema* queryschema);
116 virtual ~KexiDBQuerySchema();
117 virtual const TQString getClassName() const;
118 ::KexiDB::QuerySchema* queryschema();
119
120 private:
121
123 const TQString statement() const;
125 void setStatement(const TQString& statement);
127 bool setWhereExpression(const TQString& whereexpression);
128
129 };
130
131}}
132
133#endif
134
KexiDB::QuerySchema provides information about database query.
The KexiDBTableSchema object implements a KexiDBSchema for queries.
KrossKexiDB provides access to the KexiDB database functionality.