summaryrefslogtreecommitdiffstats
path: root/client/clientapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/clientapi.h')
-rw-r--r--client/clientapi.h91
1 files changed, 0 insertions, 91 deletions
diff --git a/client/clientapi.h b/client/clientapi.h
index a0020af..fae0744 100644
--- a/client/clientapi.h
+++ b/client/clientapi.h
@@ -417,94 +417,3 @@ public:
417 417
418} 418}
419 419
420//Example implementations
421/*
422 * Resource and domain object specific
423 * FIXME: should we hardcode the requirement that the domain adapter is a subclass for the domain object?
424 * * how do we allow copying of domain objects?
425 * ** dummy domain object that is a wrapper?
426 * ** domain adapter has an accessor for the domain object to hide subclassing
427 */
428class EventDomainAdapter : public Akonadi2::Domain::Event {
429 // virtual void setFoo(const QString &value)
430 // {
431 // mBuffer.setFoo(value);
432 // }
433
434 // virtual QString foo() const
435 // {
436 // return mBuffer.foo();
437 // }
438
439 // MessageBuffer mBuffer;
440};
441
442
443/**
444 * Actual implementation of the store facade that is provided by the resource plugin.
445 *
446 * It knows the buffer type used by the resource as well as the actual store used.
447 *
448 * A resource must provide this facade for each domain type it knows.
449 * => is reimplemented a lot
450 * => we should have a base implementation
451 *
452 * This interface should be executed in a thread so we can synchronously retrieve data from the store.
453 *
454 * TODO: perhaps we should also allow async access and leave the thread/non-thread decision up to the implementation?
455 */
456// template<typename DomainType>
457// class StoreFacadeImpl : public Akonadi2::StoreFacade<Akonadi2::Domain::Event> {
458// };
459//
460// template<>
461// class StoreFacadeImpl<Akonadi2::Domain::Event> : public Akonadi2::StoreFacade<Akonadi2::Domain::Event> {
462// public:
463// StoreFacadeImpl():StoreFacade() {};
464//
465// void create(const Akonadi2::Domain::Event &domainObject) {
466// //FIXME here we would need to cast to DomainAdapter
467// //Do actual work
468// //transformFromDomainType(domainObject);
469// //Ideally we have an adapter
470// //getAdater(domainObject).buffer();
471// //domainObject.key(); => The domain object needs to provide the id
472// //writeToDb();
473// }
474//
475// void modify(const Akonadi2::Domain::Event &domainObject) {
476// //Do actual work
477// }
478//
479// void remove(const Akonadi2::Domain::Event &domainObject) {
480// //Do actual work
481// }
482//
483// class EventBuffer {
484// QString value;
485// };
486//
487// static Akonadi2::Domain::Event transformToDomainType(const EventBuffer &buffer) {
488// //We may want to avoid copies here
489// Akonadi2::Domain::Event event;
490// // //Ideally we don't have to copy and can use an adaptor instead
491// // return DomainAdaptor
492// return event;
493// };
494//
495// void load(const Akonadi2::Query &query, const std::function<void(const Akonadi2::Domain::Event &)> &resultCallback) {
496// //retrieve buffers from storage
497// QList<EventBuffer> queryresult;
498// for(const EventBuffer &buffer : queryresult) {
499// resultCallback(transformToDomainType(buffer));
500// }
501// }
502//
503// private:
504// //Dummy implementation
505// class ResourceImpl {};
506// ResourceImpl resource;
507// class DatabaseImpl {};
508// DatabaseImpl mDb;
509// };
510