From 9ea268a6d0f4054c31b2729ecd6cfcc9d07a2d6a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 24 Mar 2017 22:15:18 +0100 Subject: Implemented notification support in the model. This will allow us to fold things like progress and sync status directly into the model. Usecases are mail download progress and folder sync progress. Ideally we would also solve the resource/account state through this. --- common/domain/applicationdomaintype.h | 48 ++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'common/domain') diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index ef38d58..6fd2b90 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h @@ -93,7 +93,7 @@ namespace Sink { namespace ApplicationDomain { -enum ErrorCode { +enum SINK_EXPORT ErrorCode { NoError = 0, UnknownError, NoServerError, @@ -101,10 +101,33 @@ enum ErrorCode { TransmissionError, }; -enum SuccessCode { +enum SINK_EXPORT SuccessCode { TransmissionSuccess }; +enum SINK_EXPORT SyncStatus { + NoSyncStatus, + SyncInProgress, + SyncError, + SyncSuccess +}; + +/** + * The status of an account or resource. + * + * It is set as follows: + * * By default the status is offline. + * * If a connection to the server could be established the status is Connected. + * * If an error occurred that keeps the resource from operating (so non transient), the resource enters the error state. + * * If a long running operation is started the resource goes to the busy state (and return to the previous state after that). + */ +enum SINK_EXPORT Status { + OfflineStatus, + ConnectedStatus, + BusyStatus, + ErrorStatus +}; + struct SINK_EXPORT Error { }; @@ -113,6 +136,11 @@ struct SINK_EXPORT Progress { }; +/** + * Internal type. + * + * Represents a BLOB property. + */ struct BLOB { BLOB() = default; BLOB(const BLOB &) = default; @@ -410,22 +438,6 @@ struct SINK_EXPORT Mail : public Entity { SINK_EXPORT QDebug operator<< (QDebug d, const Mail::Contact &c); -/** - * The status of an account or resource. - * - * It is set as follows: - * * By default the status is offline. - * * If a connection to the server could be established the status is Connected. - * * If an error occurred that keeps the resource from operating (so non transient), the resource enters the error state. - * * If a long running operation is started the resource goes to the busy state (and return to the previous state after that). - */ -enum SINK_EXPORT Status { - OfflineStatus, - ConnectedStatus, - BusyStatus, - ErrorStatus -}; - struct SINK_EXPORT Identity : public ApplicationDomainType { static constexpr const char *name = "identity"; typedef QSharedPointer Ptr; -- cgit v1.2.3