summaryrefslogtreecommitdiffstats
path: root/kexi/main/startup/KexiNewProjectWizard.h
blob: ff16b996ef02c41330777f153fa8aaac5374ae68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* This file is part of the KDE project
   Copyright (C) 2003 Jaroslaw Staniek <[email protected]>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef KexiNewProjectWizard_H
#define KexiNewProjectWizard_H

#include "kexidbconnectionset.h"
#include <kexidb/connectiondata.h>

#include <kwizard.h>

class TQListViewItem;

class KexiNewPrjTypeSelector;
class KexiConnSelectorWidget;
class KexiNewProjectWizardPrivate;
class KexiDBTitlePage;
class KexiServerDBNamePage;
class KexiProjectSelectorWidget;

class KEXIMAIN_EXPORT KexiNewProjectWizard : public KWizard
{
	Q_OBJECT
  TQ_OBJECT
	public:
		KexiNewProjectWizard(KexiDBConnectionSet& conn_set, TQWidget *parent=0, 
			const char *name=0, bool modal=false, WFlags f=0);
		~KexiNewProjectWizard();
	
		/*! \return name for a new project's database if server-based project 
		 type was selected. Returns file name if file-based project was selected. */
		TQString projectDBName() const;

		/*! \return name for a new project. Used for both file- and serever- based projects. */
		TQString projectCaption() const;

		/*! \return data of selected connection for new project, 
		 if server-based project type was selected.
		 Returns NULL if no selection has been made or file-based project
		 has been selected. */
		KexiDB::ConnectionData* projectConnectionData() const;
		
		/*! Reimplemented for internal reasons */	
		virtual void show();

		/*! If true, user will be asked to accept overwriting existing project. 
		 This is true by default. */
		void setConfirmOverwrites(bool set);

	protected slots:
		void slotLvTypesSelected(TQListViewItem *);
		void slotLvTypesExecuted(TQListViewItem *);
		void slotServerDBCaptionTxtChanged(const TQString &capt);
		void slotServerDBNameTxtChanged(const TQString &n);
		
		virtual void done(int r);
		virtual void next();
		virtual void accept();
		
	protected:
		virtual void showPage(TQWidget *page);
		
		KexiNewPrjTypeSelector *m_prjtype_sel;
		KexiDBTitlePage *m_db_title;
		KexiServerDBNamePage *m_server_db_name;
		KexiProjectSelectorWidget* m_project_selector;
		
		KexiConnSelectorWidget *m_conn_sel;
		TQWidget *m_conn_sel_widget;
		
		KexiNewProjectWizardPrivate *d;
};

#endif