kexi

kexidbschema.h

00001 /***************************************************************************
00002  * kexidbschema.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_KEXIDBSCHEMA_H
00021 #define KROSS_KEXIDB_KEXIDBSCHEMA_H
00022 
00023 #include <qstring.h>
00024 
00025 #include <api/object.h>
00026 #include <api/class.h>
00027 
00028 #include <kexidb/drivermanager.h>
00029 #include <kexidb/schemadata.h>
00030 #include <kexidb/tableschema.h>
00031 #include <kexidb/queryschema.h>
00032 
00033 namespace Kross { namespace KexiDB {
00034 
00040     template<class T>
00041     class KexiDBSchema : public Kross::Api::Class<T>
00042     {
00043         public:
00044             KexiDBSchema(const QString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist);
00045             virtual ~KexiDBSchema();
00046 
00047         protected:
00048             ::KexiDB::SchemaData* m_schema;
00049             ::KexiDB::FieldList* m_fieldlist;
00050 
00051         private:
00053             Kross::Api::Object::Ptr name(Kross::Api::List::Ptr);
00055             Kross::Api::Object::Ptr setName(Kross::Api::List::Ptr);
00056 
00058             Kross::Api::Object::Ptr caption(Kross::Api::List::Ptr);
00060             Kross::Api::Object::Ptr setCaption(Kross::Api::List::Ptr);
00061 
00063             Kross::Api::Object::Ptr description(Kross::Api::List::Ptr);
00065             Kross::Api::Object::Ptr setDescription(Kross::Api::List::Ptr);
00066 
00068             Kross::Api::Object::Ptr fieldlist(Kross::Api::List::Ptr);
00069     };
00070 
00075     class KexiDBTableSchema : public KexiDBSchema<KexiDBTableSchema>
00076     {
00077         public:
00078             KexiDBTableSchema(::KexiDB::TableSchema* tableschema);
00079             virtual ~KexiDBTableSchema();
00080             virtual const QString getClassName() const;
00081             ::KexiDB::TableSchema* tableschema();
00082 
00083         private:
00086             Kross::Api::Object::Ptr query(Kross::Api::List::Ptr);
00087     };
00088 
00093     class KexiDBQuerySchema : public KexiDBSchema<KexiDBQuerySchema>
00094     {
00095         public:
00096             KexiDBQuerySchema(::KexiDB::QuerySchema* queryschema);
00097             virtual ~KexiDBQuerySchema();
00098             virtual const QString getClassName() const;
00099             ::KexiDB::QuerySchema* queryschema();
00100 
00101         private:
00103             Kross::Api::Object::Ptr statement(Kross::Api::List::Ptr);
00105             Kross::Api::Object::Ptr setStatement(Kross::Api::List::Ptr);
00106 
00107             Kross::Api::Object::Ptr setWhereExpression(Kross::Api::List::Ptr);
00108     };
00109 
00110 }}
00111 
00112 #endif
00113 
KDE Home | KDE Accessibility Home | Description of Access Keys