Diffstat (limited to 'noncore/settings/networksettings/ppp/connect.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/connect.h | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/ppp/connect.h b/noncore/settings/networksettings/ppp/connect.h new file mode 100644 index 0000000..3127236 --- a/dev/null +++ b/noncore/settings/networksettings/ppp/connect.h | |||
@@ -0,0 +1,152 @@ | |||
1 | /* -*- C++ -*- | ||
2 | * | ||
3 | * kPPP: A pppd front end for the KDE project | ||
4 | * | ||
5 | * $Id$ | ||
6 | * | ||
7 | * Copyright (C) 1997 Bernd Johannes Wuebben | ||
8 | * wuebben@math.cornell.edu | ||
9 | * | ||
10 | * based on EzPPP: | ||
11 | * Copyright (C) 1997 Jay Painter | ||
12 | * | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU Library General Public | ||
16 | * License as published by the Free Software Foundation; either | ||
17 | * version 2 of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
22 | * Library General Public License for more details. | ||
23 | * | ||
24 | * You should have received a copy of the GNU Library General Public | ||
25 | * License along with this program; if not, write to the Free | ||
26 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
27 | */ | ||
28 | |||
29 | #ifndef _CONNECT_H_ | ||
30 | #define _CONNECT_H_ | ||
31 | |||
32 | #include <qtimer.h> | ||
33 | #include <qpushbutton.h> | ||
34 | #include <qlabel.h> | ||
35 | #include <qevent.h> | ||
36 | |||
37 | #include "kpppconfig.h" | ||
38 | #include "pwentry.h" | ||
39 | //#include "docking.h" | ||
40 | //#include "loginterm.h" | ||
41 | |||
42 | #define MAXLOOPNEST (MAX_SCRIPT_ENTRIES/2) | ||
43 | |||
44 | class PPPStats; | ||
45 | |||
46 | class ConnectWidget : public QWidget { | ||
47 | Q_OBJECT | ||
48 | public: | ||
49 | ConnectWidget(QWidget *parent, const char *name); | ||
50 | ~ConnectWidget(); | ||
51 | |||
52 | public: | ||
53 | void set_con_speed_string(); | ||
54 | void setMsg(const QString &); | ||
55 | void pppdDied(); | ||
56 | |||
57 | protected: | ||
58 | void timerEvent(QTimerEvent *); | ||
59 | void closeEvent( QCloseEvent *e ); | ||
60 | |||
61 | private slots: | ||
62 | void readChar(unsigned char); | ||
63 | void pause(); | ||
64 | void if_waiting_slot(); | ||
65 | |||
66 | public slots: | ||
67 | void init(); | ||
68 | void preinit(); | ||
69 | void script_timed_out(); | ||
70 | void if_waiting_timed_out(); | ||
71 | void cancelbutton(); | ||
72 | |||
73 | signals: | ||
74 | void if_waiting_signal(); | ||
75 | void debugMessage(const QString &); | ||
76 | void toggleDebugWindow(); | ||
77 | void closeDebugWindow(); | ||
78 | void debugPutChar(unsigned char); | ||
79 | void startAccounting(); | ||
80 | void stopAccounting(); | ||
81 | |||
82 | public: | ||
83 | QString myreadbuffer; // we want to keep every thing in order to fish for the | ||
84 | |||
85 | // connection speed later on | ||
86 | QPushButton *debug; | ||
87 | int main_timer_ID; | ||
88 | |||
89 | private: | ||
90 | int vmain; | ||
91 | int substate; | ||
92 | int scriptindex; | ||
93 | QString scriptCommand, scriptArgument; | ||
94 | QStringList *comlist, *arglist; | ||
95 | |||
96 | // static const int maxloopnest=(MAX_SCRIPT_ENTRIES/2); | ||
97 | int loopnest; | ||
98 | int loopstartindex[MAXLOOPNEST]; | ||
99 | bool loopend; | ||
100 | QString loopstr[MAXLOOPNEST]; | ||
101 | |||
102 | bool semaphore; | ||
103 | QTimer *inittimer; | ||
104 | |||
105 | QTimer *timeout_timer; | ||
106 | bool execppp(); | ||
107 | void writeline(const QString &); | ||
108 | void checkBuffers(); | ||
109 | |||
110 | void setExpect(const QString &); | ||
111 | bool expecting; | ||
112 | QString expectstr; | ||
113 | |||
114 | QString readbuffer; | ||
115 | |||
116 | void setScan(const QString &); | ||
117 | QString scanvar; | ||
118 | QString scanstr; | ||
119 | QString scanbuffer; | ||
120 | bool scanning; | ||
121 | |||
122 | bool pausing; | ||
123 | PWEntry *prompt; | ||
124 | // LoginTerm *termwindow; | ||
125 | |||
126 | int scriptTimeout; | ||
127 | QTimer *pausetimer; | ||
128 | QTimer *if_timer; | ||
129 | QTimer *if_timeout_timer; | ||
130 | |||
131 | QLabel *messg; | ||
132 | QPushButton *cancel; | ||
133 | |||
134 | bool firstrunID; | ||
135 | bool firstrunPW; | ||
136 | |||
137 | unsigned int dialnumber; // the current number to dial | ||
138 | |||
139 | // PPPStats *stats; | ||
140 | }; | ||
141 | |||
142 | |||
143 | // non-member function to kill&wait on the pppd child process | ||
144 | extern void killppp(); | ||
145 | void adddns(); | ||
146 | void addpeerdns(); | ||
147 | void removedns(); | ||
148 | void add_domain(const QString & newdomain); | ||
149 | void auto_hostname(); | ||
150 | |||
151 | #endif | ||
152 | |||