kexidbschema.h
Go to the documentation of this file.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 00035 // Forward-declarations. 00036 class KexiDBFieldList; 00037 class KexiDBQuerySchema; 00038 00058 template<class T> 00059 class KexiDBSchema : public Kross::Api::Class<T> 00060 { 00061 public: 00062 KexiDBSchema(const QString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist); 00063 virtual ~KexiDBSchema(); 00064 00065 private: 00066 00068 const QString name() const; 00070 void setName(const QString& name); 00071 00073 const QString caption() const; 00075 void setCaption(const QString& caption); 00076 00078 const QString description() const; 00080 void setDescription(const QString& description); 00081 00083 KexiDBFieldList* fieldlist() const; 00084 00085 protected: 00086 ::KexiDB::SchemaData* m_schema; 00087 ::KexiDB::FieldList* m_fieldlist; 00088 }; 00089 00093 class KexiDBTableSchema : public KexiDBSchema<KexiDBTableSchema> 00094 { 00095 public: 00096 KexiDBTableSchema(::KexiDB::TableSchema* tableschema); 00097 virtual ~KexiDBTableSchema(); 00098 virtual const QString getClassName() const; 00099 ::KexiDB::TableSchema* tableschema(); 00100 00101 private: 00102 00105 KexiDBQuerySchema* query(); 00106 00107 }; 00108 00112 class KexiDBQuerySchema : public KexiDBSchema<KexiDBQuerySchema> 00113 { 00114 public: 00115 KexiDBQuerySchema(::KexiDB::QuerySchema* queryschema); 00116 virtual ~KexiDBQuerySchema(); 00117 virtual const QString getClassName() const; 00118 ::KexiDB::QuerySchema* queryschema(); 00119 00120 private: 00121 00123 const QString statement() const; 00125 void setStatement(const QString& statement); 00127 bool setWhereExpression(const QString& whereexpression); 00128 00129 }; 00130 00131 }} 00132 00133 #endif 00134
