summaryrefslogtreecommitdiffstats
path: root/common/clientapi.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-09 15:59:11 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-02-09 15:59:11 +0100
commit2b79fb7b6a4759086302c68d63731256465bc5fe (patch)
tree21dc67d50fcaaf9c534802069533c3bedf035125 /common/clientapi.h
parent573051b8df4a2961b4ba8a1b7e31f1437517f9c8 (diff)
downloadsink-2b79fb7b6a4759086302c68d63731256465bc5fe.tar.gz
sink-2b79fb7b6a4759086302c68d63731256465bc5fe.zip
Store can be a namespace.
Diffstat (limited to 'common/clientapi.h')
-rw-r--r--common/clientapi.h125
1 files changed, 63 insertions, 62 deletions
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:
52/** 52/**
53 * Store interface used in the client API. 53 * Store interface used in the client API.
54 */ 54 */
55class SINKCOMMON_EXPORT Store { 55namespace Store {
56public: 56
57 static QString storageLocation(); 57QString SINKCOMMON_EXPORT storageLocation();
58 static QByteArray resourceName(const QByteArray &instanceIdentifier); 58QByteArray SINKCOMMON_EXPORT resourceName(const QByteArray &instanceIdentifier);
59 59
60 enum Roles { 60enum Roles {
61 DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult 61 DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult
62 ChildrenFetchedRole, 62 ChildrenFetchedRole,
63 DomainObjectBaseRole 63 DomainObjectBaseRole
64 }; 64};
65 65
66 /** 66/**
67 * Asynchronusly load a dataset with tree structure information 67 * Asynchronusly load a dataset with tree structure information
68 */ 68 */
69 template <class DomainType> 69template <class DomainType>
70 static QSharedPointer<QAbstractItemModel> loadModel(Query query); 70QSharedPointer<QAbstractItemModel> SINKCOMMON_EXPORT loadModel(Query query);
71 71
72 /** 72/**
73 * Create a new entity. 73 * Create a new entity.
74 */ 74 */
75 template <class DomainType> 75template <class DomainType>
76 static KAsync::Job<void> create(const DomainType &domainObject); 76KAsync::Job<void> SINKCOMMON_EXPORT create(const DomainType &domainObject);
77 77
78 /** 78/**
79 * Modify an entity. 79 * Modify an entity.
80 * 80 *
81 * This includes moving etc. since these are also simple settings on a property. 81 * This includes moving etc. since these are also simple settings on a property.
82 */ 82 */
83 template <class DomainType> 83template <class DomainType>
84 static KAsync::Job<void> modify(const DomainType &domainObject); 84KAsync::Job<void> SINKCOMMON_EXPORT modify(const DomainType &domainObject);
85 85
86 /** 86/**
87 * Remove an entity. 87 * Remove an entity.
88 */ 88 */
89 template <class DomainType> 89template <class DomainType>
90 static KAsync::Job<void> remove(const DomainType &domainObject); 90KAsync::Job<void> SINKCOMMON_EXPORT remove(const DomainType &domainObject);
91 91
92 /** 92/**
93 * Synchronize data to local cache. 93 * Synchronize data to local cache.
94 */ 94 */
95 static KAsync::Job<void> synchronize(const Sink::Query &query); 95KAsync::Job<void> SINKCOMMON_EXPORT synchronize(const Sink::Query &query);
96 96
97 /** 97/**
98 * Removes a resource from disk. 98 * Removes a resource from disk.
99 */ 99 */
100 static void removeFromDisk(const QByteArray &resourceIdentifier); 100void SINKCOMMON_EXPORT removeFromDisk(const QByteArray &resourceIdentifier);
101 101
102 /** 102/**
103 * Removes all resource data from disk. 103 * Removes all resource data from disk.
104 * 104 *
105 * 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. 105 * 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.
106 */ 106 */
107 static KAsync::Job<void> removeDataFromDisk(const QByteArray &resourceIdentifier); 107KAsync::Job<void> SINKCOMMON_EXPORT removeDataFromDisk(const QByteArray &resourceIdentifier);
108 108
109 template <class DomainType> 109template <class DomainType>
110 static KAsync::Job<DomainType> fetchOne(const Sink::Query &query); 110KAsync::Job<DomainType> SINKCOMMON_EXPORT fetchOne(const Sink::Query &query);
111 111
112 template <class DomainType> 112template <class DomainType>
113 static KAsync::Job<QList<typename DomainType::Ptr> > fetchAll(const Sink::Query &query); 113KAsync::Job<QList<typename DomainType::Ptr> > SINKCOMMON_EXPORT fetchAll(const Sink::Query &query);
114 114
115 template <class DomainType> 115template <class DomainType>
116 static KAsync::Job<QList<typename DomainType::Ptr> > fetch(const Sink::Query &query, int minimumAmount = 0); 116KAsync::Job<QList<typename DomainType::Ptr> > SINKCOMMON_EXPORT fetch(const Sink::Query &query, int minimumAmount = 0);
117
117}; 118};
118 119
119namespace Resources { 120namespace Resources {