Contact cannot be a null ptr, and it is accessed before anyway. Disscussed with kedge.
[kdenetwork.git] / kppp / modemdb.h
blob121b1d27a4192b5ecb373ce72aa0bda87bff9e18
1 //---------------------------------------------------------------------------
2 //
3 // kPPP: A pppd front end for the KDE project
4 //
5 //---------------------------------------------------------------------------
6 //
7 // (c) 1997-1998 Bernd Johannes Wuebben <wuebben@kde.org>
8 // (c) 1997-1999 Mario Weilguni <mweilguni@kde.org>
9 // (c) 1998-1999 Harri Porten <porten@kde.org>
11 // derived from Jay Painters "ezppp"
13 //---------------------------------------------------------------------------
15 // $Id$
17 //---------------------------------------------------------------------------
19 // This program is free software; you can redistribute it and-or
20 // modify it under the terms of the GNU Library General Public
21 // License as published by the Free Software Foundation; either
22 // version 2 of the License, or (at your option) any later version.
24 // This program is distributed in the hope that it will be useful,
25 // but WITHOUT ANY WARRANTY; without even the implied warranty of
26 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 // Library General Public License for more details.
29 // You should have received a copy of the GNU Library General Public
30 // License along with this program; if not, write to the Free
31 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33 //---------------------------------------------------------------------------
35 #ifndef __MODEMDB__H__
36 #define __MODEMDB__H__
38 #include <kdialog.h>
39 #include <qstringlist.h>
40 #include <q3dict.h>
41 #include <q3ptrlist.h>
42 class KConfig;
43 class Q3ListBox;
45 typedef Q3Dict<QString> CharDict;
47 class ModemDatabase {
48 public:
49 ModemDatabase();
50 ~ModemDatabase();
52 const QStringList *vendors();
53 QStringList *models(QString vendor);
55 void save(KConfig *);
57 private:
58 void load();
59 void loadModem(const QString & key, CharDict &dict);
60 Q3PtrList<CharDict> modems;
62 QStringList *lvendors;
64 KConfig *modemDB;
68 class ModemSelector : public KDialog {
69 Q_OBJECT
70 public:
71 ModemSelector(QWidget *parent = 0);
72 ~ModemSelector();
74 private slots:
75 void vendorSelected(int idx);
76 void modelSelected(int idx);
77 void selected(int idx);
79 private:
80 QPushButton *ok, *cancel;
81 Q3ListBox *vendor, *model;
82 ModemDatabase *db;
85 #endif