kexi

KexiProjectSelector.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 Jaroslaw Staniek <js@iidea.pl>
3
4 This program 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 program 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 program; see the file COPYING. 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 KEXIPROJECTSELECTOR_H
21#define KEXIPROJECTSELECTOR_H
22
23#include "KexiProjectSelectorBase.h"
24#include "kexiprojectset.h"
25
26#include <kdialogbase.h>
27#include <tqwidgetstack.h>
28
29class KexiNewFileDBWidget;
30class KexiProjectSelectorWidgetPrivate;
31
34class KEXIMAIN_EXPORT KexiProjectSelectorWidget : public KexiProjectSelectorBase
35{
36 TQ_OBJECT
37
38
39public:
40// enum ConnType { FileBased=1, ServerBased=2 };
41
48 KexiProjectSelectorWidget( TQWidget* parent = 0, const char* name = 0,
49 KexiProjectSet* prj_set = 0, bool showProjectNameColumn = true,
50 bool showConnectionColumns = true );
51
53
57
61 void setProjectSet( KexiProjectSet* prj_set );
62
64 inline KexiProjectSet *projectSet() { return m_prj_set; }
65
69 void setSelectable(bool set);
70
72 bool isSelectable() const;
73
74public slots:
75
76signals:
77 void projectExecuted(KexiProjectData*);
78 void selectionChanged(KexiProjectData*);
79
80protected slots:
81 void slotItemExecuted(TQListViewItem*);
82 void slotItemSelected();
83 virtual void languageChange() { KexiProjectSelectorBase::languageChange(); }
84
85protected:
86 KexiProjectSet *m_prj_set;
87
88 KexiProjectSelectorWidgetPrivate *d;
89
90 friend class ProjectDataLVItem;
91};
92
94class KexiProjectSelectorDialog : public KDialogBase
95{
96 TQ_OBJECT
97
98public:
102 KexiProjectSelectorDialog( TQWidget *parent, const char *name,
103 KexiProjectSet* prj_set,
104 bool showProjectNameColumn = true, bool showConnectionColumns = true);
105
110 KexiProjectSelectorDialog( TQWidget *parent, const char *name,
112 bool showProjectNameColumn = true, bool showConnectionColumns = true);
113
115
119
121 inline KexiProjectSet *projectSet() { return m_sel->projectSet(); }
122
123 virtual void show();
124
125protected slots:
126 void slotProjectExecuted(KexiProjectData*);
127 void slotProjectSelectionChanged(KexiProjectData*);
128
129protected:
130 void init(KexiProjectSet* prj_set, bool showProjectNameColumn, bool showConnectionColumns);
131
133};
134
135#endif
136
Database specific connection data, e.g. host, port.
Kexi project core data member.
KexiProjectSelectorDialog(TQWidget *parent, const char *name, KexiProjectSet *prj_set, bool showProjectNameColumn=true, bool showConnectionColumns=true)
KexiProjectData * selectedProjectData() const
KexiProjectSelectorWidget(TQWidget *parent=0, const char *name=0, KexiProjectSet *prj_set=0, bool showProjectNameColumn=true, bool showConnectionColumns=true)
KexiProjectData * selectedProjectData() const
void setProjectSet(KexiProjectSet *prj_set)
Stores information about multiple kexi project-data items.