Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

edit.h

Go to the documentation of this file.
00001 /* -*- C++ -*-
00002  *
00003  *              kPPP: A pppd Front End for the KDE project
00004  *
00005  * $Id: edit.h,v 1.4 2003/08/09 17:14:55 kergoth Exp $
00006  *              Copyright (C) 1997 Bernd Johannes Wuebben
00007  *                      wuebben@math.cornell.edu
00008  *
00009  * based on EzPPP:
00010  * Copyright (C) 1997  Jay Painter
00011  *
00012  *
00013  * This library is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU Library General Public
00015  * License as published by the Free Software Foundation; either
00016  * version 2 of the License, or (at your option) any later version.
00017  *
00018  * This library is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * Library General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU Library General Public
00024  * License along with this program; if not, write to the Free
00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00026  */
00027 
00028 
00029 #ifndef _EDIT_H_
00030 #define _EDIT_H_
00031 
00032 #include <qdialog.h>
00033 #include <qpushbutton.h>
00034 #include <qgroupbox.h>
00035 #include <qvgroupbox.h>
00036 #include <qscrollbar.h>
00037 #include <qcombobox.h>
00038 #include <qlineedit.h>
00039 #include <qlistbox.h>
00040 #include <qradiobutton.h>
00041 #include <qbuttongroup.h>
00042 #include <qcheckbox.h>
00043 #include <qlabel.h>
00044 //#include <kdialogbase.h>
00045 #include "scriptedit.h"
00046 #include "kpppconfig.h"
00047 #include "pppdargs.h"
00048 
00049 class IPLineEdit;
00050 class PPPData;
00051 
00052 class DialWidget : public QWidget {
00053   Q_OBJECT
00054 public:
00055   DialWidget( PPPData*, QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
00056   ~DialWidget() {}
00057 
00058 public slots:
00059   bool save();
00060   void pppdargsbutton();
00061   void numbersChanged();
00062   void selectionChanged(int);
00063   void addNumber();
00064   void delNumber();
00065   void upNumber();
00066   void downNumber();
00067 
00068 private:
00069   QLineEdit *connectname_l;
00070   QLabel *connect_label;
00071   QLabel *number_label;
00072   QPushButton *pppdargs;
00073 
00074   // for the phonenumber selection
00075   QPushButton *add, *del, *up, *down;
00076   QListBox *numbers;
00077     PPPData *_pppdata;
00078 };
00079 
00080 
00082 //
00083 // tab-window to select what to execute when
00084 //
00086 class ExecWidget : public QWidget {
00087   Q_OBJECT
00088 public:
00089   ExecWidget(PPPData*, QWidget *parent=0, bool isnewaccount=true, const char *name=0);
00090 
00091 public slots:
00092   bool save();
00093 
00094 private:
00095   QLineEdit *before_connect;
00096   QLabel *before_connect_l;
00097 
00098   QLineEdit *command;
00099   QLabel *command_label;
00100 
00101   QLineEdit *predisconnect;
00102   QLabel *predisconnect_label;
00103 
00104   QLineEdit *discommand;
00105   QLabel *discommand_label;
00106     PPPData *_pppdata;
00107 };
00108 
00109 
00110 class IPWidget : public QWidget {
00111   Q_OBJECT
00112 public:
00113   IPWidget(PPPData*, QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
00114   ~IPWidget() {}
00115 
00116 public slots:
00117   void save();
00118 
00119 protected slots:
00120   void hitIPSelect( int );
00121   void autoname_t(bool on);
00122 
00123 private:
00124   QLabel *ipaddress_label;
00125   QLabel *sub_label;
00126   QGroupBox *box1;
00127   QVGroupBox *box;
00128 
00129   QButtonGroup *rb;
00130   QRadioButton *dynamicadd_rb;
00131   QRadioButton *staticadd_rb;
00132 
00133   IPLineEdit *ipaddress_l;
00134   IPLineEdit *subnetmask_l;
00135 
00136   QCheckBox *autoname;
00137     PPPData *_pppdata;
00138 };
00139 
00140 
00141 class DNSWidget : public QWidget {
00142   Q_OBJECT
00143 public:
00144   DNSWidget( PPPData*, QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
00145   ~DNSWidget() {}
00146 
00147 public slots:
00148   void save();
00149 
00150 protected slots:
00151   void adddns();
00152   void removedns();
00153   void DNS_Edit_Changed(const QString &);
00154   void DNS_Entry_Selected(int);
00155   void DNS_Mode_Selected(int);
00156 
00157 private:
00158   QLabel *conf_label;
00159   QButtonGroup *bg;
00160   QRadioButton *autodns, *mandns;
00161   QLabel *dns_label;
00162   QLabel *servers_label;
00163   IPLineEdit *dnsipaddr;
00164   QPushButton *add;
00165   QPushButton *remove;
00166   QListBox *dnsservers;
00167   QLineEdit *dnsdomain;
00168   QLabel *dnsdomain_label;
00169   QCheckBox *exdnsdisabled_toggle;
00170     PPPData *_pppdata;
00171 };
00172 
00173 
00174 class GatewayWidget : public QWidget {
00175   Q_OBJECT
00176 public:
00177   GatewayWidget(PPPData*, QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
00178   ~GatewayWidget() {}
00179 
00180 public slots:
00181   void save();
00182 
00183 private slots:
00184   void hitGatewaySelect( int );
00185 
00186 private:
00187   QGroupBox *box;
00188   QLabel *gate_label;
00189   QGroupBox *box1;
00190   QButtonGroup *rb;
00191   QRadioButton *defaultgateway;
00192   QRadioButton *staticgateway;
00193   IPLineEdit *gatewayaddr;
00194   QCheckBox *defaultroute;
00195     PPPData *_pppdata;
00196 };
00197 
00198 
00199 class ScriptWidget : public QWidget {
00200   Q_OBJECT
00201 public:
00202   ScriptWidget(PPPData*, QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
00203   ~ScriptWidget() {}
00204 
00205 public slots:
00206   void save();
00207   bool check();
00208 
00209 private slots:
00210   void addButton();
00211   void insertButton();
00212   void removeButton();
00213 
00214   //signals linked to the scroll bar
00215   void scrolling(int);
00216 
00217   //signals to keep the two listboxes highlighted in sync
00218   void slhighlighted(int);
00219   void stlhighlighted(int);
00220 
00221 private:
00222   void adjustScrollBar();
00223 
00224   ScriptEdit *se;
00225   QPushButton *add;
00226   QPushButton *remove;
00227   QPushButton *insert;
00228   QListBox *sl, *stl;
00229 
00230   QScrollBar *slb;
00231     PPPData *_pppdata;
00232 };
00233 
00234 
00236 //
00237 // Used to specify a new phone number
00238 //
00240 class PhoneNumberDialog : public QDialog {
00241   Q_OBJECT
00242 public:
00243   PhoneNumberDialog(QWidget *parent = 0);
00244 
00245   QString phoneNumber();
00246 
00247 private slots:
00248   void textChanged(const QString &);
00249 
00250 private:
00251   QLineEdit *le;
00252 
00253 };
00254 
00255 
00256 #endif

Generated on Sat Nov 5 16:17:50 2005 for OPIE by  doxygen 1.4.2