00001
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
class NetworkScanner :
public QWidget
00028 {
00029 Q_OBJECT
00030
00031
public:
00032 NetworkScanner(
int port = 9100,
QWidget *parent = 0,
const char *name = 0 );
00033 ~NetworkScanner();
00034
00035
struct SocketInfo
00036 {
00037
QString IP;
00038
QString Name;
00039
int Port;
00040 };
00041
00042
const QPtrList<NetworkScanner::SocketInfo>* printerList();
00043
00044
int timeout() const;
00045
void setTimeout(
int to );
00046
QString subnet() const;
00047
void setSubnet( const
QString& );
00048
int port() const;
00049
void setPort(
int );
00050
bool checkPrinter( const QString&,
int );
00051
00052 signals:
00053
void scanStarted();
00054
void scanFinished();
00055
00056 protected slots:
00057
void slotConnectionSuccess();
00058
void slotConnectionFailed(
int );
00059
void slotTimeout();
00060
void slotScanClicked();
00061
void slotSettingsClicked();
00062
void slotNext();
00063
00064 protected:
00065
void next();
00066
void finish();
00067
void start();
00068
00069 private:
00070 class NetworkScannerPrivate;
00071 NetworkScannerPrivate *d;
00072 };
00073
00074 class
QLineEdit;
00075 class
QComboBox;
00076
00077 class NetworkScannerConfig : public KDialogBase
00078 {
00079 Q_OBJECT
00080
00081
public:
00082 NetworkScannerConfig(NetworkScanner *scanner,
const char *name = 0);
00083 ~NetworkScannerConfig();
00084
00085
protected slots:
00086
void slotOk();
00087
00088
private:
00089 QLineEdit *mask_, *tout_;
00090 QComboBox *port_;
00091 NetworkScanner *scanner_;
00092 };
00093
00094
#endif