00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEXIINTERNALPART_H
00022 #define KEXIINTERNALPART_H
00023
00024 #include <qobject.h>
00025 #include <qguardedptr.h>
00026 #include <qvariant.h>
00027
00028 class KexiMainWindow;
00029 class KexiDialogBase;
00030 class KexiViewBase;
00031
00032 namespace KexiDB {
00033 class MessageHandler;
00034 }
00035
00036 class QWidget;
00037
00049 class KEXICORE_EXPORT KexiInternalPart : public QObject
00050 {
00051 Q_OBJECT
00052
00053 public:
00054 KexiInternalPart(QObject *parent, const char *name, const QStringList &);
00055 virtual ~KexiInternalPart();
00056
00057 KexiDialogBase *instance(KexiMainWindow *parent);
00058
00067 static QWidget* createWidgetInstance(const char* partName, const char* widgetClass,
00068 KexiDB::MessageHandler *msgHdr, KexiMainWindow* mainWin,
00069 QWidget *parent, const char *objName = 0, QMap<QString,QString>* args = 0);
00070
00072 static QWidget* createWidgetInstance(const char* partName,
00073 KexiDB::MessageHandler *msgHdr, KexiMainWindow* mainWin,
00074 QWidget *parent, const char *objName = 0, QMap<QString,QString>* args = 0)
00075 { return createWidgetInstance(partName, 0, msgHdr, mainWin, parent, objName, args); }
00076
00084 static KexiDialogBase* createKexiDialogInstance(const char* partName,
00085 KexiDB::MessageHandler *msgHdr, KexiMainWindow* mainWin, const char *objName = 0);
00086
00100 static QDialog* createModalDialogInstance(const char* partName,
00101 const char* dialogClass, KexiDB::MessageHandler *msgHdr, KexiMainWindow* mainWin,
00102 const char *objName = 0, QMap<QString,QString>* args = 0);
00103
00105 static QDialog* createModalDialogInstance(const char* partName,
00106 KexiDB::MessageHandler *msgHdr, KexiMainWindow* mainWin, const char *objName = 0,
00107 QMap<QString,QString>* args = 0)
00108 { return createModalDialogInstance(partName, 0, msgHdr, mainWin, objName, args); }
00109
00111 static const KexiInternalPart* part(KexiDB::MessageHandler *msgHdr, const char* partName);
00112
00114 inline bool uniqueDialog() const { return m_uniqueDialog; }
00115
00119 inline bool cancelled() const { return m_cancelled; }
00120
00121 protected:
00123 KexiDialogBase *findOrCreateKexiDialog(KexiMainWindow* mainWin,
00124 const char *objName);
00125
00128 virtual QWidget *createWidget(const char* , KexiMainWindow* ,
00129 QWidget * , const char * =0, QMap<QString,QString>* = 0) { return 0; }
00130
00131
00132
00133
00134
00135
00136 virtual KexiViewBase *createView(KexiMainWindow* , QWidget * ,
00137 const char * =0) { return 0; }
00138
00140 QGuardedPtr<QWidget> m_uniqueWidget;
00141
00142 bool m_uniqueDialog : 1;
00143
00144 bool m_cancelled : 1;
00145
00146
00147 };
00148
00149 #endif
00150