Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.h | 62 |
1 files changed, 16 insertions, 46 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h index c1c7e69..af960c6 100644 --- a/noncore/settings/networksettings/ppp/pppdata.h +++ b/noncore/settings/networksettings/ppp/pppdata.h | |||
@@ -146,37 +146,36 @@ class Config; | |||
146 | #define E_IF_TIMEOUT 1 | 146 | #define E_IF_TIMEOUT 1 |
147 | #define E_PPPD_DIED 2 | 147 | #define E_PPPD_DIED 2 |
148 | 148 | ||
149 | // account list | 149 | // account list |
150 | #define ACCOUNTS_COUNT "Accounts_Count" | 150 | #define ACCOUNTS_COUNT "Accounts_Count" |
151 | #define ACOUNTS_DEV "Accounts_Modem" | 151 | #define ACOUNTS_DEV "Accounts_Modem" |
152 | #define ACOUNTS_ACC "Accounts_Account" | 152 | #define ACOUNTS_ACC "Accounts_Account" |
153 | 153 | ||
154 | class PPPData { | 154 | class PPPData { |
155 | public: | 155 | public: |
156 | PPPData(); | 156 | PPPData(); |
157 | ~PPPData() {}; | 157 | ~PPPData() {}; |
158 | static PPPData* data(); | ||
159 | 158 | ||
160 | enum { NumInitStrings = 2 }; | 159 | enum { NumInitStrings = 2 }; |
161 | 160 | ||
162 | // general functions | 161 | // general functions |
163 | bool open(); | ||
164 | void save(); | 162 | void save(); |
165 | void cancel(); | 163 | void cancel(); |
166 | 164 | ||
167 | QMap<QString,QString> getConfiguredInterfaces(); | 165 | static QMap<QString,QString> getConfiguredInterfaces(); |
168 | void setConfiguredInterfaces( QMap<QString,QString> ); | 166 | static void setConfiguredInterfaces( QMap<QString,QString> ); |
169 | 167 | ||
170 | // function to read/write date to configuration file | 168 | // function to read/write date to configuration file |
169 | static Config config(); | ||
171 | QString readConfig(const QString &, const QString &, const QString &); | 170 | QString readConfig(const QString &, const QString &, const QString &); |
172 | int readNumConfig(const QString &, const QString &, int); | 171 | int readNumConfig(const QString &, const QString &, int); |
173 | bool readListConfig(const QString &, const QString &, | 172 | bool readListConfig(const QString &, const QString &, |
174 | QStringList &, char sep = ','); | 173 | QStringList &, char sep = ','); |
175 | void writeConfig(const QString &, const QString &, const QString &); | 174 | void writeConfig(const QString &, const QString &, const QString &); |
176 | void writeConfig(const QString &, const QString &, int); | 175 | void writeConfig(const QString &, const QString &, int); |
177 | void writeListConfig(const QString &, const QString &, | 176 | void writeListConfig(const QString &, const QString &, |
178 | QStringList &, char sep = ','); | 177 | QStringList &, char sep = ','); |
179 | 178 | ||
180 | // return the current account group | 179 | // return the current account group |
181 | QString currentGroup() { return cgroup; } | 180 | QString currentGroup() { return cgroup; } |
182 | QString modemGroup(); | 181 | QString modemGroup(); |
@@ -198,29 +197,29 @@ public: | |||
198 | void set_quit_on_disconnect(bool); | 197 | void set_quit_on_disconnect(bool); |
199 | bool quit_on_disconnect(); | 198 | bool quit_on_disconnect(); |
200 | 199 | ||
201 | void set_show_clock_on_caption(bool set); | 200 | void set_show_clock_on_caption(bool set); |
202 | bool get_show_clock_on_caption(); | 201 | bool get_show_clock_on_caption(); |
203 | 202 | ||
204 | void set_show_log_window(bool set); | 203 | void set_show_log_window(bool set); |
205 | bool get_show_log_window(); | 204 | bool get_show_log_window(); |
206 | 205 | ||
207 | void set_automatic_redial(bool set); | 206 | void set_automatic_redial(bool set); |
208 | bool automatic_redial(); | 207 | bool automatic_redial(); |
209 | 208 | ||
210 | void set_iconify_on_connect(bool set); | 209 | // void set_iconify_on_connect(bool set); |
211 | bool get_iconify_on_connect(); | 210 | // bool get_iconify_on_connect(); |
212 | 211 | ||
213 | void set_dock_into_panel(bool set); | 212 | // void set_dock_into_panel(bool set); |
214 | bool get_dock_into_panel(); | 213 | // bool get_dock_into_panel(); |
215 | 214 | ||
216 | const QString enter(); | 215 | const QString enter(); |
217 | void setEnter(const QString &); | 216 | void setEnter(const QString &); |
218 | 217 | ||
219 | QString pppdVersion(); | 218 | QString pppdVersion(); |
220 | bool pppdVersionMin(int ver, int mod, int patch); | 219 | bool pppdVersionMin(int ver, int mod, int patch); |
221 | 220 | ||
222 | int pppdTimeout(); | 221 | int pppdTimeout(); |
223 | void setpppdTimeout(int); | 222 | void setpppdTimeout(int); |
224 | 223 | ||
225 | int busyWait(); | 224 | int busyWait(); |
226 | void setbusyWait(int); | 225 | void setbusyWait(int); |
@@ -302,29 +301,24 @@ public: | |||
302 | const QString modemAnswerResp(); | 301 | const QString modemAnswerResp(); |
303 | void setModemAnswerResp(const QString &); | 302 | void setModemAnswerResp(const QString &); |
304 | 303 | ||
305 | QString volumeOff(); | 304 | QString volumeOff(); |
306 | void setVolumeOff(const QString &); | 305 | void setVolumeOff(const QString &); |
307 | 306 | ||
308 | QString volumeMedium(); | 307 | QString volumeMedium(); |
309 | void setVolumeMedium(const QString &); | 308 | void setVolumeMedium(const QString &); |
310 | 309 | ||
311 | QString volumeHigh(); | 310 | QString volumeHigh(); |
312 | void setVolumeHigh(const QString &); | 311 | void setVolumeHigh(const QString &); |
313 | 312 | ||
314 | #if 0 | ||
315 | void setUseCDLine(const int n); | ||
316 | int UseCDLine(); | ||
317 | #endif | ||
318 | |||
319 | // functions to set/get account information | 313 | // functions to set/get account information |
320 | int count() const; | 314 | int count() const; |
321 | bool setAccount(const QString &); | 315 | bool setAccount(const QString &); |
322 | bool setAccountbyIndex(int); | 316 | bool setAccountbyIndex(int); |
323 | 317 | ||
324 | bool isUniqueAccname(const QString &); | 318 | bool isUniqueAccname(const QString &); |
325 | 319 | ||
326 | bool deleteAccount(); | 320 | bool deleteAccount(); |
327 | bool deleteAccount(const QString &); | 321 | bool deleteAccount(const QString &); |
328 | int newaccount(); | 322 | int newaccount(); |
329 | int copyaccount(int i); | 323 | int copyaccount(int i); |
330 | 324 | ||
@@ -365,26 +359,26 @@ public: | |||
365 | const QString command_before_disconnect(); | 359 | const QString command_before_disconnect(); |
366 | void setCommand_before_disconnect(const QString &); | 360 | void setCommand_before_disconnect(const QString &); |
367 | 361 | ||
368 | const QString ipaddr(); | 362 | const QString ipaddr(); |
369 | void setIpaddr(const QString &); | 363 | void setIpaddr(const QString &); |
370 | 364 | ||
371 | const QString subnetmask(); | 365 | const QString subnetmask(); |
372 | void setSubnetmask(const QString &); | 366 | void setSubnetmask(const QString &); |
373 | 367 | ||
374 | bool AcctEnabled(); | 368 | bool AcctEnabled(); |
375 | void setAcctEnabled(bool set); | 369 | void setAcctEnabled(bool set); |
376 | 370 | ||
377 | int VolAcctEnabled(); | 371 | // int VolAcctEnabled(); |
378 | void setVolAcctEnabled(int set); | 372 | // void setVolAcctEnabled(int set); |
379 | 373 | ||
380 | bool autoDNS(); | 374 | bool autoDNS(); |
381 | void setAutoDNS(bool set); | 375 | void setAutoDNS(bool set); |
382 | 376 | ||
383 | bool exDNSDisabled(); | 377 | bool exDNSDisabled(); |
384 | void setExDNSDisabled(bool set); | 378 | void setExDNSDisabled(bool set); |
385 | 379 | ||
386 | bool autoname(); | 380 | bool autoname(); |
387 | void setAutoname(bool set); | 381 | void setAutoname(bool set); |
388 | 382 | ||
389 | const QString gateway(); | 383 | const QString gateway(); |
390 | void setGateway(const QString &); | 384 | void setGateway(const QString &); |
@@ -406,60 +400,36 @@ public: | |||
406 | 400 | ||
407 | QStringList &pppdArgument(); | 401 | QStringList &pppdArgument(); |
408 | void setpppdArgumentDefaults(); | 402 | void setpppdArgumentDefaults(); |
409 | void setpppdArgument(QStringList &); | 403 | void setpppdArgument(QStringList &); |
410 | 404 | ||
411 | //functions to change/set the child pppd process info | 405 | //functions to change/set the child pppd process info |
412 | bool pppdRunning() const; | 406 | bool pppdRunning() const; |
413 | void setpppdRunning(bool set); | 407 | void setpppdRunning(bool set); |
414 | 408 | ||
415 | int pppdError() const; | 409 | int pppdError() const; |
416 | void setpppdError(int err); | 410 | void setpppdError(int err); |
417 | 411 | ||
418 | // functions to set/query the accounting info | ||
419 | // const QString accountingFile(); | ||
420 | // void setAccountingFile(const QString &); | ||
421 | |||
422 | // const QString totalCosts(); | ||
423 | // void setTotalCosts(const QString &); | ||
424 | |||
425 | // int totalBytes(); | ||
426 | // void setTotalBytes(int); | ||
427 | |||
428 | // // graphing widget | ||
429 | // void setGraphingOptions(bool enabled, | ||
430 | // QColor bg, | ||
431 | // QColor text, | ||
432 | // QColor in, | ||
433 | // QColor out); | ||
434 | // void graphingOptions(bool &enabled, | ||
435 | // QColor &bg, | ||
436 | // QColor &text, | ||
437 | // QColor &in, | ||
438 | // QColor &out); | ||
439 | // bool graphingEnabled(); | ||
440 | |||
441 | // // window positions | ||
442 | // void winPosConWin(int &, int &); | ||
443 | // void setWinPosConWin(int, int); | ||
444 | // void winPosStatWin(int &, int &); | ||
445 | // void setWinPosStatWin(int, int); | ||
446 | |||
447 | private: | 412 | private: |
448 | 413 | ||
449 | static PPPData *_data; | 414 | //static PPPData *_data; |
450 | int modemDeviceGroup; | 415 | int modemDeviceGroup; |
451 | QString passwd; | 416 | QString passwd; |
452 | static Config* config; // configuration object | 417 | // static Config* config; // configuration object |
453 | int highcount; // index of highest account | 418 | int highcount; // index of highest account |
454 | int caccount; // index of the current account | 419 | int caccount; // index of the current account |
455 | QString cgroup; // name of current config group | 420 | QString cgroup; // name of current config group |
456 | pid_t suidprocessid; // process ID of setuid child | 421 | pid_t suidprocessid; // process ID of setuid child |
457 | bool pppdisrunning; // pppd process | 422 | bool pppdisrunning; // pppd process |
458 | // daemon | 423 | // daemon |
459 | int pppderror; // error encounterd running pppd | 424 | int pppderror; // error encounterd running pppd |
460 | int pppdVer, pppdMod, pppdPatch; // pppd version | 425 | int pppdVer, pppdMod, pppdPatch; // pppd version |
461 | 426 | ||
462 | QStringList phonelist; | 427 | QStringList phonelist; |
428 | QMap<QString,QString> stringEntries; | ||
429 | QMap<QString,int> intEntries; | ||
430 | QMap<QString,QStringList> listEntries; | ||
431 | QMap<QString,QChar> sepEntries; | ||
432 | |||
463 | }; | 433 | }; |
464 | 434 | ||
465 | #endif | 435 | #endif |