From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- kopete/plugins/smpppdcs/smpppdsearcher.h | 102 +++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 kopete/plugins/smpppdcs/smpppdsearcher.h (limited to 'kopete/plugins/smpppdcs/smpppdsearcher.h') 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 + + Kopete (c) 2002-2006 by the Kopete developers + + ************************************************************************* + * * + * 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 + +class KProcess; + +/** + * @brief Searches a network for a smpppd + * + * @todo Use of the SLP to find the smpppd + * @author Heiko Schäfer + */ +class SMPPPDSearcher : public QObject { + Q_OBJECT + + SMPPPDSearcher(const SMPPPDSearcher&); + SMPPPDSearcher& operator=(const SMPPPDSearcher&); + +public: + /** + * @brief Creates an SMPPPDSearcher instance + */ + SMPPPDSearcher(); + + /** + * @brief Destroys an SMPPPDSearcher 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 TRUE 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 + -- cgit v1.2.1