From 2b79fb7b6a4759086302c68d63731256465bc5fe Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 9 Feb 2016 15:59:11 +0100 Subject: Store can be a namespace. --- common/clientapi.h | 125 +++++++++++++++++++++++++++-------------------------- 1 file changed, 63 insertions(+), 62 deletions(-) (limited to 'common') diff --git a/common/clientapi.h b/common/clientapi.h index 36c923b..f88eb5c 100644 --- a/common/clientapi.h +++ b/common/clientapi.h @@ -52,68 +52,69 @@ private: /** * Store interface used in the client API. */ -class SINKCOMMON_EXPORT Store { -public: - static QString storageLocation(); - static QByteArray resourceName(const QByteArray &instanceIdentifier); - - enum Roles { - DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult - ChildrenFetchedRole, - DomainObjectBaseRole - }; - - /** - * Asynchronusly load a dataset with tree structure information - */ - template - static QSharedPointer loadModel(Query query); - - /** - * Create a new entity. - */ - template - static KAsync::Job create(const DomainType &domainObject); - - /** - * Modify an entity. - * - * This includes moving etc. since these are also simple settings on a property. - */ - template - static KAsync::Job modify(const DomainType &domainObject); - - /** - * Remove an entity. - */ - template - static KAsync::Job remove(const DomainType &domainObject); - - /** - * Synchronize data to local cache. - */ - static KAsync::Job synchronize(const Sink::Query &query); - - /** - * Removes a resource from disk. - */ - static void removeFromDisk(const QByteArray &resourceIdentifier); - - /** - * Removes all resource data from disk. - * - * This will not touch the configuration. All commands that that arrived at the resource before this command will be dropped. All commands that arrived later will be executed. - */ - static KAsync::Job removeDataFromDisk(const QByteArray &resourceIdentifier); - - template - static KAsync::Job fetchOne(const Sink::Query &query); - - template - static KAsync::Job > fetchAll(const Sink::Query &query); - - template - static KAsync::Job > fetch(const Sink::Query &query, int minimumAmount = 0); +namespace Store { + +QString SINKCOMMON_EXPORT storageLocation(); +QByteArray SINKCOMMON_EXPORT resourceName(const QByteArray &instanceIdentifier); + +enum Roles { + DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult + ChildrenFetchedRole, + DomainObjectBaseRole +}; + +/** + * Asynchronusly load a dataset with tree structure information + */ +template +QSharedPointer SINKCOMMON_EXPORT loadModel(Query query); + +/** + * Create a new entity. + */ +template +KAsync::Job SINKCOMMON_EXPORT create(const DomainType &domainObject); + +/** + * Modify an entity. + * + * This includes moving etc. since these are also simple settings on a property. + */ +template +KAsync::Job SINKCOMMON_EXPORT modify(const DomainType &domainObject); + +/** + * Remove an entity. + */ +template +KAsync::Job SINKCOMMON_EXPORT remove(const DomainType &domainObject); + +/** + * Synchronize data to local cache. + */ +KAsync::Job SINKCOMMON_EXPORT synchronize(const Sink::Query &query); + +/** + * Removes a resource from disk. + */ +void SINKCOMMON_EXPORT removeFromDisk(const QByteArray &resourceIdentifier); + +/** + * Removes all resource data from disk. + * + * This will not touch the configuration. All commands that that arrived at the resource before this command will be dropped. All commands that arrived later will be executed. + */ +KAsync::Job SINKCOMMON_EXPORT removeDataFromDisk(const QByteArray &resourceIdentifier); + +template +KAsync::Job SINKCOMMON_EXPORT fetchOne(const Sink::Query &query); + +template +KAsync::Job > SINKCOMMON_EXPORT fetchAll(const Sink::Query &query); + +template +KAsync::Job > SINKCOMMON_EXPORT fetch(const Sink::Query &query, int minimumAmount = 0); + }; namespace Resources { -- cgit v1.2.3