QtDataSync
4.2.0
A simple offline-first synchronisation framework, to synchronize data of Qt applications between devices
|
A class to manage background synchronization for android. More...
#include <androidsynccontrol.h>
Public Slots | |
void | setServiceId (QString serviceId) |
WRITE accessor for AndroidSyncControl::serviceId. | |
void | setInterval (qint64 interval) |
WRITE accessor for AndroidSyncControl::interval. | |
void | setEnabled (bool enabled) |
WRITE accessor for AndroidSyncControl::enabled. | |
bool | triggerSyncNow () |
Immediatly triggers a background synchronization. More... | |
Signals | |
void | validChanged (QPrivateSignal) |
NOTIFY accessor for AndroidSyncControl::valid. | |
void | serviceIdChanged (const QString &serviceId, QPrivateSignal) |
NOTIFY accessor for AndroidSyncControl::serviceId. | |
void | intervalChanged (qint64 interval, QPrivateSignal) |
NOTIFY accessor for AndroidSyncControl::interval. | |
Public Member Functions | |
AndroidSyncControl (QObject *parent=nullptr) | |
Default constructor. | |
AndroidSyncControl (QString serviceId, QObject *parent=nullptr) | |
Constructor with a service class. | |
bool | isValid () const |
READ accessor for AndroidSyncControl::valid. | |
QString | serviceId () const |
READ accessor for AndroidSyncControl::serviceId. | |
qint64 | interval () const |
READ accessor for AndroidSyncControl::interval. | |
std::chrono::minutes | intervalMinutes () const |
READ accessor for AndroidSyncControl::interval. | |
bool | isEnabled () const |
READ accessor for AndroidSyncControl::enabled. | |
template<typename TRep , typename TPeriod > | |
void | setInterval (const std::chrono::duration< TRep, TPeriod > &interval) |
WRITE accessor for AndroidSyncControl::interval. | |
void | setInterval (std::chrono::minutes interval) |
WRITE accessor for AndroidSyncControl::interval. | |
Public Member Functions inherited from QObject | |
virtual const QMetaObject * | metaObject () const const |
virtual void * | qt_metacast (const char *) |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Properties | |
bool | valid |
Holds whether the sync control is able to configure background sync. More... | |
QString | serviceId |
The JAVA class name of the service to be used to do the background sync. More... | |
qint64 | interval |
The interval in minutes between synchronizations. More... | |
bool | enabled |
Specify if background synchronization is enabled or not. More... | |
Properties inherited from QObject | |
objectName | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
A class to manage background synchronization for android.
This class is part of the QtDataSyncAndroid
module, which is only available on the android platform. It can be used to configure background synchronization so that your application is able to update it's internal data periodically in the background, even if your app is not actively used.
Definition at line 15 of file androidsynccontrol.h.
|
slot |
Immediatly triggers a background synchronization.
|
readwrite |
Specify if background synchronization is enabled or not.
Default: false
These property directly communicates with the OS and schedules (or unschedules) the task to run the service. This means you must always set serviceId and interval first before enabling a service
Accessors | |
---|---|
READ | isEnabled() |
WRITE | setEnabled() |
Definition at line 28 of file androidsynccontrol.h.
|
readwrite |
The interval in minutes between synchronizations.
Default: 60
(minutes)
This value is passed to the operating system to schedule the background synchronization. There is no guarantee of exact delivery of those background synchronizations. It is only a suggestion to the system. However, android typically keeps the windows limited to twice the length of the interval.
Accessors | |
---|---|
READ | interval() |
READ | intervalMinutes() |
WRITE | setInterval() |
NOTIFY | intervalChanged() |
Definition at line 25 of file androidsynccontrol.h.
|
readwrite |
The JAVA class name of the service to be used to do the background sync.
Default: "de.skycoder42.qtservice.AndroidService"
The JAVA class name (not JNI name) of the android service that should be run to perform the background synchronization. The class must exist and must be declared as service in your AndroidManifest.xml
Accessors | |
---|---|
READ | serviceId() |
WRITE | setServiceId() |
NOTIFY | serviceIdChanged() |
Definition at line 23 of file androidsynccontrol.h.
|
read |
Holds whether the sync control is able to configure background sync.
Default: false
Validity basically comes down to whether there is a background service that matches the given serviceId. Only if the control is valid, it is possible to actually do anything with this class
Accessors | |
---|---|
READ | isValid() |
NOTIFY | validChanged() |
Definition at line 20 of file androidsynccontrol.h.