diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-10 10:47:12 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-10 10:47:12 +0100 |
commit | 0991561c9630fcb89b9666b8d57c2b7ea592fec6 (patch) | |
tree | 66e12af97c055a62fc15ef1946e3bb166d4c55bf /common/clientapi.h | |
parent | c1c336a9064557bb987c30582bce84bab3f869bc (diff) | |
download | sink-0991561c9630fcb89b9666b8d57c2b7ea592fec6.tar.gz sink-0991561c9630fcb89b9666b8d57c2b7ea592fec6.zip |
Moved Store to separate file
Diffstat (limited to 'common/clientapi.h')
-rw-r--r-- | common/clientapi.h | 64 |
1 files changed, 2 insertions, 62 deletions
diff --git a/common/clientapi.h b/common/clientapi.h index 2b49826..a1d2469 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | #include <Async/Async> | 27 | #include <Async/Async> |
28 | 28 | ||
29 | #include "store.h" | ||
30 | |||
29 | #include "query.h" | 31 | #include "query.h" |
30 | #include "inspection.h" | 32 | #include "inspection.h" |
31 | #include "applicationdomaintype.h" | 33 | #include "applicationdomaintype.h" |
@@ -49,68 +51,6 @@ private: | |||
49 | }; | 51 | }; |
50 | 52 | ||
51 | 53 | ||
52 | /** | ||
53 | * Store interface used in the client API. | ||
54 | */ | ||
55 | namespace Store { | ||
56 | |||
57 | QString SINK_EXPORT storageLocation(); | ||
58 | |||
59 | enum Roles { | ||
60 | DomainObjectRole = Qt::UserRole + 1, //Must be the same as in ModelResult | ||
61 | ChildrenFetchedRole, | ||
62 | DomainObjectBaseRole | ||
63 | }; | ||
64 | |||
65 | /** | ||
66 | * Asynchronusly load a dataset with tree structure information | ||
67 | */ | ||
68 | template <class DomainType> | ||
69 | QSharedPointer<QAbstractItemModel> SINK_EXPORT loadModel(Query query); | ||
70 | |||
71 | /** | ||
72 | * Create a new entity. | ||
73 | */ | ||
74 | template <class DomainType> | ||
75 | KAsync::Job<void> SINK_EXPORT create(const DomainType &domainObject); | ||
76 | |||
77 | /** | ||
78 | * Modify an entity. | ||
79 | * | ||
80 | * This includes moving etc. since these are also simple settings on a property. | ||
81 | */ | ||
82 | template <class DomainType> | ||
83 | KAsync::Job<void> SINK_EXPORT modify(const DomainType &domainObject); | ||
84 | |||
85 | /** | ||
86 | * Remove an entity. | ||
87 | */ | ||
88 | template <class DomainType> | ||
89 | KAsync::Job<void> SINK_EXPORT remove(const DomainType &domainObject); | ||
90 | |||
91 | /** | ||
92 | * Synchronize data to local cache. | ||
93 | */ | ||
94 | KAsync::Job<void> SINK_EXPORT synchronize(const Sink::Query &query); | ||
95 | |||
96 | /** | ||
97 | * Removes all resource data from disk. | ||
98 | * | ||
99 | * 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. | ||
100 | */ | ||
101 | KAsync::Job<void> SINK_EXPORT removeDataFromDisk(const QByteArray &resourceIdentifier); | ||
102 | |||
103 | template <class DomainType> | ||
104 | KAsync::Job<DomainType> SINK_EXPORT fetchOne(const Sink::Query &query); | ||
105 | |||
106 | template <class DomainType> | ||
107 | KAsync::Job<QList<typename DomainType::Ptr> > SINK_EXPORT fetchAll(const Sink::Query &query); | ||
108 | |||
109 | template <class DomainType> | ||
110 | KAsync::Job<QList<typename DomainType::Ptr> > SINK_EXPORT fetch(const Sink::Query &query, int minimumAmount = 0); | ||
111 | |||
112 | }; | ||
113 | |||
114 | namespace ResourceControl { | 54 | namespace ResourceControl { |
115 | 55 | ||
116 | template <class DomainType> | 56 | template <class DomainType> |