kexi

KexiConnSelector.h
1/* This file is part of the KDE project
2 Copyright (C) 2003,2005 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 KEXICONNSELECTOR_H
21#define KEXICONNSELECTOR_H
22
23#include <kexidbconnectionset.h>
24#include <kexidb/driver.h>
25#include "KexiStartupFileDialog.h"
26
27#include <kdialogbase.h>
28#include <tdelistview.h>
29
30#include <tqguardedptr.h>
31
32class KexiConnSelectorBase;
33
35class ConnectionDataLVItem : public TQListViewItem
36{
37 public:
38 ConnectionDataLVItem(KexiDB::ConnectionData *data,
39 const KexiDB::Driver::Info& info, TQListView *list);
40 ~ConnectionDataLVItem();
41
42 void update(const KexiDB::Driver::Info& info);
43 KexiDB::ConnectionData *data() const { return m_data; }
44
45 protected:
47};
48
49
50//class KexiOpenExistingFile;
51class KexiConnSelectorWidgetPrivate;
52
55class KEXIMAIN_EXPORT KexiConnSelectorWidget : public TQWidget
56{
57 TQ_OBJECT
58
59
60 public:
61 enum ConnType { FileBased=1, ServerBased=2 };
62
69 const TQString& startDirOrVariable,
70 TQWidget* parent = 0, const char* name = 0 );
71
73
76 int selectedConnectionType() const;
77
84
90 TQString selectedFileName();
91
94 void setSelectedFileName(const TQString& fileName);
95
96// //! Usable when we want to do other things for "back" button
97// void disconnectShowSimpleConnButton();
98
99 TQListView* connectionsList() const;
100
101 KexiConnSelectorBase *m_remote;
102// KexiOpenExistingFile *m_file;
103 KexiStartupFileDialog *m_fileDlg;
104
107 void setConfirmOverwrites(bool set);
108
109 bool confirmOverwrites() const;
110
111 signals:
112 void connectionItemExecuted(ConnectionDataLVItem *item);
113 void connectionItemHighlighted(ConnectionDataLVItem *item);
114
115 public slots:
116 void showSimpleConn();
117 void showAdvancedConn();
118 virtual void setFocus();
119
125 void hideHelpers();
126 void hideConnectonIcon();
127
128 protected slots:
129 void slotConnectionItemExecuted(TQListViewItem *item);
132 void slotRemoteRemoveBtnClicked();
133 void slotConnectionSelectionChanged();
134 void slotPrjTypeSelected(int id);
135
136 private:
137 ConnectionDataLVItem* addConnectionData( KexiDB::ConnectionData* data );
138 ConnectionDataLVItem* selectedConnectionDataItem() const;
139
140 KexiConnSelectorWidgetPrivate *d;
141};
142
143#endif // KEXICONNSELECTOR_H
void setConfirmOverwrites(bool set)
KexiDB::ConnectionData * selectedConnectionData() const
void setSelectedFileName(const TQString &fileName)
KexiConnSelectorWidget(KexiDBConnectionSet &conn_set, const TQString &startDirOrVariable, TQWidget *parent=0, const char *name=0)
Database specific connection data, e.g. host, port.
Widget for opening/saving files supported by Kexi.