From a2520bae3677be9df0abcef7681a138a6c4ad849 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 14 Jun 2020 17:23:54 +0200 Subject: quotient_common.h for common namespace things The two main cases for this header file are: * namespace QMatrixClient = Quotient should occur exactly once, to respect ODR. * Q_NAMESPACE for namespace Quotient (to enable Q_ENUM_NS, particularly) must be defined exactly once, for the same reason. --- lib/quotient_common.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/quotient_common.h (limited to 'lib/quotient_common.h') diff --git a/lib/quotient_common.h b/lib/quotient_common.h new file mode 100644 index 00000000..44541b42 --- /dev/null +++ b/lib/quotient_common.h @@ -0,0 +1,29 @@ +#pragma once + +#include + +namespace Quotient { +Q_NAMESPACE + +/** Enumeration with flags defining the network job running policy + * So far only background/foreground flags are available. + * + * \sa Connection::callApi, Connection::run + */ +enum RunningPolicy { ForegroundRequest = 0x0, BackgroundRequest = 0x1 }; + +Q_ENUM_NS(RunningPolicy) + +enum ResourceResolveResult : short { + StillResolving = -1, + Resolved = 0, + UnknownMatrixId, + MalformedMatrixId, + NoAccount, + EmptyMatrixId +}; +Q_ENUM_NS(ResourceResolveResult) + +} // namespace Quotient +/// \deprecated Use namespace Quotient instead +namespace QMatrixClient = Quotient; -- cgit v1.2.3