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
00112 static bool executeCommand(const char* partName,
00113 KexiMainWindow* mainWin, const char* commandName, QMap<QString,QString>* args = 0);
00114
00116 static const KexiInternalPart* part(KexiDB::MessageHandler *msgHdr, const char* partName);
00117
00119 inline bool uniqueDialog() const { return m_uniqueDialog; }
00120
00124 inline bool cancelled() const { return m_cancelled; }
00125
00126 protected:
00128 KexiDialogBase *findOrCreateKexiDialog(KexiMainWindow* mainWin,
00129 const char *objName);
00130
00133 virtual QWidget *createWidget(const char* widgetClass, KexiMainWindow* mainWin,
00134 QWidget * parent, const char * objName = 0, QMap<QString,QString>* args = 0);
00135
00136
00137
00138
00139
00140
00142 virtual KexiViewBase *createView(KexiMainWindow* mainWin, QWidget * parent,
00143 const char *objName = 0);
00144
00148 virtual bool executeCommand(KexiMainWindow* mainWin, const char* commandName,
00149 QMap<QString,QString>* args = 0);
00150
00152 QGuardedPtr<QWidget> m_uniqueWidget;
00153
00154 bool m_uniqueDialog : 1;
00155
00156 bool m_cancelled : 1;
00157 };
00158
00159 #endif