diff options
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 28 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.h | 8 | ||||
-rw-r--r-- | common/facadefactory.cpp | 1 | ||||
-rw-r--r-- | common/resourcefacade.cpp | 7 | ||||
-rw-r--r-- | common/resourcefacade.h | 6 | ||||
-rw-r--r-- | docs/applicationdomaintypes.md | 13 |
6 files changed, 63 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 7549a31..73143e8 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -186,6 +186,28 @@ SinkAccount::~SinkAccount() | |||
186 | 186 | ||
187 | } | 187 | } |
188 | 188 | ||
189 | Identity::Identity(const QByteArray &identifier) | ||
190 | : ApplicationDomainType("", identifier, 0, QSharedPointer<BufferAdaptor>(new MemoryBufferAdaptor())) | ||
191 | { | ||
192 | |||
193 | } | ||
194 | |||
195 | Identity::Identity(const QByteArray &, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) | ||
196 | : ApplicationDomainType("", identifier, 0, adaptor) | ||
197 | { | ||
198 | } | ||
199 | |||
200 | Identity::Identity() | ||
201 | : ApplicationDomainType() | ||
202 | { | ||
203 | |||
204 | } | ||
205 | |||
206 | Identity::~Identity() | ||
207 | { | ||
208 | |||
209 | } | ||
210 | |||
189 | template<> | 211 | template<> |
190 | QByteArray getTypeName<Event>() | 212 | QByteArray getTypeName<Event>() |
191 | { | 213 | { |
@@ -211,6 +233,12 @@ QByteArray getTypeName<SinkAccount>() | |||
211 | } | 233 | } |
212 | 234 | ||
213 | template<> | 235 | template<> |
236 | QByteArray getTypeName<Identity>() | ||
237 | { | ||
238 | return "identity"; | ||
239 | } | ||
240 | |||
241 | template<> | ||
214 | QByteArray getTypeName<Mail>() | 242 | QByteArray getTypeName<Mail>() |
215 | { | 243 | { |
216 | return "mail"; | 244 | return "mail"; |
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 5ecd9eb..8af48e8 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -165,6 +165,14 @@ struct SINK_EXPORT SinkAccount : public ApplicationDomainType { | |||
165 | virtual ~SinkAccount(); | 165 | virtual ~SinkAccount(); |
166 | }; | 166 | }; |
167 | 167 | ||
168 | struct SINK_EXPORT Identity : public ApplicationDomainType { | ||
169 | typedef QSharedPointer<SinkAccount> Ptr; | ||
170 | Identity(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor); | ||
171 | Identity(const QByteArray &identifier); | ||
172 | Identity(); | ||
173 | virtual ~Identity(); | ||
174 | }; | ||
175 | |||
168 | /** | 176 | /** |
169 | * All types need to be registered here an MUST return a different name. | 177 | * All types need to be registered here an MUST return a different name. |
170 | * | 178 | * |
diff --git a/common/facadefactory.cpp b/common/facadefactory.cpp index bae8f7b..b4a5273 100644 --- a/common/facadefactory.cpp +++ b/common/facadefactory.cpp | |||
@@ -56,6 +56,7 @@ void FacadeFactory::registerStaticFacades() | |||
56 | { | 56 | { |
57 | registerFacade<Sink::ApplicationDomain::SinkResource, ResourceFacade>(QByteArray()); | 57 | registerFacade<Sink::ApplicationDomain::SinkResource, ResourceFacade>(QByteArray()); |
58 | registerFacade<Sink::ApplicationDomain::SinkAccount, AccountFacade>(QByteArray()); | 58 | registerFacade<Sink::ApplicationDomain::SinkAccount, AccountFacade>(QByteArray()); |
59 | registerFacade<Sink::ApplicationDomain::Identity, IdentityFacade>(QByteArray()); | ||
59 | } | 60 | } |
60 | 61 | ||
61 | std::shared_ptr<void> FacadeFactory::getFacade(const QByteArray &resource, const QByteArray &instanceIdentifier, const QByteArray &typeName) | 62 | std::shared_ptr<void> FacadeFactory::getFacade(const QByteArray &resource, const QByteArray &instanceIdentifier, const QByteArray &typeName) |
diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp index 474e955..6ff4801 100644 --- a/common/resourcefacade.cpp +++ b/common/resourcefacade.cpp | |||
@@ -202,3 +202,10 @@ AccountFacade::~AccountFacade() | |||
202 | { | 202 | { |
203 | } | 203 | } |
204 | 204 | ||
205 | IdentityFacade::IdentityFacade(const QByteArray &) : LocalStorageFacade<Sink::ApplicationDomain::Identity>("identitys") | ||
206 | { | ||
207 | } | ||
208 | |||
209 | IdentityFacade::~IdentityFacade() | ||
210 | { | ||
211 | } | ||
diff --git a/common/resourcefacade.h b/common/resourcefacade.h index 725938a..7834dea 100644 --- a/common/resourcefacade.h +++ b/common/resourcefacade.h | |||
@@ -87,4 +87,10 @@ public: | |||
87 | virtual ~AccountFacade(); | 87 | virtual ~AccountFacade(); |
88 | }; | 88 | }; |
89 | 89 | ||
90 | class IdentityFacade : public LocalStorageFacade<Sink::ApplicationDomain::Identity> | ||
91 | { | ||
92 | public: | ||
93 | IdentityFacade(const QByteArray &instanceIdentifier); | ||
94 | virtual ~IdentityFacade(); | ||
95 | }; | ||
90 | 96 | ||
diff --git a/docs/applicationdomaintypes.md b/docs/applicationdomaintypes.md index 56e3032..09fec9f 100644 --- a/docs/applicationdomaintypes.md +++ b/docs/applicationdomaintypes.md | |||
@@ -79,10 +79,23 @@ Maildir Resource: | |||
79 | path [QString]: The path to the maildir. | 79 | path [QString]: The path to the maildir. |
80 | ``` | 80 | ``` |
81 | ```no-highlight | 81 | ```no-highlight |
82 | Mailtransport Resource: | ||
83 | server [QByteArray]: The server address. | ||
84 | username [QByteArray]: The username. | ||
85 | password [QByteArray]: The password. | ||
86 | ``` | ||
87 | ```no-highlight | ||
82 | Account: | 88 | Account: |
83 | name [QString]: The name of the account. | 89 | name [QString]: The name of the account. |
84 | icon [QString]: The name of the icon of the account. | 90 | icon [QString]: The name of the icon of the account. |
85 | ``` | 91 | ``` |
92 | ```no-highlight | ||
93 | Identity: | ||
94 | name [QString]: The name of the identity. | ||
95 | username [QString]: The username. | ||
96 | address [QString]: The email address. | ||
97 | account [Account.id]: The identifier of the associated account. | ||
98 | ``` | ||
86 | 99 | ||
87 | ### References/Hierachies | 100 | ### References/Hierachies |
88 | Some domain objects reference others, and that is often used to build hierarchies. | 101 | Some domain objects reference others, and that is often used to build hierarchies. |