diff options
Diffstat (limited to 'common/domain/applicationdomaintype.cpp')
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 35 |
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 | ||
27 | SINK_DEBUG_AREA("applicationdomaintype"); | 28 | SINK_DEBUG_AREA("applicationdomaintype"); |
28 | 29 | ||
30 | template <typename DomainType, typename Property> | ||
31 | int 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 | |||
29 | namespace Sink { | 40 | namespace Sink { |
30 | namespace ApplicationDomain { | 41 | namespace ApplicationDomain { |
31 | 42 | ||
32 | constexpr const char *Mail::ThreadId::name; | 43 | SINK_REGISTER_PROPERTY(Mail, Sender); |
33 | constexpr const char *Mail::Folder::name; | 44 | SINK_REGISTER_PROPERTY(Mail, To); |
45 | SINK_REGISTER_PROPERTY(Mail, Cc); | ||
46 | SINK_REGISTER_PROPERTY(Mail, Bcc); | ||
47 | SINK_REGISTER_PROPERTY(Mail, Subject); | ||
48 | SINK_REGISTER_PROPERTY(Mail, Date); | ||
49 | SINK_REGISTER_PROPERTY(Mail, Unread); | ||
50 | SINK_REGISTER_PROPERTY(Mail, Important); | ||
51 | SINK_REGISTER_PROPERTY(Mail, Folder); | ||
52 | SINK_REGISTER_PROPERTY(Mail, MimeMessage); | ||
53 | SINK_REGISTER_PROPERTY(Mail, FullPayloadAvailable); | ||
54 | SINK_REGISTER_PROPERTY(Mail, Draft); | ||
55 | SINK_REGISTER_PROPERTY(Mail, Trash); | ||
56 | SINK_REGISTER_PROPERTY(Mail, Sent); | ||
57 | SINK_REGISTER_PROPERTY(Mail, MessageId); | ||
58 | SINK_REGISTER_PROPERTY(Mail, ParentMessageId); | ||
59 | SINK_REGISTER_PROPERTY(Mail, ThreadId); | ||
60 | |||
61 | SINK_REGISTER_PROPERTY(Folder, Name); | ||
62 | SINK_REGISTER_PROPERTY(Folder, Icon); | ||
63 | SINK_REGISTER_PROPERTY(Folder, SpecialPurpose); | ||
64 | SINK_REGISTER_PROPERTY(Folder, Enabled); | ||
34 | 65 | ||
35 | static const int foo = [] { | 66 | static const int foo = [] { |
36 | QMetaType::registerEqualsComparator<Reference>(); | 67 | QMetaType::registerEqualsComparator<Reference>(); |