diff options
Diffstat (limited to 'common/clientapi.h')
-rw-r--r-- | common/clientapi.h | 125 |
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 | */ |
55 | class SINKCOMMON_EXPORT Store { | 55 | namespace Store { |
56 | public: | 56 | |
57 | static QString storageLocation(); | 57 | QString SINKCOMMON_EXPORT storageLocation(); |
58 | static QByteArray resourceName(const QByteArray &instanceIdentifier); | 58 | QByteArray SINKCOMMON_EXPORT resourceName(const QByteArray &instanceIdentifier); |
59 | 59 | ||
60 | enum Roles { | 60 | enum 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> | 69 | template <class DomainType> |
70 | static QSharedPointer<QAbstractItemModel> loadModel(Query query); | 70 | QSharedPointer<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> | 75 | template <class DomainType> |
76 | static KAsync::Job<void> create(const DomainType &domainObject); | 76 | KAsync::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> | 83 | template <class DomainType> |
84 | static KAsync::Job<void> modify(const DomainType &domainObject); | 84 | KAsync::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> | 89 | template <class DomainType> |
90 | static KAsync::Job<void> remove(const DomainType &domainObject); | 90 | KAsync::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); | 95 | KAsync::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); | 100 | void 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); | 107 | KAsync::Job<void> SINKCOMMON_EXPORT removeDataFromDisk(const QByteArray &resourceIdentifier); |
108 | 108 | ||
109 | template <class DomainType> | 109 | template <class DomainType> |
110 | static KAsync::Job<DomainType> fetchOne(const Sink::Query &query); | 110 | KAsync::Job<DomainType> SINKCOMMON_EXPORT fetchOne(const Sink::Query &query); |
111 | 111 | ||
112 | template <class DomainType> | 112 | template <class DomainType> |
113 | static KAsync::Job<QList<typename DomainType::Ptr> > fetchAll(const Sink::Query &query); | 113 | KAsync::Job<QList<typename DomainType::Ptr> > SINKCOMMON_EXPORT fetchAll(const Sink::Query &query); |
114 | 114 | ||
115 | template <class DomainType> | 115 | template <class DomainType> |
116 | static KAsync::Job<QList<typename DomainType::Ptr> > fetch(const Sink::Query &query, int minimumAmount = 0); | 116 | KAsync::Job<QList<typename DomainType::Ptr> > SINKCOMMON_EXPORT fetch(const Sink::Query &query, int minimumAmount = 0); |
117 | |||
117 | }; | 118 | }; |
118 | 119 | ||
119 | namespace Resources { | 120 | namespace Resources { |