libquentier  0.4.0
The library for rich desktop clients of Evernote service
LocalStorageManagerAsync.h
1 /*
2  * Copyright 2016 Dmitry Ivanov
3  *
4  * This file is part of libquentier
5  *
6  * libquentier is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, version 3 of the License.
9  *
10  * libquentier is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H
20 #define LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H
21 
22 #include <quentier/utility/Macros.h>
23 #include <quentier/types/ErrorString.h>
24 #include <quentier/local_storage/LocalStorageManager.h>
25 #include <quentier/local_storage/LocalStorageCacheManager.h>
26 #include <quentier/local_storage/ILocalStorageCacheExpiryChecker.h>
27 #include <quentier/types/User.h>
28 #include <quentier/types/Notebook.h>
29 #include <quentier/types/SharedNotebook.h>
30 #include <quentier/types/LinkedNotebook.h>
31 #include <quentier/types/Note.h>
32 #include <quentier/types/Tag.h>
33 #include <quentier/types/Resource.h>
34 #include <quentier/types/SavedSearch.h>
35 #include <QObject>
36 
37 namespace quentier {
38 
39 class QUENTIER_EXPORT LocalStorageManagerAsync: public QObject
40 {
41  Q_OBJECT
42 public:
43  explicit LocalStorageManagerAsync(const Account & account, const bool startFromScratch,
44  const bool overrideLock, QObject * parent = Q_NULLPTR);
45  virtual ~LocalStorageManagerAsync();
46 
47  void setUseCache(const bool useCache);
48 
49  const LocalStorageCacheManager * localStorageCacheManager() const;
50  bool installCacheExpiryFunction(const ILocalStorageCacheExpiryChecker & checker);
51 
52  const LocalStorageManager * localStorageManager() const;
53  LocalStorageManager * localStorageManager();
54 
55 Q_SIGNALS:
56  // Sent when the initialization is complete
57  void initialized();
58 
59  // User-related signals:
60  void getUserCountComplete(int userCount, QUuid requestId = QUuid());
61  void getUserCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
62  void switchUserComplete(Account account, QUuid requestId = QUuid());
63  void switchUserFailed(Account account, ErrorString errorDescription, QUuid requestId = QUuid());
64  void addUserComplete(User user, QUuid requestId = QUuid());
65  void addUserFailed(User user, ErrorString errorDescription, QUuid requestId = QUuid());
66  void updateUserComplete(User user, QUuid requestId = QUuid());
67  void updateUserFailed(User user, ErrorString errorDescription, QUuid requestId = QUuid());
68  void findUserComplete(User foundUser, QUuid requestId = QUuid());
69  void findUserFailed(User user, ErrorString errorDescription, QUuid requestId = QUuid());
70  void deleteUserComplete(User user, QUuid requestId = QUuid());
71  void deleteUserFailed(User user, ErrorString errorDescription, QUuid requestId = QUuid());
72  void expungeUserComplete(User user, QUuid requestId = QUuid());
73  void expungeUserFailed(User user, ErrorString errorDescription, QUuid requestId = QUuid());
74 
75  // Notebook-related signals:
76  void getNotebookCountComplete(int notebookCount, QUuid requestId = QUuid());
77  void getNotebookCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
78  void addNotebookComplete(Notebook notebook, QUuid requestId = QUuid());
79  void addNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
80  void updateNotebookComplete(Notebook notebook, QUuid requestId = QUuid());
81  void updateNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
82  void findNotebookComplete(Notebook foundNotebook, QUuid requestId = QUuid());
83  void findNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
84  void findDefaultNotebookComplete(Notebook foundNotebook, QUuid requestId = QUuid());
85  void findDefaultNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
86  void findLastUsedNotebookComplete(Notebook foundNotebook, QUuid requestId = QUuid());
87  void findLastUsedNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
88  void findDefaultOrLastUsedNotebookComplete(Notebook foundNotebook, QUuid requestId = QUuid());
89  void findDefaultOrLastUsedNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
90  void listAllNotebooksComplete(size_t limit, size_t offset, LocalStorageManager::ListNotebooksOrder::type order,
91  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
92  QList<Notebook> foundNotebooks, QUuid requestId = QUuid());
93  void listAllNotebooksFailed(size_t limit, size_t offset, LocalStorageManager::ListNotebooksOrder::type order,
94  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
95  ErrorString errorDescription, QUuid requestId = QUuid());
96  void listNotebooksComplete(LocalStorageManager::ListObjectsOptions flag,
97  size_t limit, size_t offset, LocalStorageManager::ListNotebooksOrder::type order,
98  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
99  QList<Notebook> foundNotebooks, QUuid requestId = QUuid());
100  void listNotebooksFailed(LocalStorageManager::ListObjectsOptions flag, size_t limit, size_t offset,
101  LocalStorageManager::ListNotebooksOrder::type order,
102  LocalStorageManager::OrderDirection::type orderDirection,
103  QString linkedNotebookGuid, ErrorString errorDescription, QUuid requestId = QUuid());
104  void listAllSharedNotebooksComplete(QList<SharedNotebook> foundSharedNotebooks, QUuid requestId = QUuid());
105  void listAllSharedNotebooksFailed(ErrorString errorDescription, QUuid requestId = QUuid());
106  void listSharedNotebooksPerNotebookGuidComplete(QString notebookGuid, QList<SharedNotebook> foundSharedNotebooks,
107  QUuid requestId = QUuid());
108  void listSharedNotebooksPerNotebookGuidFailed(QString notebookGuid, ErrorString errorDescription, QUuid requestId = QUuid());
109  void expungeNotebookComplete(Notebook notebook, QUuid requestId = QUuid());
110  void expungeNotebookFailed(Notebook notebook, ErrorString errorDescription, QUuid requestId = QUuid());
111 
112  // Linked notebook-related signals:
113  void getLinkedNotebookCountComplete(int linkedNotebookCount, QUuid requestId = QUuid());
114  void getLinkedNotebookCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
115  void addLinkedNotebookComplete(LinkedNotebook linkedNotebook, QUuid requestId = QUuid());
116  void addLinkedNotebookFailed(LinkedNotebook linkedNotebook, ErrorString errorDescription, QUuid requestId = QUuid());
117  void updateLinkedNotebookComplete(LinkedNotebook linkedNotebook, QUuid requestId = QUuid());
118  void updateLinkedNotebookFailed(LinkedNotebook linkedNotebook, ErrorString errorDescription, QUuid requestId = QUuid());
119  void findLinkedNotebookComplete(LinkedNotebook foundLinkedNotebook, QUuid requestId = QUuid());
120  void findLinkedNotebookFailed(LinkedNotebook linkedNotebook, ErrorString errorDescription, QUuid requestId = QUuid());
121  void listAllLinkedNotebooksComplete(size_t limit, size_t offset,
122  LocalStorageManager::ListLinkedNotebooksOrder::type order,
123  LocalStorageManager::OrderDirection::type orderDirection,
124  QList<LinkedNotebook> foundLinkedNotebooks,
125  QUuid requestId = QUuid());
126  void listAllLinkedNotebooksFailed(size_t limit, size_t offset,
127  LocalStorageManager::ListLinkedNotebooksOrder::type order,
128  LocalStorageManager::OrderDirection::type orderDirection,
129  ErrorString errorDescription, QUuid requestId = QUuid());
130  void listLinkedNotebooksComplete(LocalStorageManager::ListObjectsOptions flag,
131  size_t limit, size_t offset,
132  LocalStorageManager::ListLinkedNotebooksOrder::type order,
133  LocalStorageManager::OrderDirection::type orderDirection,
134  QList<LinkedNotebook> foundLinkedNotebooks,
135  QUuid requestId = QUuid());
136  void listLinkedNotebooksFailed(LocalStorageManager::ListObjectsOptions flag,
137  size_t limit, size_t offset,
138  LocalStorageManager::ListLinkedNotebooksOrder::type order,
139  LocalStorageManager::OrderDirection::type orderDirection,
140  ErrorString errorDescription, QUuid requestId = QUuid());
141  void expungeLinkedNotebookComplete(LinkedNotebook linkedNotebook, QUuid requestId = QUuid());
142  void expungeLinkedNotebookFailed(LinkedNotebook linkedNotebook, ErrorString errorDescription, QUuid requestId = QUuid());
143 
144  // Note-related signals:
145  void getNoteCountComplete(int noteCount, QUuid requestId = QUuid());
146  void getNoteCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
147  void getNoteCountPerNotebookComplete(int noteCount, Notebook notebook, QUuid requestId = QUuid());
148  void getNoteCountPerNotebookFailed(ErrorString errorDescription, Notebook notebook, QUuid requestId = QUuid());
149  void getNoteCountPerTagComplete(int noteCount, Tag tag, QUuid requestId = QUuid());
150  void getNoteCountPerTagFailed(ErrorString errorDescription, Tag tag, QUuid requestId = QUuid());
151  void getNoteCountsPerAllTagsComplete(QHash<QString, int> noteCountsPerTagLocalUid, QUuid requestId = QUuid());
152  void getNoteCountsPerAllTagsFailed(ErrorString errorDescription, QUuid requestId = QUuid());
153  void addNoteComplete(Note note, QUuid requestId = QUuid());
154  void addNoteFailed(Note note, ErrorString errorDescription, QUuid requestId = QUuid());
155  void updateNoteComplete(Note note, bool updateResources, bool updateTags, QUuid requestId = QUuid());
156  void updateNoteFailed(Note note, bool updateResources, bool updateTags,
157  ErrorString errorDescription, QUuid requestId = QUuid());
158  void findNoteComplete(Note foundNote, bool withResourceBinaryData, QUuid requestId = QUuid());
159  void findNoteFailed(Note note, bool withResourceBinaryData, ErrorString errorDescription, QUuid requestId = QUuid());
160  void listNotesPerNotebookComplete(Notebook notebook, bool withResourceBinaryData,
161  LocalStorageManager::ListObjectsOptions flag,
162  size_t limit, size_t offset, LocalStorageManager::ListNotesOrder::type order,
163  LocalStorageManager::OrderDirection::type orderDirection,
164  QList<Note> foundNotes, QUuid requestId = QUuid());
165  void listNotesPerNotebookFailed(Notebook notebook, bool withResourceBinaryData,
166  LocalStorageManager::ListObjectsOptions flag,
167  size_t limit, size_t offset, LocalStorageManager::ListNotesOrder::type order,
168  LocalStorageManager::OrderDirection::type orderDirection,
169  ErrorString errorDescription, QUuid requestId = QUuid());
170  void listNotesPerTagComplete(Tag tag, bool withResourceBinaryData,
171  LocalStorageManager::ListObjectsOptions flag,
172  size_t limit, size_t offset, LocalStorageManager::ListNotesOrder::type order,
173  LocalStorageManager::OrderDirection::type orderDirection,
174  QList<Note> foundNotes, QUuid requestId = QUuid());
175  void listNotesPerTagFailed(Tag tag, bool withResourceBinaryData,
176  LocalStorageManager::ListObjectsOptions flag,
177  size_t limit, size_t offset, LocalStorageManager::ListNotesOrder::type order,
178  LocalStorageManager::OrderDirection::type orderDirection,
179  ErrorString errorDescription, QUuid requestId = QUuid());
180  void listNotesComplete(LocalStorageManager::ListObjectsOptions flag, bool withResourceBinaryData,
181  size_t limit, size_t offset, LocalStorageManager::ListNotesOrder::type order,
182  LocalStorageManager::OrderDirection::type orderDirection,
183  QString linkedNotebookGuid, QList<Note> foundNotes, QUuid requestId = QUuid());
184  void listNotesFailed(LocalStorageManager::ListObjectsOptions flag, bool withResourceBinaryData,
185  size_t limit, size_t offset, LocalStorageManager::ListNotesOrder::type order,
186  LocalStorageManager::OrderDirection::type orderDirection,
187  QString linkedNotebookGuid, ErrorString errorDescription, QUuid requestId = QUuid());
188  void findNoteLocalUidsWithSearchQueryComplete(QStringList noteLocalUids,
189  NoteSearchQuery noteSearchQuery,
190  QUuid requestId = QUuid());
191  void findNoteLocalUidsWithSearchQueryFailed(NoteSearchQuery noteSearchQuery,
192  ErrorString errorDescription,
193  QUuid requestId = QUuid());
194  void expungeNoteComplete(Note note, QUuid requestId = QUuid());
195  void expungeNoteFailed(Note note, ErrorString errorDescription, QUuid requestId = QUuid());
196 
197  // Tag-related signals:
198  void getTagCountComplete(int tagCount, QUuid requestId = QUuid());
199  void getTagCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
200  void addTagComplete(Tag tag, QUuid requestId = QUuid());
201  void addTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId = QUuid());
202  void updateTagComplete(Tag tag, QUuid requestId = QUuid());
203  void updateTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId = QUuid());
204  void linkTagWithNoteComplete(Tag tag, Note note, QUuid requestId = QUuid());
205  void linkTagWithNoteFailed(Tag tag, Note note, ErrorString errorDescription, QUuid requestId = QUuid());
206  void findTagComplete(Tag tag, QUuid requestId = QUuid());
207  void findTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId = QUuid());
208  void listAllTagsPerNoteComplete(QList<Tag> foundTags, Note note,
209  LocalStorageManager::ListObjectsOptions flag,
210  size_t limit, size_t offset,
211  LocalStorageManager::ListTagsOrder::type order,
212  LocalStorageManager::OrderDirection::type orderDirection,
213  QUuid requestId = QUuid());
214  void listAllTagsPerNoteFailed(Note note, LocalStorageManager::ListObjectsOptions flag,
215  size_t limit, size_t offset,
216  LocalStorageManager::ListTagsOrder::type order,
217  LocalStorageManager::OrderDirection::type orderDirection,
218  ErrorString errorDescription, QUuid requestId = QUuid());
219  void listAllTagsComplete(size_t limit, size_t offset, LocalStorageManager::ListTagsOrder::type order,
220  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
221  QList<Tag> foundTags, QUuid requestId = QUuid());
222  void listAllTagsFailed(size_t limit, size_t offset, LocalStorageManager::ListTagsOrder::type order,
223  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
224  ErrorString errorDescription, QUuid requestId = QUuid());
225  void listTagsComplete(LocalStorageManager::ListObjectsOptions flag,
226  size_t limit, size_t offset, LocalStorageManager::ListTagsOrder::type order,
227  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
228  QList<Tag> foundTags, QUuid requestId = QUuid());
229  void listTagsFailed(LocalStorageManager::ListObjectsOptions flag,
230  size_t limit, size_t offset, LocalStorageManager::ListTagsOrder::type order,
231  LocalStorageManager::OrderDirection::type orderDirection, QString linkedNotebookGuid,
232  ErrorString errorDescription, QUuid requestId = QUuid());
233  void expungeTagComplete(Tag tag, QStringList expungedChildTagLocalUids, QUuid requestId = QUuid());
234  void expungeTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId = QUuid());
235  void expungeNotelessTagsFromLinkedNotebooksComplete(QUuid requestId = QUuid());
236  void expungeNotelessTagsFromLinkedNotebooksFailed(ErrorString errorDescription, QUuid requestId = QUuid());
237 
238  // Resource-related signals:
239  void getResourceCountComplete(int resourceCount, QUuid requestId = QUuid());
240  void getResourceCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
241  void addResourceComplete(Resource resource, QUuid requestId = QUuid());
242  void addResourceFailed(Resource resource, ErrorString errorDescription, QUuid requestId = QUuid());
243  void updateResourceComplete(Resource resource, QUuid requestId = QUuid());
244  void updateResourceFailed(Resource resource, ErrorString errorDescription, QUuid requestId = QUuid());
245  void findResourceComplete(Resource resource, bool withBinaryData, QUuid requestId = QUuid());
246  void findResourceFailed(Resource resource, bool withBinaryData, ErrorString errorDescription, QUuid requestId = QUuid());
247  void expungeResourceComplete(Resource resource, QUuid requestId = QUuid());
248  void expungeResourceFailed(Resource resource, ErrorString errorDescription, QUuid requestId = QUuid());
249 
250  // Saved search-related signals:
251  void getSavedSearchCountComplete(int savedSearchCount, QUuid requestId = QUuid());
252  void getSavedSearchCountFailed(ErrorString errorDescription, QUuid requestId = QUuid());
253  void addSavedSearchComplete(SavedSearch search, QUuid requestId = QUuid());
254  void addSavedSearchFailed(SavedSearch search, ErrorString errorDescription, QUuid requestId = QUuid());
255  void updateSavedSearchComplete(SavedSearch search, QUuid requestId = QUuid());
256  void updateSavedSearchFailed(SavedSearch search, ErrorString errorDescription, QUuid requestId = QUuid());
257  void findSavedSearchComplete(SavedSearch search, QUuid requestId = QUuid());
258  void findSavedSearchFailed(SavedSearch search, ErrorString errorDescription, QUuid requestId = QUuid());
259  void listAllSavedSearchesComplete(size_t limit, size_t offset,
260  LocalStorageManager::ListSavedSearchesOrder::type order,
261  LocalStorageManager::OrderDirection::type orderDirection,
262  QList<SavedSearch> foundSearches, QUuid requestId = QUuid());
263  void listAllSavedSearchesFailed(size_t limit, size_t offset,
264  LocalStorageManager::ListSavedSearchesOrder::type order,
265  LocalStorageManager::OrderDirection::type orderDirection,
266  ErrorString errorDescription, QUuid requestId = QUuid());
267  void listSavedSearchesComplete(LocalStorageManager::ListObjectsOptions flag,
268  size_t limit, size_t offset,
269  LocalStorageManager::ListSavedSearchesOrder::type order,
270  LocalStorageManager::OrderDirection::type orderDirection,
271  QList<SavedSearch> foundSearches, QUuid requestId = QUuid());
272  void listSavedSearchesFailed(LocalStorageManager::ListObjectsOptions flag,
273  size_t limit, size_t offset,
274  LocalStorageManager::ListSavedSearchesOrder::type order,
275  LocalStorageManager::OrderDirection::type orderDirection,
276  ErrorString errorDescription, QUuid requestId = QUuid());
277  void expungeSavedSearchComplete(SavedSearch search, QUuid requestId = QUuid());
278  void expungeSavedSearchFailed(SavedSearch search, ErrorString errorDescription, QUuid requestId = QUuid());
279 
280  void accountHighUsnComplete(qint32 usn, QString linkedNotebookGuid, QUuid requestId = QUuid());
281  void accountHighUsnFailed(QString linkedNotebookGuid, ErrorString errorDescription, QUuid requestId = QUuid());
282 
283 public Q_SLOTS:
284  void init();
285 
286  // User-related slots:
287  void onGetUserCountRequest(QUuid requestId);
288  void onSwitchUserRequest(Account account, bool startFromScratch, QUuid requestId);
289  void onAddUserRequest(User user, QUuid requestId);
290  void onUpdateUserRequest(User user, QUuid requestId);
291  void onFindUserRequest(User user, QUuid requestId);
292  void onDeleteUserRequest(User user, QUuid requestId);
293  void onExpungeUserRequest(User user, QUuid requestId);
294 
295  // Notebook-related slots:
296  void onGetNotebookCountRequest(QUuid requestId);
297  void onAddNotebookRequest(Notebook notebook, QUuid requestId);
298  void onUpdateNotebookRequest(Notebook notebook, QUuid requestId);
299  void onFindNotebookRequest(Notebook notebook, QUuid requestId);
300  void onFindDefaultNotebookRequest(Notebook notebook, QUuid requestId);
301  void onFindLastUsedNotebookRequest(Notebook notebook, QUuid requestId);
302  void onFindDefaultOrLastUsedNotebookRequest(Notebook notebook, QUuid requestId);
303  void onListAllNotebooksRequest(size_t limit, size_t offset,
304  LocalStorageManager::ListNotebooksOrder::type order,
305  LocalStorageManager::OrderDirection::type orderDirection,
306  QString linkedNotebookGuid, QUuid requestId);
307  void onListAllSharedNotebooksRequest(QUuid requestId);
308  void onListNotebooksRequest(LocalStorageManager::ListObjectsOptions flag,
309  size_t limit, size_t offset,
310  LocalStorageManager::ListNotebooksOrder::type order,
311  LocalStorageManager::OrderDirection::type orderDirection,
312  QString linkedNotebookGuid, QUuid requestId);
313  void onListSharedNotebooksPerNotebookGuidRequest(QString notebookGuid, QUuid requestId);
314  void onExpungeNotebookRequest(Notebook notebook, QUuid requestId);
315 
316  // Linked notebook-related slots:
317  void onGetLinkedNotebookCountRequest(QUuid requestId);
318  void onAddLinkedNotebookRequest(LinkedNotebook linkedNotebook, QUuid requestId);
319  void onUpdateLinkedNotebookRequest(LinkedNotebook linkedNotebook, QUuid requestId);
320  void onFindLinkedNotebookRequest(LinkedNotebook linkedNotebook, QUuid requestId);
321  void onListAllLinkedNotebooksRequest(size_t limit, size_t offset,
322  LocalStorageManager::ListLinkedNotebooksOrder::type order,
323  LocalStorageManager::OrderDirection::type orderDirection,
324  QUuid requestId);
325  void onListLinkedNotebooksRequest(LocalStorageManager::ListObjectsOptions flag,
326  size_t limit, size_t offset,
327  LocalStorageManager::ListLinkedNotebooksOrder::type order,
328  LocalStorageManager::OrderDirection::type orderDirection,
329  QUuid requestId);
330  void onExpungeLinkedNotebookRequest(LinkedNotebook linkedNotebook, QUuid requestId);
331 
332  // Note-related slots:
333  void onGetNoteCountRequest(QUuid requestId);
334  void onGetNoteCountPerNotebookRequest(Notebook notebook, QUuid requestId);
335  void onGetNoteCountPerTagRequest(Tag tag, QUuid requestId);
336  void onGetNoteCountsPerAllTagsRequest(QUuid requestId);
337  void onAddNoteRequest(Note note, QUuid requestId);
338  void onUpdateNoteRequest(Note note, bool updateResources, bool updateTags, QUuid requestId);
339  void onFindNoteRequest(Note note, bool withResourceBinaryData, QUuid requestId);
340  void onListNotesPerNotebookRequest(Notebook notebook, bool withResourceBinaryData,
341  LocalStorageManager::ListObjectsOptions flag,
342  size_t limit, size_t offset,
343  LocalStorageManager::ListNotesOrder::type order,
344  LocalStorageManager::OrderDirection::type orderDirection,
345  QUuid requestId);
346  void onListNotesPerTagRequest(Tag tag, bool withResourceBinaryData,
347  LocalStorageManager::ListObjectsOptions flag,
348  size_t limit, size_t offset,
349  LocalStorageManager::ListNotesOrder::type order,
350  LocalStorageManager::OrderDirection::type orderDirection,
351  QUuid requestId);
352  void onListNotesRequest(LocalStorageManager::ListObjectsOptions flag,
353  bool withResourceBinaryData, size_t limit, size_t offset,
354  LocalStorageManager::ListNotesOrder::type order,
355  LocalStorageManager::OrderDirection::type orderDirection,
356  QString linkedNotebookGuid, QUuid requestId);
357  void onFindNoteLocalUidsWithSearchQuery(NoteSearchQuery noteSearchQuery, QUuid requestId);
358  void onExpungeNoteRequest(Note note, QUuid requestId);
359 
360  // Tag-related slots:
361  void onGetTagCountRequest(QUuid requestId);
362  void onAddTagRequest(Tag tag, QUuid requestId);
363  void onUpdateTagRequest(Tag tag, QUuid requestId);
364  void onFindTagRequest(Tag tag, QUuid requestId);
365  void onListAllTagsPerNoteRequest(Note note, LocalStorageManager::ListObjectsOptions flag,
366  size_t limit, size_t offset,
367  LocalStorageManager::ListTagsOrder::type order,
368  LocalStorageManager::OrderDirection::type orderDirection,
369  QUuid requestId);
370  void onListAllTagsRequest(size_t limit, size_t offset,
371  LocalStorageManager::ListTagsOrder::type order,
372  LocalStorageManager::OrderDirection::type orderDirection,
373  QString linkedNotebookGuid, QUuid requestId);
374  void onListTagsRequest(LocalStorageManager::ListObjectsOptions flag,
375  size_t limit, size_t offset,
376  LocalStorageManager::ListTagsOrder::type order,
377  LocalStorageManager::OrderDirection::type orderDirection,
378  QString linkedNotebookGuid, QUuid requestId);
379  void onExpungeTagRequest(Tag tag, QUuid requestId);
380  void onExpungeNotelessTagsFromLinkedNotebooksRequest(QUuid requestId);
381 
382  // Resource-related slots:
383  void onGetResourceCountRequest(QUuid requestId);
384  void onAddResourceRequest(Resource resource, QUuid requestId);
385  void onUpdateResourceRequest(Resource resource, QUuid requestId);
386  void onFindResourceRequest(Resource resource, bool withBinaryData, QUuid requestId);
387  void onExpungeResourceRequest(Resource resource, QUuid requestId);
388 
389  // Saved search-related slots:
390  void onGetSavedSearchCountRequest(QUuid requestId);
391  void onAddSavedSearchRequest(SavedSearch search, QUuid requestId);
392  void onUpdateSavedSearchRequest(SavedSearch search, QUuid requestId);
393  void onFindSavedSearchRequest(SavedSearch search, QUuid requestId);
394  void onListAllSavedSearchesRequest(size_t limit, size_t offset,
395  LocalStorageManager::ListSavedSearchesOrder::type order,
396  LocalStorageManager::OrderDirection::type orderDirection,
397  QUuid requestId);
398  void onListSavedSearchesRequest(LocalStorageManager::ListObjectsOptions flag,
399  size_t limit, size_t offset,
400  LocalStorageManager::ListSavedSearchesOrder::type order,
401  LocalStorageManager::OrderDirection::type orderDirection,
402  QUuid requestId);
403  void onExpungeSavedSearchRequest(SavedSearch search, QUuid requestId);
404 
405  void onAccountHighUsnRequest(QString linkedNotebookGuid, QUuid requestId);
406 
407 private:
408  LocalStorageManagerAsync() Q_DECL_EQ_DELETE;
409  Q_DISABLE_COPY(LocalStorageManagerAsync)
410 
411  Account m_account;
412  bool m_startFromScratch;
413  bool m_overrideLock;
414  LocalStorageManager * m_pLocalStorageManager;
415  bool m_useCache;
416  LocalStorageCacheManager * m_pLocalStorageCacheManager;
417 };
418 
419 } // namespace quentier
420 
421 #endif // LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H
Definition: LinkedNotebook.h:36
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:38
Definition: Resource.h:29
Definition: LocalStorageManagerAsync.h:39
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:24
Definition: Notebook.h:38
Definition: Tag.h:36
Definition: User.h:37
Definition: Note.h:38
The ILocalStorageCacheExpiryChecker class represents the interface for cache expiry checker used by L...
Definition: ILocalStorageCacheExpiryChecker.h:33
Definition: NoteSearchQuery.h:29
Definition: LocalStorageCacheManager.h:36
Definition: LocalStorageManager.h:49
Definition: SavedSearch.h:36