kexi
KexiStartupDialog.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KexiStartupDialog_h
00021 #define KexiStartupDialog_h
00022
00023 #include <kdialogbase.h>
00024 #include <kicondialog.h>
00025 #include <kiconview.h>
00026 #include <kfileiconview.h>
00027 #include <kfiledialog.h>
00028
00029 #include <qlabel.h>
00030 #include <qsplitter.h>
00031
00032 #include <kexidb/connectiondata.h>
00033 #include <core/kexiprojectdata.h>
00034
00035 class KexiStartupDialogPrivate;
00036 class KexiProjectData;
00037 class KexiProjectSet;
00038 class KexiDBConnectionSet;
00039 class ConnectionDataLVItem;
00040
00046 class KEXIMAIN_EXPORT KexiStartupDialog : public KDialogBase
00047 {
00048 Q_OBJECT
00049
00050 public:
00060 enum Result {
00061 CancelResult,
00062 CreateBlankResult,
00063 CreateFromTemplateResult,
00064 ImportResult,
00065 OpenExistingResult,
00066 OpenRecentResult
00067 };
00068
00077 enum DialogType { Templates = 1, OpenExisting = 2, OpenRecent = 4, Everything = (1+2+4) };
00078
00083 enum DialogOptions { CheckBoxDoNotShowAgain = 1 };
00084
00094 KexiStartupDialog(
00095 int dialogType,
00096 int dialogOptions,
00097 KexiDBConnectionSet& connSet,
00098 KexiProjectSet& recentProjects,
00099 QWidget *parent = 0, const char *name = 0 );
00100 ~KexiStartupDialog();
00101
00104 static bool shouldBeShown();
00105
00108 int result() const;
00109
00113 KexiProjectData* selectedProjectData() const;
00114
00121 QString selectedFileName() const;
00122
00125 QValueList<KexiProjectData::ObjectInfo> autoopenObjects() const;
00126
00131 KexiDB::ConnectionData* selectedExistingConnection() const;
00132
00134 virtual void show();
00135
00136 public slots:
00137
00138 protected slots:
00139 virtual void done(int r);
00140 virtual void reject();
00141 virtual void slotOk();
00142
00144 void slotPageShown(QWidget *page);
00145
00147
00148
00150
00151
00153 void tabShown(QWidget *w);
00154
00155 void templateSelected(const QString& fileName);
00156
00158 void recentProjectItemExecuted(KexiProjectData *data);
00159 void existingFileSelected(const QString &f);
00160 void showSimpleConnForOpenExisting();
00161 void showAdvancedConnForOpenExisting();
00162 void connectionItemForOpenExistingExecuted(ConnectionDataLVItem *item);
00163 void connectionItemForOpenExistingHighlighted(ConnectionDataLVItem *item);
00164
00165 protected:
00166 virtual bool eventFilter( QObject *o, QEvent *e );
00167
00169 void updateDialogOKButton(QWidget *w);
00170
00172 int activePageIndex() const;
00173 private:
00174 void setupPageTemplates();
00175 void setupPageOpenExisting();
00176 void setupPageOpenRecent();
00177
00179
00180
00181 KexiStartupDialogPrivate *d;
00182 };
00183
00184 #endif
00185
|