1 #ifndef QTDATASYNC_USEREXCHANGEMANAGER_H 2 #define QTDATASYNC_USEREXCHANGEMANAGER_H 4 #include <QtCore/qobject.h> 5 #include <QtCore/qscopedpointer.h> 6 #include <QtCore/qshareddata.h> 8 #include <QtNetwork/qhostaddress.h> 10 #include "QtDataSync/qtdatasync_global.h" 16 class UserInfoPrivate;
21 friend class UserInfoPrivate;
24 Q_PROPERTY(
QString name READ name CONSTANT)
28 Q_PROPERTY(quint16 port READ port CONSTANT)
53 bool operator==(const
UserInfo &other) const;
55 bool operator!=(const
UserInfo &other) const;
61 class UserExchangeManagerPrivate;
68 Q_PROPERTY(
QString setupName READ setupName NOTIFY setupNameChanged REVISION 2)
70 Q_PROPERTY(
bool active READ isActive NOTIFY activeChanged)
76 static const quint16 DataExchangePort;
94 bool isActive() const;
104 const
std::function<
void(
bool,
QString)> &completedFn,
105 bool keepData = false);
109 const
std::function<
void(
bool,
QString)> &completedFn,
110 bool keepData = false);
114 inline
bool startExchange(quint16 port = DataExchangePort) {
115 return startExchange(QHostAddress::Any, port);
118 bool startExchange(
const QHostAddress &listenAddress, quint16 port = DataExchangePort);
126 void exchangeError(
const QString &errorString, QPrivateSignal);
129 QT_DATASYNC_REVISION_2
void setupNameChanged(
const QString &setupName, QPrivateSignal);
131 void activeChanged(
bool active, QPrivateSignal);
159 #endif // QTDATASYNC_USEREXCHANGEMANAGER_H
Manages devices that belong to the users account.
A helper class to exchange the account data between devices on the local network. ...
Q_DATASYNC_EXPORT QDataStream & operator<<(QDataStream &stream, const DeviceInfo &deviceInfo)
Stream operator to stream into a QDataStream.
The primary namespace of the QtDataSync library.
uint Q_DATASYNC_EXPORT qHash(const ObjectKey &key, uint seed=0)
Overload of qHash to use ObjectKey with QHash.
Provides information about a detected exchange user.