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 ***************************************************************************/
24 #include "qxtrpcpeer.h"
27 class SignalProxy : public QObject {
32 enum ProxyType { Client, Server };
34 SignalProxy(ProxyType type, QIODevice *device = 0, QObject *parent = 0);
37 ProxyType proxyType() const { return type; }
38 void attachSignal(QObject* sender, const char* signal, const QByteArray& rpcFunction = QByteArray());
39 void attachSlot(const QByteArray& rpcFunction, QObject* recv, const char* slot);
42 void addPeer(QIODevice *device);
44 void sendSignal(const char *signal, QVariant p1 = QVariant(), QVariant p2 = QVariant(), QVariant p3 = QVariant(), QVariant p4 = QVariant(),
45 QVariant p5 = QVariant(), QVariant p6 = QVariant(), QVariant p7 = QVariant(), QVariant p8 = QVariant(), QVariant p9 = QVariant());
47 //void detachSender();
48 void detachObject(QObject *);
51 void peerDisconnected();
54 void socketDisconnected();
58 QPointer<QxtRPCPeer> peer;
59 QPointer<QIODevice> device;
65 QByteArray rpcFunction;
67 SignalDesc(QObject *sndr, const char *sig, const QByteArray &func) : sender(sndr), signal(sig), rpcFunction(func) {}
71 QByteArray rpcFunction;
75 SlotDesc(const QByteArray& func, QObject* r, const char* s) : rpcFunction(func), recv(r), slot(s) {}
79 QList<Connection> peers;
80 QList<SignalDesc> attachedSignals;
81 QList<SlotDesc> attachedSlots;