kexi

kexitablepart.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
00003    Copyright (C) 2002, 2003 Joseph Wenninger <jowenn@kde.org>
00004    Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
00005 
00006    This library 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 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KEXITABLEPART_H
00023 #define KEXITABLEPART_H
00024 
00025 #include <kexi.h>
00026 #include <kexipart.h>
00027 #include <kexidialogbase.h>
00028 //#include <kexipartdatasource.h>
00029 #include <kexipartitem.h>
00030 #include <kexidb/fieldlist.h>
00031 
00032 class KexiMainWin;
00033 class KexiLookupColumnPage;
00034 
00035 class KexiTablePart : public KexiPart::Part
00036 {
00037     Q_OBJECT
00038 
00039     public:
00040         KexiTablePart(QObject *parent, const char *name, const QStringList &);
00041         virtual ~KexiTablePart();
00042 
00043         virtual bool remove(KexiMainWindow *win, KexiPart::Item &item);
00044 
00045         virtual tristate rename(KexiMainWindow *win, KexiPart::Item &item, 
00046             const QString& newName);
00047 
00048 //      virtual KexiPart::DataSource *dataSource();
00049 
00050         class TempData : public KexiDialogTempData
00051         {
00052             public:
00053                 TempData(QObject* parent);
00054                 KexiDB::TableSchema *table;
00057                 bool tableSchemaChangedInPreviousView : 1;
00058         };
00059 
00060         static tristate askForClosingObjectsUsingTableSchema(
00061             QWidget *parent, KexiDB::Connection& conn, 
00062             KexiDB::TableSchema& table, const QString& msg);
00063 
00064         virtual QString i18nMessage(const QCString& englishMessage, 
00065             KexiDialogBase* dlg) const;
00066 
00067         KexiLookupColumnPage* lookupColumnPage() const;
00068 
00069     protected:
00070         virtual KexiDialogTempData* createTempData(KexiDialogBase* dialog);
00071 
00072         virtual KexiViewBase* createView(QWidget *parent, KexiDialogBase* dialog, 
00073             KexiPart::Item &item, int viewMode = Kexi::DataViewMode, QMap<QString,QString>* staticObjectArgs = 0);
00074 
00075         virtual void initPartActions();
00076         virtual void initInstanceActions();
00077 
00078         virtual void setupCustomPropertyPanelTabs(KTabWidget *tab, KexiMainWindow* mainWin);
00079 
00080         virtual KexiDB::SchemaData* loadSchemaData(KexiDialogBase *dlg, const KexiDB::SchemaData& sdata, int viewMode);
00081 
00082     private:
00083         class Private;
00084         Private* d;
00085 };
00086 
00087 #if 0
00088 class KexiTableDataSource : public KexiPart::DataSource
00089 {
00090     public:
00091         KexiTableDataSource(KexiPart::Part *part);
00092         ~KexiTableDataSource();
00093 
00094         virtual KexiDB::FieldList *fields(KexiProject *project, const KexiPart::Item &item);
00095         virtual KexiDB::Cursor *cursor(KexiProject *project, const KexiPart::Item &item, bool buffer);
00096 };
00097 #endif
00098 
00099 #endif
00100 
KDE Home | KDE Accessibility Home | Description of Access Keys