diff options
Diffstat (limited to 'common/clientapi.h')
-rw-r--r-- | common/clientapi.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/common/clientapi.h b/common/clientapi.h index 37fb185..5182547 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -163,7 +163,7 @@ namespace async { | |||
163 | namespace Akonadi2 { | 163 | namespace Akonadi2 { |
164 | 164 | ||
165 | /** | 165 | /** |
166 | * Standardized Domain Types | 166 | * Standardized Application Domain Types |
167 | * | 167 | * |
168 | * They don't adhere to any standard and can be freely extended | 168 | * They don't adhere to any standard and can be freely extended |
169 | * Their sole purpose is providing a standardized interface to access data. | 169 | * Their sole purpose is providing a standardized interface to access data. |
@@ -172,7 +172,7 @@ namespace Akonadi2 { | |||
172 | * | 172 | * |
173 | * These types will be frequently modified (for every new feature that should be exposed to the any client) | 173 | * These types will be frequently modified (for every new feature that should be exposed to the any client) |
174 | */ | 174 | */ |
175 | namespace Domain { | 175 | namespace ApplicationDomain { |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * This class has to be implemented by resources and can be used as generic interface to access the buffer properties | 178 | * This class has to be implemented by resources and can be used as generic interface to access the buffer properties |
@@ -215,14 +215,14 @@ private: | |||
215 | * * provide a unified interface to read buffers (for zero-copy reading) | 215 | * * provide a unified interface to read buffers (for zero-copy reading) |
216 | * * record changes to generate changesets for modifications | 216 | * * record changes to generate changesets for modifications |
217 | */ | 217 | */ |
218 | class AkonadiDomainType { | 218 | class ApplicationDomainType { |
219 | public: | 219 | public: |
220 | AkonadiDomainType() | 220 | ApplicationDomainType() |
221 | :mAdaptor(new MemoryBufferAdaptor()) | 221 | :mAdaptor(new MemoryBufferAdaptor()) |
222 | { | 222 | { |
223 | 223 | ||
224 | } | 224 | } |
225 | AkonadiDomainType(const QByteArray &resourceName, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) | 225 | ApplicationDomainType(const QByteArray &resourceName, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) |
226 | : mAdaptor(adaptor), | 226 | : mAdaptor(adaptor), |
227 | mResourceName(resourceName), | 227 | mResourceName(resourceName), |
228 | mIdentifier(identifier), | 228 | mIdentifier(identifier), |
@@ -230,7 +230,7 @@ public: | |||
230 | { | 230 | { |
231 | } | 231 | } |
232 | 232 | ||
233 | virtual ~AkonadiDomainType() {} | 233 | virtual ~ApplicationDomainType() {} |
234 | 234 | ||
235 | virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } | 235 | virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } |
236 | virtual void setProperty(const QByteArray &key, const QVariant &value){ mChangeSet.insert(key, value); mAdaptor->setProperty(key, value); } | 236 | virtual void setProperty(const QByteArray &key, const QVariant &value){ mChangeSet.insert(key, value); mAdaptor->setProperty(key, value); } |
@@ -246,25 +246,25 @@ private: | |||
246 | qint64 mRevision; | 246 | qint64 mRevision; |
247 | }; | 247 | }; |
248 | 248 | ||
249 | struct Event : public AkonadiDomainType { | 249 | struct Event : public ApplicationDomainType { |
250 | typedef QSharedPointer<Event> Ptr; | 250 | typedef QSharedPointer<Event> Ptr; |
251 | using AkonadiDomainType::AkonadiDomainType; | 251 | using ApplicationDomainType::ApplicationDomainType; |
252 | }; | 252 | }; |
253 | 253 | ||
254 | struct Todo : public AkonadiDomainType { | 254 | struct Todo : public ApplicationDomainType { |
255 | typedef QSharedPointer<Todo> Ptr; | 255 | typedef QSharedPointer<Todo> Ptr; |
256 | using AkonadiDomainType::AkonadiDomainType; | 256 | using ApplicationDomainType::ApplicationDomainType; |
257 | }; | 257 | }; |
258 | 258 | ||
259 | struct Calendar : public AkonadiDomainType { | 259 | struct Calendar : public ApplicationDomainType { |
260 | typedef QSharedPointer<Calendar> Ptr; | 260 | typedef QSharedPointer<Calendar> Ptr; |
261 | using AkonadiDomainType::AkonadiDomainType; | 261 | using ApplicationDomainType::ApplicationDomainType; |
262 | }; | 262 | }; |
263 | 263 | ||
264 | class Mail : public AkonadiDomainType { | 264 | class Mail : public ApplicationDomainType { |
265 | }; | 265 | }; |
266 | 266 | ||
267 | class Folder : public AkonadiDomainType { | 267 | class Folder : public ApplicationDomainType { |
268 | }; | 268 | }; |
269 | 269 | ||
270 | /** | 270 | /** |
@@ -331,7 +331,7 @@ template<class DomainType> | |||
331 | class StoreFacade { | 331 | class StoreFacade { |
332 | public: | 332 | public: |
333 | virtual ~StoreFacade(){}; | 333 | virtual ~StoreFacade(){}; |
334 | QByteArray type() const { return Domain::getTypeName<DomainType>(); } | 334 | QByteArray type() const { return ApplicationDomain::getTypeName<DomainType>(); } |
335 | virtual Async::Job<void> create(const DomainType &domainObject) = 0; | 335 | virtual Async::Job<void> create(const DomainType &domainObject) = 0; |
336 | virtual Async::Job<void> modify(const DomainType &domainObject) = 0; | 336 | virtual Async::Job<void> modify(const DomainType &domainObject) = 0; |
337 | virtual Async::Job<void> remove(const DomainType &domainObject) = 0; | 337 | virtual Async::Job<void> remove(const DomainType &domainObject) = 0; |
@@ -362,7 +362,7 @@ public: | |||
362 | template<class DomainType, class Facade> | 362 | template<class DomainType, class Facade> |
363 | void registerFacade(const QByteArray &resource) | 363 | void registerFacade(const QByteArray &resource) |
364 | { | 364 | { |
365 | const QByteArray typeName = Domain::getTypeName<DomainType>(); | 365 | const QByteArray typeName = ApplicationDomain::getTypeName<DomainType>(); |
366 | mFacadeRegistry.insert(key(resource, typeName), [](){ return new Facade; }); | 366 | mFacadeRegistry.insert(key(resource, typeName), [](){ return new Facade; }); |
367 | } | 367 | } |
368 | 368 | ||
@@ -378,14 +378,14 @@ public: | |||
378 | template<class DomainType, class Facade> | 378 | template<class DomainType, class Facade> |
379 | void registerFacade(const QByteArray &resource, const std::function<void*(void)> &customFactoryFunction) | 379 | void registerFacade(const QByteArray &resource, const std::function<void*(void)> &customFactoryFunction) |
380 | { | 380 | { |
381 | const QByteArray typeName = Domain::getTypeName<DomainType>(); | 381 | const QByteArray typeName = ApplicationDomain::getTypeName<DomainType>(); |
382 | mFacadeRegistry.insert(key(resource, typeName), customFactoryFunction); | 382 | mFacadeRegistry.insert(key(resource, typeName), customFactoryFunction); |
383 | } | 383 | } |
384 | 384 | ||
385 | template<class DomainType> | 385 | template<class DomainType> |
386 | QSharedPointer<StoreFacade<DomainType> > getFacade(const QByteArray &resource) | 386 | QSharedPointer<StoreFacade<DomainType> > getFacade(const QByteArray &resource) |
387 | { | 387 | { |
388 | const QByteArray typeName = Domain::getTypeName<DomainType>(); | 388 | const QByteArray typeName = ApplicationDomain::getTypeName<DomainType>(); |
389 | auto factoryFunction = mFacadeRegistry.value(key(resource, typeName)); | 389 | auto factoryFunction = mFacadeRegistry.value(key(resource, typeName)); |
390 | if (factoryFunction) { | 390 | if (factoryFunction) { |
391 | return QSharedPointer<StoreFacade<DomainType> >(static_cast<StoreFacade<DomainType>* >(factoryFunction())); | 391 | return QSharedPointer<StoreFacade<DomainType> >(static_cast<StoreFacade<DomainType>* >(factoryFunction())); |