PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/quassel-0.7.3/src/core/coreirclisthelper.h

#
C Header | 63 lines | 29 code | 15 blank | 19 comment | 0 complexity | 7dfbd6230ce368a20cfe930c75caf90d MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0
  1. /***************************************************************************
  2. * Copyright (C) 2005-09 by the Quassel Project *
  3. * devel@quassel-irc.org *
  4. * *
  5. * This program is free software; you can redistribute it and/or modify *
  6. * it under the terms of the GNU General Public License as published by *
  7. * the Free Software Foundation; either version 2 of the License, or *
  8. * (at your option) version 3. *
  9. * *
  10. * This program is distributed in the hope that it will be useful, *
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  13. * GNU General Public License for more details. *
  14. * *
  15. * You should have received a copy of the GNU General Public License *
  16. * along with this program; if not, write to the *
  17. * Free Software Foundation, Inc., *
  18. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
  19. ***************************************************************************/
  20. #ifndef COREIRCLISTHELPER_H
  21. #define COREIRCLISTHELPER_H
  22. #include "irclisthelper.h"
  23. #include "coresession.h"
  24. class QTimerEvent;
  25. class CoreIrcListHelper : public IrcListHelper {
  26. SYNCABLE_OBJECT
  27. Q_OBJECT
  28. public:
  29. inline CoreIrcListHelper(CoreSession *coreSession) : IrcListHelper(coreSession), _coreSession(coreSession) {};
  30. inline virtual const QMetaObject *syncMetaObject() const { return &IrcListHelper::staticMetaObject; }
  31. inline CoreSession *coreSession() const { return _coreSession; }
  32. inline bool requestInProgress(const NetworkId &netId) const { return _channelLists.contains(netId); }
  33. public slots:
  34. virtual QVariantList requestChannelList(const NetworkId &netId, const QStringList &channelFilters);
  35. bool addChannel(const NetworkId &netId, const QString &channelName, quint32 userCount, const QString &topic);
  36. bool endOfChannelList(const NetworkId &netId);
  37. protected:
  38. void timerEvent(QTimerEvent *event);
  39. private:
  40. bool dispatchQuery(const NetworkId &netId, const QString &query);
  41. private:
  42. CoreSession *_coreSession;
  43. QHash<NetworkId, QString> _queuedQuery;
  44. QHash<NetworkId, QList<ChannelDescription> > _channelLists;
  45. QHash<NetworkId, QVariantList> _finishedChannelLists;
  46. QHash<int, NetworkId> _queryTimeout;
  47. };
  48. #endif //COREIRCLISTHELPER_H