1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
/***************************************************************************
* *
* 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 3 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#pragma once
#include <QObject>
#include <QStringList>
#include "dcpp/stdinc.h"
#include "dcpp/DCPlusPlus.h"
#include "dcpp/Singleton.h"
#include "dcpp/ClientManager.h"
#include "dcpp/Client.h"
#include "dcpp/ClientManagerListener.h"
class ClientManagerScript :
public QObject,
public dcpp::Singleton<ClientManagerScript>,
public dcpp::ClientManagerListener
{
Q_OBJECT
friend class dcpp::Singleton<ClientManagerScript>;
public Q_SLOTS:
quint64 getUserCount() const;
quint64 getAvailable() const;
QStringList getHubs(const QString& cid) const;
QStringList getHubNames(const QString& cid) const;
QStringList getHubNames(const QString& cid, const QString& hubUrl) const;
QStringList getNicks(const QString& cid) const;
QStringList getConnectedHubs() const;
QString getConnection(const QString& cid) const;
bool isConnected(const QString& aUrl) const;
bool isActive() const;
void sendPM(const QString &cid, const QString &hubUrl, const QString &msg);
QString getMyCID() const;
Q_SIGNALS:
void connected(const QString &url);
void updated(const QString &url);
void disconnected(const QString &url);
protected:
virtual void on(ClientConnected, dcpp::Client*) throw();
virtual void on(ClientUpdated, dcpp::Client*) throw();
virtual void on(ClientDisconnected, dcpp::Client*) throw();
private:
ClientManagerScript(QObject *parent = 0);
ClientManagerScript(const ClientManagerScript&) {}
~ClientManagerScript();
ClientManagerScript &operator =(const ClientManagerScript&) { return *this; }
dcpp::ClientManager *CM;
};
|