summaryrefslogtreecommitdiffstats
path: root/kopete/plugins/smpppdcs/smpppdsearcher.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/plugins/smpppdcs/smpppdsearcher.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/smpppdcs/smpppdsearcher.h')
-rw-r--r--kopete/plugins/smpppdcs/smpppdsearcher.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/kopete/plugins/smpppdcs/smpppdsearcher.h b/kopete/plugins/smpppdcs/smpppdsearcher.h
new file mode 100644
index 00000000..af36637d
--- /dev/null
+++ b/kopete/plugins/smpppdcs/smpppdsearcher.h
@@ -0,0 +1,102 @@
+/*
+ smpppdsearcher.h
+
+ Copyright (c) 2004-2006 by Heiko Schaefer <[email protected]>
+
+ Kopete (c) 2002-2006 by the Kopete developers <[email protected]>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; version 2 of the License. *
+ * *
+ *************************************************************************
+*/
+
+
+#ifndef SMPPPDSEARCHER_H
+#define SMPPPDSEARCHER_H
+
+#include <kresolver.h>
+
+class KProcess;
+
+/**
+ * @brief Searches a network for a smpppd
+ *
+ * @todo Use of the SLP to find the smpppd
+ * @author Heiko Sch&auml;fer <[email protected]>
+ */
+class SMPPPDSearcher : public QObject {
+ Q_OBJECT
+
+ SMPPPDSearcher(const SMPPPDSearcher&);
+ SMPPPDSearcher& operator=(const SMPPPDSearcher&);
+
+public:
+ /**
+ * @brief Creates an <code>SMPPPDSearcher</code> instance
+ */
+ SMPPPDSearcher();
+
+ /**
+ * @brief Destroys an <code>SMPPPDSearcher</code> instance
+ */
+ ~SMPPPDSearcher();
+
+ /**
+ * @brief Triggers a network scan to find a smpppd
+ * @see smpppdFound
+ * @see smpppdNotFound
+ */
+ void searchNetwork();
+
+ void cancelSearch();
+
+protected:
+ /**
+ * @brief Scans a network for a smpppd
+ *
+ * Scans a network for a smpppd described by
+ * ip and mask.
+ *
+ * @param ip the ntwork ip
+ * @param mask the network mask
+ * @return <code>TRUE</code> if an smpppd was found
+ */
+ bool scan(const QString& ip, const QString& mask);
+
+signals:
+ /**
+ * @brief A smppd was found
+ *
+ * @param host the host there the smpppd was found
+ */
+ void smpppdFound(const QString& host);
+
+ /**
+ * @brief No smpppd was found
+ */
+ void smpppdNotFound();
+
+ void scanStarted(uint total);
+ void scanProgress(uint cur);
+ void scanFinished();
+
+protected slots:
+ void slotStdoutReceivedIfconfig(KProcess * proc, char * buf, int len);
+ void slotStdoutReceivedNetstat (KProcess * proc, char * buf, int len);
+
+private:
+ bool m_cancelSearchNow;
+ KProcess * m_procIfconfig;
+ KProcess * m_procNetstat;
+};
+
+inline void SMPPPDSearcher::cancelSearch() {
+ m_cancelSearchNow = TRUE;
+}
+
+#endif
+