port KAboutApplication -> KAboutApplicationDialog, KAboutKDE -> KAboutKDEDialog
[kdenetwork.git] / kppp / kpppwidget.h
blob8ffcd0884ee1d3ccb54c339a76732f78fe6fd606
1 /*
3 * kPPP: A pppd front end for the KDE project
5 * $Id$
7 * Copyright (C) 1997 Bernd Johannes Wuebben
8 * wuebben@math.cornell.edu
10 * Copyright (C) 1998-2002 Harri Porten <porten@kde.org>
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this program; if not, write to the Free
24 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 #ifndef __KPPPWIDGET_H__
28 #define __KPPPWIDGET_H__
30 #include <qstring.h>
31 //Added by qt3to4:
32 #include <QLabel>
33 #include <Q3Frame>
34 #include <QGridLayout>
35 #include <QEvent>
38 #include "accounting.h"
39 #include "conwindow.h"
40 #include "accounts.h"
41 #include "connect.h"
42 #include "debug.h"
43 #include "pppstatdlg.h"
46 class GeneralWidget;
47 class ModemsWidget;
48 class ModemWidget;
49 class ModemWidget2;
50 class GraphSetup;
51 class AboutWidget;
52 class PPPStats;
53 class KPageDialog;
54 class KPushButton;
56 class SignalEvent : public QEvent {
57 public:
58 SignalEvent(int s) : QEvent(User), sig(s) { }
59 int sigType() const { return sig; }
60 private:
61 int sig;
65 class KPPPWidget : public QWidget {
66 Q_OBJECT
67 public:
69 KPPPWidget( QWidget *parent=0, const char *name=0 );
70 ~KPPPWidget();
72 void setPW_Edit(const QString &);
73 virtual bool eventFilter(QObject *, QEvent *);
75 void setQuitOnDisconnect (bool b);
76 bool quitOnDisconnect () {return m_bQuitOnDisconnect;};
78 private slots:
79 void newdefaultaccount(int);
80 void newdefaultmodem(int);
81 void expandbutton();
82 void quitbutton();
83 void helpbutton();
84 void setup();
85 void rulesetLoadError();
86 void usernameChanged(const QString &);
87 void passwordChanged(const QString &);
88 void enterPressedInID();
89 void enterPressedInPW();
90 void saveMyself();
91 void shutDown();
93 void delayedDisconnect();
95 public slots:
96 void beginConnect();
97 void resetaccounts();
98 void resetmodems();
99 void resetCosts(const QString &);
100 void resetVolume(const QString &);
101 void disconnect();
102 void log_window_toggled(bool on);
103 void startAccounting();
104 void stopAccounting();
105 void showStats();
106 bool isConnected() const {return connected;};
107 signals:
108 void begin_connect();
109 void cmdl_start();
111 signals: //dbus signal
112 void sig_aboutToConnect();
113 void sig_aboutToDisconnect();
114 void sig_connected();
115 void sig_disconnected();
117 public:
118 QCheckBox *log;
119 bool connected;
120 DebugWidget *debugwindow;
121 QString con_speed;
122 ConnectWidget *con;
123 ConWindow *con_win;
124 PPPStatsDlg *statdlg;
125 AccountingBase *acct;
126 KPushButton *quit_b;
127 PPPStats *stats;
129 private:
130 void prepareSetupDialog();
131 void interruptConnection();
132 void sigChld();
133 void sigPPPDDied();
134 QString encodeWord(const QString &s);
135 void showNews ();
136 void setButtons();
138 QString ruleset_load_errmsg;
140 QGridLayout *l1;
141 KPushButton *help_b;
142 KPushButton *setup_b;
143 QFrame *fline;
144 QFrame *fline1;
145 QPushButton *connect_b;
146 QComboBox *connectto_c;
147 QComboBox *modem_c;
148 QLabel *ID_Label;
149 QLabel *PW_Label;
150 QLineEdit *ID_Edit;
151 QLineEdit *PW_Edit;
152 QLabel *label1;
153 QLabel *label2;
154 QLabel *label3;
155 QLabel *label4;
156 QLabel *label5;
157 QLabel *label6;
158 QLabel *label7;
159 QLabel *radio_label;
162 KPageDialog *tabWindow;
163 AccountWidget *accounts;
164 GeneralWidget *general;
165 ModemsWidget *modems;
166 GraphSetup *graph;
167 AboutWidget *about;
170 QString m_strCmdlAccount;
171 QString m_strCmdlModem;
172 bool m_bQuitOnDisconnect;
173 bool m_bCmdlAccount;
174 bool m_bCmdlModem;
175 bool m_bModemCShown;
177 QTimer *disconnectTimer;
181 #endif