diff options
Diffstat (limited to 'common/domain')
-rw-r--r-- | common/domain/applicationdomaintype.h | 12 | ||||
-rw-r--r-- | common/domain/mail.cpp | 6 | ||||
-rw-r--r-- | common/domain/mail.fbs | 11 |
3 files changed, 22 insertions, 7 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 39ce2b9..b377db9 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -271,10 +271,17 @@ struct SINK_EXPORT Folder : public Entity { | |||
271 | }; | 271 | }; |
272 | 272 | ||
273 | struct SINK_EXPORT Mail : public Entity { | 273 | struct SINK_EXPORT Mail : public Entity { |
274 | struct SINK_EXPORT Contact { | ||
275 | QString name; | ||
276 | QString emailAddress; | ||
277 | }; | ||
278 | |||
274 | SINK_ENTITY(Mail); | 279 | SINK_ENTITY(Mail); |
275 | SINK_PROPERTY(QString, Uid, uid); | 280 | SINK_PROPERTY(QString, Uid, uid); |
276 | SINK_EXTRACTED_PROPERTY(QString, Sender, sender); | 281 | SINK_PROPERTY(Contact, Sender, sender); |
277 | SINK_EXTRACTED_PROPERTY(QString, SenderName, senderName); | 282 | SINK_PROPERTY(QList<Contact>, To, to); |
283 | SINK_PROPERTY(QList<Contact>, Cc, cc); | ||
284 | SINK_PROPERTY(QList<Contact>, Bcc, bcc); | ||
278 | SINK_EXTRACTED_PROPERTY(QString, Subject, subject); | 285 | SINK_EXTRACTED_PROPERTY(QString, Subject, subject); |
279 | SINK_EXTRACTED_PROPERTY(QDateTime, Date, date); | 286 | SINK_EXTRACTED_PROPERTY(QDateTime, Date, date); |
280 | SINK_PROPERTY(bool, Unread, unread); | 287 | SINK_PROPERTY(bool, Unread, unread); |
@@ -417,5 +424,6 @@ Q_DECLARE_METATYPE(Sink::ApplicationDomain::SinkAccount) | |||
417 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::SinkAccount::Ptr) | 424 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::SinkAccount::Ptr) |
418 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Identity) | 425 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Identity) |
419 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Identity::Ptr) | 426 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Identity::Ptr) |
427 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Mail::Contact) | ||
420 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Error) | 428 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Error) |
421 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Progress) | 429 | Q_DECLARE_METATYPE(Sink::ApplicationDomain::Progress) |
diff --git a/common/domain/mail.cpp b/common/domain/mail.cpp index ee58928..5a77681 100644 --- a/common/domain/mail.cpp +++ b/common/domain/mail.cpp | |||
@@ -38,7 +38,7 @@ void TypeImplementation<Mail>::configure(TypeIndex &index) | |||
38 | { | 38 | { |
39 | index.addProperty<QByteArray>(Mail::Uid::name); | 39 | index.addProperty<QByteArray>(Mail::Uid::name); |
40 | index.addProperty<QByteArray>(Mail::Sender::name); | 40 | index.addProperty<QByteArray>(Mail::Sender::name); |
41 | index.addProperty<QByteArray>(Mail::SenderName::name); | 41 | /* index.addProperty<QByteArray>(Mail::SenderName::name); */ |
42 | /* index->addProperty<QString>(Mail::Subject::name); */ | 42 | /* index->addProperty<QString>(Mail::Subject::name); */ |
43 | /* index->addFulltextProperty<QString>(Mail::Subject::name); */ | 43 | /* index->addFulltextProperty<QString>(Mail::Subject::name); */ |
44 | index.addProperty<QDateTime>(Mail::Date::name); | 44 | index.addProperty<QDateTime>(Mail::Date::name); |
@@ -68,7 +68,7 @@ void TypeImplementation<Mail>::configure(ReadPropertyMapper<Buffer> &propertyMap | |||
68 | { | 68 | { |
69 | propertyMapper.addMapping<Mail::Uid, Buffer>(&Buffer::uid); | 69 | propertyMapper.addMapping<Mail::Uid, Buffer>(&Buffer::uid); |
70 | propertyMapper.addMapping<Mail::Sender, Buffer>(&Buffer::sender); | 70 | propertyMapper.addMapping<Mail::Sender, Buffer>(&Buffer::sender); |
71 | propertyMapper.addMapping<Mail::SenderName, Buffer>(&Buffer::senderName); | 71 | /* propertyMapper.addMapping<Mail::Recepients, Buffer>(&Buffer::recepients); */ |
72 | propertyMapper.addMapping<Mail::Subject, Buffer>(&Buffer::subject); | 72 | propertyMapper.addMapping<Mail::Subject, Buffer>(&Buffer::subject); |
73 | propertyMapper.addMapping<Mail::Date, Buffer>(&Buffer::date); | 73 | propertyMapper.addMapping<Mail::Date, Buffer>(&Buffer::date); |
74 | propertyMapper.addMapping<Mail::Unread, Buffer>(&Buffer::unread); | 74 | propertyMapper.addMapping<Mail::Unread, Buffer>(&Buffer::unread); |
@@ -86,7 +86,7 @@ void TypeImplementation<Mail>::configure(WritePropertyMapper<BufferBuilder> &pro | |||
86 | { | 86 | { |
87 | propertyMapper.addMapping<Mail::Uid>(&BufferBuilder::add_uid); | 87 | propertyMapper.addMapping<Mail::Uid>(&BufferBuilder::add_uid); |
88 | propertyMapper.addMapping<Mail::Sender>(&BufferBuilder::add_sender); | 88 | propertyMapper.addMapping<Mail::Sender>(&BufferBuilder::add_sender); |
89 | propertyMapper.addMapping<Mail::SenderName>(&BufferBuilder::add_senderName); | 89 | /* propertyMapper.addMapping<Mail::Recepients>(&BufferBuilder::add_senderName); */ |
90 | propertyMapper.addMapping<Mail::Subject>(&BufferBuilder::add_subject); | 90 | propertyMapper.addMapping<Mail::Subject>(&BufferBuilder::add_subject); |
91 | propertyMapper.addMapping<Mail::Date>(&BufferBuilder::add_date); | 91 | propertyMapper.addMapping<Mail::Date>(&BufferBuilder::add_date); |
92 | propertyMapper.addMapping<Mail::Unread>(&BufferBuilder::add_unread); | 92 | propertyMapper.addMapping<Mail::Unread>(&BufferBuilder::add_unread); |
diff --git a/common/domain/mail.fbs b/common/domain/mail.fbs index f14e9f1..737a671 100644 --- a/common/domain/mail.fbs +++ b/common/domain/mail.fbs | |||
@@ -1,10 +1,17 @@ | |||
1 | namespace Sink.ApplicationDomain.Buffer; | 1 | namespace Sink.ApplicationDomain.Buffer; |
2 | 2 | ||
3 | table MailContact { | ||
4 | name: string; | ||
5 | email: string; | ||
6 | } | ||
7 | |||
3 | table Mail { | 8 | table Mail { |
4 | uid:string; | 9 | uid:string; |
5 | folder:string; | 10 | folder:string; |
6 | sender:string; | 11 | sender:MailContact; |
7 | senderName:string; | 12 | to:[MailContact]; |
13 | cc:[MailContact]; | ||
14 | bcc:[MailContact]; | ||
8 | subject:string; | 15 | subject:string; |
9 | date:string; | 16 | date:string; |
10 | unread:bool = false; | 17 | unread:bool = false; |