summaryrefslogtreecommitdiffstats
path: root/common/domain/applicationdomaintype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/domain/applicationdomaintype.cpp')
-rw-r--r--common/domain/applicationdomaintype.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp
index 29b50b9..4bd17fe 100644
--- a/common/domain/applicationdomaintype.cpp
+++ b/common/domain/applicationdomaintype.cpp
@@ -21,16 +21,47 @@
21#include "log.h" 21#include "log.h"
22#include "../bufferadaptor.h" 22#include "../bufferadaptor.h"
23#include "definitions.h" 23#include "definitions.h"
24#include "propertyregistry.h"
24#include "storage.h" //for generateUid() 25#include "storage.h" //for generateUid()
25#include <QFile> 26#include <QFile>
26 27
27SINK_DEBUG_AREA("applicationdomaintype"); 28SINK_DEBUG_AREA("applicationdomaintype");
28 29
30template <typename DomainType, typename Property>
31int registerProperty() {
32 Sink::Private::PropertyRegistry::instance().registerProperty<Property>(Sink::ApplicationDomain::getTypeName<DomainType>());
33 return 0;
34}
35
36#define SINK_REGISTER_PROPERTY(ENTITYTYPE, PROPERTY) \
37 constexpr const char *ENTITYTYPE::PROPERTY::name; \
38 static int foo##ENTITYTYPE##PROPERTY = registerProperty<ENTITYTYPE, ENTITYTYPE::PROPERTY>();
39
29namespace Sink { 40namespace Sink {
30namespace ApplicationDomain { 41namespace ApplicationDomain {
31 42
32constexpr const char *Mail::ThreadId::name; 43SINK_REGISTER_PROPERTY(Mail, Sender);
33constexpr const char *Mail::Folder::name; 44SINK_REGISTER_PROPERTY(Mail, To);
45SINK_REGISTER_PROPERTY(Mail, Cc);
46SINK_REGISTER_PROPERTY(Mail, Bcc);
47SINK_REGISTER_PROPERTY(Mail, Subject);
48SINK_REGISTER_PROPERTY(Mail, Date);
49SINK_REGISTER_PROPERTY(Mail, Unread);
50SINK_REGISTER_PROPERTY(Mail, Important);
51SINK_REGISTER_PROPERTY(Mail, Folder);
52SINK_REGISTER_PROPERTY(Mail, MimeMessage);
53SINK_REGISTER_PROPERTY(Mail, FullPayloadAvailable);
54SINK_REGISTER_PROPERTY(Mail, Draft);
55SINK_REGISTER_PROPERTY(Mail, Trash);
56SINK_REGISTER_PROPERTY(Mail, Sent);
57SINK_REGISTER_PROPERTY(Mail, MessageId);
58SINK_REGISTER_PROPERTY(Mail, ParentMessageId);
59SINK_REGISTER_PROPERTY(Mail, ThreadId);
60
61SINK_REGISTER_PROPERTY(Folder, Name);
62SINK_REGISTER_PROPERTY(Folder, Icon);
63SINK_REGISTER_PROPERTY(Folder, SpecialPurpose);
64SINK_REGISTER_PROPERTY(Folder, Enabled);
34 65
35static const int foo = [] { 66static const int foo = [] {
36 QMetaType::registerEqualsComparator<Reference>(); 67 QMetaType::registerEqualsComparator<Reference>();