1 #ifndef QTDATASYNC_SYNCMANAGER_H 2 #define QTDATASYNC_SYNCMANAGER_H 6 #include <QtCore/qobject.h> 7 #include <QtCore/qscopedpointer.h> 8 #include <QtCore/quuid.h> 10 #include "QtDataSync/qtdatasync_global.h" 14 class SyncManagerPrivateReplica;
18 class SyncManagerPrivateHolder;
25 Q_PROPERTY(
QString setupName READ setupName NOTIFY setupNameChanged REVISION 2)
27 Q_PROPERTY(
bool syncEnabled READ isSyncEnabled WRITE setSyncEnabled NOTIFY syncEnabledChanged)
29 Q_PROPERTY(
SyncState syncState READ syncState NOTIFY syncStateChanged)
31 Q_PROPERTY(qreal syncProgress READ syncProgress NOTIFY syncProgressChanged)
33 Q_PROPERTY(
QString lastError READ lastError NOTIFY lastErrorChanged)
61 bool isSyncEnabled()
const;
63 SyncState syncState()
const;
65 qreal syncProgress()
const;
70 void runOnDownloaded(
const std::function<
void(SyncState)> &resultFn,
bool triggerSync =
true);
72 void runOnSynchronized(
const std::function<
void(SyncState)> &resultFn,
bool triggerSync =
true);
76 void setSyncEnabled(
bool syncEnabled);
85 QT_DATASYNC_REVISION_2
void setupNameChanged(
const QString &setupName, QPrivateSignal);
87 void syncEnabledChanged(
bool syncEnabled, QPrivateSignal);
91 void syncProgressChanged(qreal syncProgress, QPrivateSignal);
93 void lastErrorChanged(
const QString &lastError, QPrivateSignal);
99 void initReplica(
const QString &setupName);
105 void onStateReached(
QUuid id, SyncState state);
110 void runImp(
bool downloadOnly,
bool triggerSync,
const std::function<
void(SyncState)> &resultFn);
123 #endif // QTDATASYNC_SYNCMANAGER_H
Uploading changes to the remote.
Downloading changes from the remote.
An internal error occured. Synchronization is paused until reconnect() is called. ...
Q_DATASYNC_EXPORT QDataStream & operator<<(QDataStream &stream, const DeviceInfo &deviceInfo)
Stream operator to stream into a QDataStream.
Initializing internal stuff and connecting to a remote.
The primary namespace of the QtDataSync library.
SyncState
The possible states the sync engine can be in.
All changes have been synchronized. The engine is idle.
Q_DATASYNC_EXPORT QDataStream & operator>>(QDataStream &stream, DeviceInfo &deviceInfo)
Stream operator to stream out of a QDataStream.
Manages the synchronization process and reports its state.