1 /***************************************************************************
2 * Copyright (C) 2005/06 by The Quassel 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 ***************************************************************************/
21 #ifndef _SYNCHRONIZER_H_
22 #define _SYNCHRONIZER_H_
29 #include <QVariantMap>
30 #include <QMetaMethod>
33 class Synchronizer : public QObject {
37 Synchronizer(QObject *parent, SignalProxy *signalproxy);
39 bool initialized() const;
40 SignalProxy *proxy() const;
42 QVariantMap initData() const;
43 void setInitData(const QVariantMap &properties);
46 void synchronizeClients() const;
47 void recvInitData(QVariantMap properties);
48 void parentChangedName();
51 void requestSync() const;
52 void sendInitData(QVariantMap properties) const;
57 QPointer<SignalProxy> _signalproxy;
59 QString signalPrefix() const;
60 QString initSignal() const;
61 QString requestSyncSignal() const;
63 QString methodBaseName(const QMetaMethod &method) const;
64 bool methodsMatch(const QMetaMethod &signal, const QMetaMethod &slot) const;
66 QList<QMetaProperty> parentProperties() const;
67 QList<QMetaMethod> parentSlots() const;
68 QList<QMetaMethod> parentSignals() const;
70 QList<QMetaMethod> getMethodByName(const QString &methodname);
74 void attachAsMaster();
76 bool setInitValue(const QString &property, const QVariant &value);