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 --- .../protocols/winpopup/libwinpopup/libwinpopup.h | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 kopete/protocols/winpopup/libwinpopup/libwinpopup.h (limited to 'kopete/protocols/winpopup/libwinpopup/libwinpopup.h') diff --git a/kopete/protocols/winpopup/libwinpopup/libwinpopup.h b/kopete/protocols/winpopup/libwinpopup/libwinpopup.h new file mode 100644 index 00000000..77f8b8a6 --- /dev/null +++ b/kopete/protocols/winpopup/libwinpopup/libwinpopup.h @@ -0,0 +1,92 @@ +/*************************************************************************** + libwinpopup.h - Base class for the WinPopup protocol + ------------------- + begin : Fri Apr 26 2002 + copyright : (C) 2002 by Gav Wood + email : gav@kde.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef LIBWINPOPUP_H +#define LIBWINPOPUP_H + +//QT includes +#include +#include +#include +#include +#include + +// KDE Includes +#include +#include + +const QString WP_POPUP_DIR = QString::fromLatin1("/var/lib/winpopup"); + +class KDirLister; + +typedef QMap stringMap; + +class WorkGroup +{ + QStringList groupHosts; + +public: + const QStringList &Hosts() { return groupHosts; } + void addHosts(const QStringList &newHosts) { groupHosts = newHosts; } +}; + +class WinPopupLib : public QObject +{ + Q_OBJECT + +public: + WinPopupLib(const QString &smbClient,int groupFreq); + ~WinPopupLib(); + + const QStringList getGroups(); + const QStringList getHosts(const QString &Group); + bool checkHost(const QString &Name); + void settingsChanged(const QString &smbClient, int groupFreq); + void sendMessage(const QString &Body, const QString &Destination); + +private: + bool passedInitialHost; + QMap theGroups, currentGroupsMap; + QString currentGroup, currentHost; + QStringList todo, done, currentHosts; + stringMap currentGroups; + QTimer updateGroupDataTimer; + QString smbClientBin; + int groupCheckFreq; + KDirLister *dirLister; + + void readMessages(const KFileItemList &items); + bool checkMessageDir(); + +private slots: + void slotUpdateGroupData(); + void startReadProcess(const QString &Host); + void slotReadProcessReady(KProcIO *r); + void slotReadProcessExited(KProcess *r); + void slotSendProcessExited(KProcess *p); + void slotStartDirLister(); + void slotListCompleted(); + void slotNewMessages(const KFileItemList &items); + +signals: + void signalNewMessage(const QString &, const QDateTime &, const QString &); +}; + +#endif + +// vim: set noet ts=4 sts=4 sw=4: +// kate: tab-width 4; indent-width 4; replace-trailing-space-save on; -- cgit v1.2.1