1 /***************************************************************************
2 * Copyright (C) 2005-07 by The Quassel IRC Development Team *
3 * devel@quassel-irc.org *
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) any later version. *
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. *
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 ***************************************************************************/
28 class SignalProxy : public QObject {
33 enum ProxyType { Client, Server };
35 SignalProxy(ProxyType type, QIODevice *device = 0, QObject *parent = 0);
38 ProxyType proxyType() const { return type; }
39 void attachSignal(QObject* sender, const char* signal, const QByteArray& rpcFunction = QByteArray());
40 void attachSlot(const QByteArray& rpcFunction, QObject* recv, const char* slot);
43 void addPeer(QIODevice *device);
45 void sendSignal(const char *signal, QVariant p1 = QVariant(), QVariant p2 = QVariant(), QVariant p3 = QVariant(), QVariant p4 = QVariant(),
46 QVariant p5 = QVariant(), QVariant p6 = QVariant(), QVariant p7 = QVariant(), QVariant p8 = QVariant(), QVariant p9 = QVariant());
48 //void detachSender();
49 void detachObject(QObject *);
52 void peerDisconnected();
55 void socketDisconnected();
59 QPointer<QxtRPCPeer> peer;
60 QPointer<QIODevice> device;
66 QByteArray rpcFunction;
68 SignalDesc(QObject *sndr, const char *sig, const QByteArray &func) : sender(sndr), signal(sig), rpcFunction(func) {}
72 QByteArray rpcFunction;
76 SlotDesc(const QByteArray& func, QObject* r, const char* s) : rpcFunction(func), recv(r), slot(s) {}
80 QList<Connection> peers;
81 QList<SignalDesc> attachedSignals;
82 QList<SlotDesc> attachedSlots;