1 #ifndef SYNCTHINGCONNECTION_STATUS_H
2 #define SYNCTHINGCONNECTION_STATUS_H
3 
4 #include "./global.h"
5 
6 #include <QObject>
7 
8 namespace Data {
9 #undef Q_NAMESPACE
10 #define Q_NAMESPACE
11 Q_NAMESPACE
12 extern LIB_SYNCTHING_CONNECTOR_EXPORT const QMetaObject staticMetaObject;
13 QT_ANNOTATE_CLASS(qt_qnamespace, "") /*end*/
14 
15 /*!
16  * \brief The SyncthingStatus enum specifies the overall status of the connection to Syncthing via its REST-API.
17  *
18  * Scanning, paused and (remote) synchronizing are only computed if the SyncthingStatusComputionFlags are set for
19  * these.
20  *
21  * This is *not* a flag enum even though the "connected" states are not exclusive. That's because only one icon can be
22  * shown at the same time anyways. Checkout SyncthingConnection::setStatus() for the precedence.
23  */
24 enum class SyncthingStatus {
25     Disconnected = 0, /**< disconnected, possibly currently connecting */
26     Reconnecting = 1, /**< disconnected, currently re-connnecting */
27     BeingDestroyed = 7, /**< status is unknown; the SyncthingConnnection object is being destroyed anyways */
28     Idle = 2, /**< connected, no special status information available/determined */
29     Scanning = 3, /**< connected, at least one directory is scanning */
30     Paused = 4, /**< connected, at least one device is paused */
31     Synchronizing = 5, /**< connected, at least one local directory is waiting to sync, preparing to sync or synchronizing */
32     RemoteNotInSync = 8, /**< connected, at least one directory of a connected remote device is not in sync (still synchronizing, error, …) */
33 };
34 #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
35 Q_ENUM_NS(SyncthingStatus)
36 #endif
37 
38 /*!
39  * \brief The SyncthingErrorCategory enum classifies different errors related to the SyncthingConnection class.
40  */
41 enum class SyncthingErrorCategory {
42     OverallConnection, /**< an error affecting the overall connection */
43     SpecificRequest, /**< an error only affecting a specific request */
44     Parsing, /**< an error when parsing Syncthing's response as a JSON document */
45 };
46 #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
47 Q_ENUM_NS(SyncthingErrorCategory)
48 #endif
49 
50 } // namespace Data
51 
52 #endif // SYNCTHINGCONNECTION_STATUS_H
53