networkscanner.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef NETWORKSCANNER_H
00021 #define NETWORKSCANNER_H
00022
00023 #include <qwidget.h>
00024 #include <kdialogbase.h>
00025 #include <qptrlist.h>
00026
00027
00028 class KDEPRINT_EXPORT NetworkScanner : public QWidget
00029 {
00030 Q_OBJECT
00031
00032 public:
00033 NetworkScanner( int port = 9100, QWidget *parent = 0, const char *name = 0 );
00034 ~NetworkScanner();
00035
00036 struct SocketInfo
00037 {
00038 QString IP;
00039 QString Name;
00040 int Port;
00041 };
00042
00043 const QPtrList<NetworkScanner::SocketInfo>* printerList();
00044
00045 int timeout() const;
00046 void setTimeout( int to );
00047 QString subnet() const;
00048 void setSubnet( const QString& );
00049 int port() const;
00050 void setPort( int );
00051 bool checkPrinter( const QString&, int );
00052
00053 signals:
00054 void scanStarted();
00055 void scanFinished();
00056
00057 protected slots:
00058 void slotConnectionSuccess();
00059 void slotConnectionFailed( int );
00060 void slotTimeout();
00061 void slotScanClicked();
00062 void slotSettingsClicked();
00063 void slotNext();
00064
00065 protected:
00066 void next();
00067 void finish();
00068 void start();
00069
00070 private:
00071 class NetworkScannerPrivate;
00072 NetworkScannerPrivate *d;
00073 };
00074
00075 class QLineEdit;
00076 class QComboBox;
00077
00078 class NetworkScannerConfig : public KDialogBase
00079 {
00080 Q_OBJECT
00081
00082 public:
00083 NetworkScannerConfig(NetworkScanner *scanner, const char *name = 0);
00084 ~NetworkScannerConfig();
00085
00086 protected slots:
00087 void slotOk();
00088
00089 private:
00090 QLineEdit *mask_, *tout_;
00091 QComboBox *port_;
00092 NetworkScanner *scanner_;
00093 };
00094
00095 #endif
|