kexi

kexiquerypart.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
00003    Copyright (C) 2004,2006 Jaroslaw Staniek <js@iidea.pl>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
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 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this program; see the file COPYING.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KEXIQUERYPART_H
00022 #define KEXIQUERYPART_H
00023 
00024 #include <qmap.h>
00025 
00026 #include <kexidialogbase.h>
00027 #include <kexipart.h>
00028 #include <kexipartitem.h>
00029 //#include <kexipartdatasource.h>
00030 
00031 #include <kexidb/queryschema.h>
00032 #include <kexidb/connection.h>
00033 
00034 class KexiMainWin;
00035 namespace KexiDB
00036 {
00037     class QuerySchema;
00038     class Connection;
00039 }
00040 
00041 class KexiProject;
00042 
00044 class KexiQueryPart : public KexiPart::Part
00045 {
00046     Q_OBJECT
00047 
00048     public:
00049         KexiQueryPart(QObject *parent, const char *name, const QStringList &);
00050         virtual ~KexiQueryPart();
00051 
00052         virtual bool remove(KexiMainWindow *win, KexiPart::Item &item);
00053 
00055         class TempData : public KexiDialogTempData, 
00056                          public KexiDB::Connection::TableSchemaChangeListenerInterface
00057         {
00058             public:
00059                 TempData(KexiDialogBase* parent, KexiDB::Connection *conn);
00060                 virtual ~TempData();
00061                 virtual tristate closeListener();
00062                 void clearQuery();
00063                 void unregisterForTablesSchemaChanges();
00064                 void registerTableSchemaChanges(KexiDB::QuerySchema *q);
00065 
00072                 void setQuery(KexiDB::QuerySchema *query);
00073 
00075                 KexiDB::QuerySchema *query() const { return m_query; }
00076 
00079                 KexiDB::QuerySchema *takeQuery();
00080 
00082                 KexiDB::Connection *conn;
00083 
00088                 bool queryChangedInPreviousView : 1;
00089 
00090             protected:
00091                 KexiDB::QuerySchema *m_query;
00092         };
00093 
00094         virtual QString i18nMessage(const QCString& englishMessage, 
00095             KexiDialogBase* dlg) const;
00096 
00099         virtual tristate rename(KexiMainWindow * win, KexiPart::Item & item, const QString& newName);
00100 
00101     protected:
00102         virtual KexiDialogTempData* createTempData(KexiDialogBase* dialog);
00103 
00104         virtual KexiViewBase* createView(QWidget *parent, KexiDialogBase* dialog, 
00105             KexiPart::Item &item, int viewMode = Kexi::DataViewMode, QMap<QString,QString>* staticObjectArgs = 0);
00106 
00107 //      virtual void initPartActions( KActionCollection *col );
00108 //      virtual void initInstanceActions( int mode, KActionCollection *col );
00109 
00110         virtual void initPartActions();
00111         virtual void initInstanceActions();
00112 
00113         virtual KexiDB::SchemaData* loadSchemaData(KexiDialogBase *dlg, 
00114             const KexiDB::SchemaData& sdata, int viewMode);
00115 };
00116 
00117 #endif
00118 
KDE Home | KDE Accessibility Home | Description of Access Keys