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
00034 class KTextBrowser;
00035
00037 class KEXIMAIN_EXPORT TemplatesPage : public QSplitter
00038 {
00039 Q_OBJECT
00040
00041 public:
00042 TemplatesPage( Orientation o, QWidget * parent = 0, const char * name = 0 );
00043 ~TemplatesPage();
00044 void addItem(const QString& key, const QString& name,
00045 const QString& description, const QPixmap& icon);
00046 private slots:
00047 void itemClicked(QIconViewItem *item);
00048
00049 public:
00050 KIconView *templates;
00051 KTextBrowser *info;
00052 };
00053
00054
00055 class KexiStartupDialogPrivate;
00056 class KexiProjectData;
00057 class KexiProjectSet;
00058 class KexiDBConnectionSet;
00059 class ConnectionDataLVItem;
00060
00066 class KEXIMAIN_EXPORT KexiStartupDialog : public KDialogBase
00067 {
00068 Q_OBJECT
00069
00070 public:
00078 enum Result { CancelResult=0, TemplateResult=1, OpenExistingResult=2, OpenRecentResult=3 };
00087 enum DialogType { Templates = 1, OpenExisting = 2, OpenRecent = 4, Everything = (1+2+4) };
00088
00093 enum DialogOptions { CheckBoxDoNotShowAgain = 1 };
00094
00104 KexiStartupDialog(
00105 int dialogType,
00106 int dialogOptions,
00107 KexiDBConnectionSet& connSet,
00108 KexiProjectSet& recentProjects,
00109 QWidget *parent = 0, const char *name = 0 );
00110 ~KexiStartupDialog();
00111
00114 static bool shouldBeShown();
00115
00118 int result() const;
00119
00125 QString selectedTemplateKey() const;
00126
00130 KexiProjectData* selectedProjectData() const;
00131
00136 QString selectedExistingFile() const;
00137
00142 KexiDB::ConnectionData* selectedExistingConnection() const;
00143
00145 virtual void show();
00146
00147 public slots:
00148
00149 protected slots:
00150 virtual void done(int r);
00151 virtual void reject();
00152 virtual void slotOk();
00153
00155 void templatesPageShown(QWidget *page);
00156
00158 void templateItemExecuted(QIconViewItem *item);
00159
00161 void templateItemSelected(QIconViewItem *item);
00162
00164 void tabShown(QWidget *w);
00165
00167 void recentProjectItemExecuted(KexiProjectData *data);
00168 void existingFileSelected(const QString &f);
00169 void showSimpleConnForOpenExisting();
00170 void showAdvancedConnForOpenExisting();
00171 void connectionItemForOpenExistingExecuted(ConnectionDataLVItem *item);
00172 void connectionItemForOpenExistingHighlighted(ConnectionDataLVItem *item);
00173
00174 protected:
00175 virtual bool eventFilter( QObject *o, QEvent *e );
00176
00178 void updateDialogOKButton(QWidget *w);
00179
00181 int activePageIndex() const;
00182 private:
00183 void setupPageTemplates();
00184 void setupPageOpenExisting();
00185 void setupPageOpenRecent();
00186
00188 void updateSelectedTemplateKeyInfo();
00189
00190 KexiStartupDialogPrivate *d;
00191 };
00192
00193 #endif
00194
|