kexi

KexiStartupDialog.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2007 Jaroslaw Staniek <js@iidea.pl>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef KexiStartupDialog_h
21#define KexiStartupDialog_h
22
23#include <kdialogbase.h>
24#include <kicondialog.h>
25#include <kiconview.h>
26#include <tdefileiconview.h>
27#include <tdefiledialog.h>
28
29#include <tqlabel.h>
30#include <tqsplitter.h>
31
32#include <kexidb/connectiondata.h>
33#include <core/kexiprojectdata.h>
34
35class KexiStartupDialogPrivate;
36class KexiProjectData;
37class KexiProjectSet;
40
46class KEXIMAIN_EXPORT KexiStartupDialog : public KDialogBase
47{
48 TQ_OBJECT
49
50
51public:
69
78 enum DialogType { Templates = 1, OpenExisting = 2, OpenRecent = 4, Everything = (1+2+4) };
79
84 enum DialogOptions { CheckBoxDoNotShowAgain = 1 };
85
96 int dialogType,
97 int dialogOptions,
98 KexiDBConnectionSet& connSet,
99 KexiProjectSet& recentProjects,
100 TQWidget *parent = 0, const char *name = 0 );
102
105 static bool shouldBeShown();
106
109 int result() const;
110
114 KexiProjectData* selectedProjectData() const;
115
122 TQString selectedFileName() const;
123
126 TQValueList<KexiProjectData::ObjectInfo> autoopenObjects() const;
127
132 KexiDB::ConnectionData* selectedExistingConnection() const;
133
135 virtual void show();
136
137public slots:
138
139protected slots:
140 virtual void done(int r);
141 virtual void reject();
142 virtual void slotOk();
143
145 void slotPageShown(TQWidget *page);
146/*
148 void templateItemExecuted(TQIconViewItem *item);
149
151 void templateItemSelected(TQIconViewItem *item);*/
152
154 void tabShown(TQWidget *w);
155
156 void templateSelected(const TQString& fileName);
157
159 void recentProjectItemExecuted(KexiProjectData *data);
160 void existingFileSelected(const TQString &f);
161 void showSimpleConnForOpenExisting();
162 void showAdvancedConnForOpenExisting();
163 void connectionItemForOpenExistingExecuted(ConnectionDataLVItem *item);
164 void connectionItemForOpenExistingHighlighted(ConnectionDataLVItem *item);
165
166protected:
167 virtual bool eventFilter( TQObject *o, TQEvent *e );
168
170 void updateDialogOKButton(TQWidget *w);
171
173 int activePageIndex() const;
174private:
175 void setupPageTemplates();
176 void setupPageOpenExisting();
177 void setupPageOpenRecent();
178
180// void updateSelectedTemplateKeyInfo();
181
182 KexiStartupDialogPrivate *d;
183};
184
185#endif
186
Database specific connection data, e.g. host, port.
Kexi project core data member.
Stores information about multiple kexi project-data items.
@ OpenExistingResult
The user has chosen an existing connection or db file.
@ OpenRecentResult
The user has selected one of recently used databases.
@ ImportResult
The user has chosen to import db.
@ CancelResult
The user has pressed 'Cancel'.
@ CreateFromTemplateResult
The user has selected a template to be used for creating a new db.
@ CreateBlankResult
The user has selected a template.
KexiStartupDialog(int dialogType, int dialogOptions, KexiDBConnectionSet &connSet, KexiProjectSet &recentProjects, TQWidget *parent=0, const char *name=0)