3 * kPPP: A pppd front end for the KDE project
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__
34 #include <QGridLayout>
38 #include "accounting.h"
39 #include "conwindow.h"
43 #include "pppstatdlg.h"
56 class SignalEvent
: public QEvent
{
58 SignalEvent(int s
) : QEvent(User
), sig(s
) { }
59 int sigType() const { return sig
; }
65 class KPPPWidget
: public QWidget
{
69 KPPPWidget( QWidget
*parent
=0, const char *name
=0 );
72 void setPW_Edit(const QString
&);
73 virtual bool eventFilter(QObject
*, QEvent
*);
75 void setQuitOnDisconnect (bool b
);
76 bool quitOnDisconnect () {return m_bQuitOnDisconnect
;};
79 void newdefaultaccount(int);
80 void newdefaultmodem(int);
85 void rulesetLoadError();
86 void usernameChanged(const QString
&);
87 void passwordChanged(const QString
&);
88 void enterPressedInID();
89 void enterPressedInPW();
93 void delayedDisconnect();
99 void resetCosts(const QString
&);
100 void resetVolume(const QString
&);
102 void log_window_toggled(bool on
);
103 void startAccounting();
104 void stopAccounting();
106 bool isConnected() const {return connected
;};
108 void begin_connect();
111 signals
: //dbus signal
112 void sig_aboutToConnect();
113 void sig_aboutToDisconnect();
114 void sig_connected();
115 void sig_disconnected();
120 DebugWidget
*debugwindow
;
124 PPPStatsDlg
*statdlg
;
125 AccountingBase
*acct
;
130 void prepareSetupDialog();
131 void interruptConnection();
134 QString
encodeWord(const QString
&s
);
138 QString ruleset_load_errmsg
;
142 KPushButton
*setup_b
;
145 QPushButton
*connect_b
;
146 QComboBox
*connectto_c
;
162 KPageDialog
*tabWindow
;
163 AccountWidget
*accounts
;
164 GeneralWidget
*general
;
165 ModemsWidget
*modems
;
170 QString m_strCmdlAccount
;
171 QString m_strCmdlModem
;
172 bool m_bQuitOnDisconnect
;
177 QTimer
*disconnectTimer
;