libquentier  0.5.0
The library for rich desktop clients of Evernote service
LocalStorageManagerAsync.h
1 /*
2  * Copyright 2016-2020 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/local_storage/ILocalStorageCacheExpiryChecker.h>
23 #include <quentier/local_storage/LocalStorageCacheManager.h>
24 #include <quentier/local_storage/LocalStorageManager.h>
25 #include <quentier/types/ErrorString.h>
26 #include <quentier/types/LinkedNotebook.h>
27 #include <quentier/types/Note.h>
28 #include <quentier/types/Notebook.h>
29 #include <quentier/types/Resource.h>
30 #include <quentier/types/SavedSearch.h>
31 #include <quentier/types/SharedNotebook.h>
32 #include <quentier/types/Tag.h>
33 #include <quentier/types/User.h>
34 #include <quentier/utility/Macros.h>
35 
36 #include <QObject>
37 
38 #include <memory>
39 
40 namespace quentier {
41 
42 QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsyncPrivate)
43 
44 class QUENTIER_EXPORT LocalStorageManagerAsync: public QObject
45 {
46  Q_OBJECT
47 public:
48  explicit LocalStorageManagerAsync(
49  const Account & account,
50  LocalStorageManager::StartupOptions options = 0,
51  QObject * parent = nullptr);
52 
53  virtual ~LocalStorageManagerAsync();
54 
55  void setUseCache(const bool useCache);
56 
57  const LocalStorageCacheManager * localStorageCacheManager() const;
58 
59  bool installCacheExpiryFunction(
60  const ILocalStorageCacheExpiryChecker & checker);
61 
62  const LocalStorageManager * localStorageManager() const;
63  LocalStorageManager * localStorageManager();
64 
65 Q_SIGNALS:
66  // Sent when the initialization is complete
67  void initialized();
68 
69  // User-related signals:
70  void getUserCountComplete(int userCount, QUuid requestId);
71  void getUserCountFailed(ErrorString errorDescription, QUuid requestId);
72  void switchUserComplete(Account account, QUuid requestId);
73 
74  void switchUserFailed(
75  Account account, ErrorString errorDescription, QUuid requestId);
76 
77  void addUserComplete(User user, QUuid requestId);
78 
79  void addUserFailed(
80  User user, ErrorString errorDescription, QUuid requestId);
81 
82  void updateUserComplete(User user, QUuid requestId);
83 
84  void updateUserFailed(
85  User user, ErrorString errorDescription, QUuid requestId);
86 
87  void findUserComplete(User foundUser, QUuid requestId);
88 
89  void findUserFailed(
90  User user, ErrorString errorDescription, QUuid requestId);
91 
92  void deleteUserComplete(User user, QUuid requestId);
93 
94  void deleteUserFailed(
95  User user, ErrorString errorDescription, QUuid requestId);
96 
97  void expungeUserComplete(User user, QUuid requestId);
98 
99  void expungeUserFailed(
100  User user, ErrorString errorDescription, QUuid requestId);
101 
102  // Notebook-related signals:
103  void getNotebookCountComplete(int notebookCount, QUuid requestId);
104  void getNotebookCountFailed(ErrorString errorDescription, QUuid requestId);
105  void addNotebookComplete(Notebook notebook, QUuid requestId);
106 
107  void addNotebookFailed(
108  Notebook notebook, ErrorString errorDescription, QUuid requestId);
109 
110  void updateNotebookComplete(Notebook notebook, QUuid requestId);
111 
112  void updateNotebookFailed(
113  Notebook notebook, ErrorString errorDescription, QUuid requestId);
114 
115  void findNotebookComplete(Notebook foundNotebook, QUuid requestId);
116 
117  void findNotebookFailed(
118  Notebook notebook, ErrorString errorDescription, QUuid requestId);
119 
120  void findDefaultNotebookComplete(Notebook foundNotebook, QUuid requestId);
121 
122  void findDefaultNotebookFailed(
123  Notebook notebook, ErrorString errorDescription, QUuid requestId);
124 
125  void findLastUsedNotebookComplete(Notebook foundNotebook, QUuid requestId);
126 
127  void findLastUsedNotebookFailed(
128  Notebook notebook, ErrorString errorDescription, QUuid requestId);
129 
130  void findDefaultOrLastUsedNotebookComplete(
131  Notebook foundNotebook, QUuid requestId);
132 
133  void findDefaultOrLastUsedNotebookFailed(
134  Notebook notebook, ErrorString errorDescription, QUuid requestId);
135 
136  void listAllNotebooksComplete(
137  size_t limit, size_t offset,
140  QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
141  QUuid requestId);
142 
143  void listAllNotebooksFailed(
144  size_t limit, size_t offset,
147  QString linkedNotebookGuid, ErrorString errorDescription,
148  QUuid requestId);
149 
150  void listNotebooksComplete(
151  LocalStorageManager::ListObjectsOptions flag,
152  size_t limit, size_t offset,
155  QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
156  QUuid requestId);
157 
158  void listNotebooksFailed(
159  LocalStorageManager::ListObjectsOptions flag,
160  size_t limit, size_t offset,
163  QString linkedNotebookGuid, ErrorString errorDescription,
164  QUuid requestId);
165 
166  void listAllSharedNotebooksComplete(
167  QList<SharedNotebook> foundSharedNotebooks, QUuid requestId);
168 
169  void listAllSharedNotebooksFailed(
170  ErrorString errorDescription, QUuid requestId);
171 
172  void listSharedNotebooksPerNotebookGuidComplete(
173  QString notebookGuid, QList<SharedNotebook> foundSharedNotebooks,
174  QUuid requestId);
175 
176  void listSharedNotebooksPerNotebookGuidFailed(
177  QString notebookGuid, ErrorString errorDescription, QUuid requestId);
178 
179  void expungeNotebookComplete(Notebook notebook, QUuid requestId);
180 
181  void expungeNotebookFailed(
182  Notebook notebook, ErrorString errorDescription, QUuid requestId);
183 
184  // Linked notebook-related signals:
185  void getLinkedNotebookCountComplete(
186  int linkedNotebookCount, QUuid requestId);
187 
188  void getLinkedNotebookCountFailed(
189  ErrorString errorDescription, QUuid requestId);
190 
191  void addLinkedNotebookComplete(
192  LinkedNotebook linkedNotebook, QUuid requestId);
193 
194  void addLinkedNotebookFailed(
195  LinkedNotebook linkedNotebook, ErrorString errorDescription,
196  QUuid requestId);
197 
198  void updateLinkedNotebookComplete(
199  LinkedNotebook linkedNotebook, QUuid requestId);
200 
201  void updateLinkedNotebookFailed(
202  LinkedNotebook linkedNotebook, ErrorString errorDescription,
203  QUuid requestId);
204 
205  void findLinkedNotebookComplete(
206  LinkedNotebook foundLinkedNotebook, QUuid requestId);
207 
208  void findLinkedNotebookFailed(
209  LinkedNotebook linkedNotebook, ErrorString errorDescription,
210  QUuid requestId);
211 
212  void listAllLinkedNotebooksComplete(
213  size_t limit, size_t offset,
216  QList<LinkedNotebook> foundLinkedNotebooks,
217  QUuid requestId);
218 
219  void listAllLinkedNotebooksFailed(
220  size_t limit, size_t offset,
223  ErrorString errorDescription, QUuid requestId);
224 
225  void listLinkedNotebooksComplete(
226  LocalStorageManager::ListObjectsOptions flag,
227  size_t limit, size_t offset,
230  QList<LinkedNotebook> foundLinkedNotebooks, QUuid requestId);
231 
232  void listLinkedNotebooksFailed(
233  LocalStorageManager::ListObjectsOptions flag,
234  size_t limit, size_t offset,
237  ErrorString errorDescription, QUuid requestId);
238 
239  void expungeLinkedNotebookComplete(
240  LinkedNotebook linkedNotebook, QUuid requestId);
241 
242  void expungeLinkedNotebookFailed(
243  LinkedNotebook linkedNotebook, ErrorString errorDescription,
244  QUuid requestId);
245 
246  // Note-related signals:
247  void getNoteCountComplete(
248  int noteCount, LocalStorageManager::NoteCountOptions options,
249  QUuid requestId);
250 
251  void getNoteCountFailed(
252  ErrorString errorDescription,
253  LocalStorageManager::NoteCountOptions options, QUuid requestId);
254 
255  void getNoteCountPerNotebookComplete(
256  int noteCount, Notebook notebook,
257  LocalStorageManager::NoteCountOptions options, QUuid requestId);
258 
259  void getNoteCountPerNotebookFailed(
260  ErrorString errorDescription, Notebook notebook,
261  LocalStorageManager::NoteCountOptions options, QUuid requestId);
262 
263  void getNoteCountPerTagComplete(
264  int noteCount, Tag tag, LocalStorageManager::NoteCountOptions options,
265  QUuid requestId);
266 
267  void getNoteCountPerTagFailed(
268  ErrorString errorDescription, Tag tag,
269  LocalStorageManager::NoteCountOptions options, QUuid requestId);
270 
271  void getNoteCountsPerAllTagsComplete(
272  QHash<QString, int> noteCountsPerTagLocalUid,
273  LocalStorageManager::NoteCountOptions options, QUuid requestId);
274 
275  void getNoteCountsPerAllTagsFailed(
276  ErrorString errorDescription,
277  LocalStorageManager::NoteCountOptions options, QUuid requestId);
278 
279  void getNoteCountPerNotebooksAndTagsComplete(
280  int noteCount, QStringList notebookLocalUids, QStringList tagLocalUids,
281  LocalStorageManager::NoteCountOptions options, QUuid requestId);
282 
283  void getNoteCountPerNotebooksAndTagsFailed(
284  ErrorString errorDescription, QStringList notebookLocalUids,
285  QStringList tagLocalUids, LocalStorageManager::NoteCountOptions options,
286  QUuid requestId);
287 
288  void addNoteComplete(Note note, QUuid requestId);
289 
290  void addNoteFailed(
291  Note note, ErrorString errorDescription, QUuid requestId);
292 
293  void updateNoteComplete(
294  Note note, LocalStorageManager::UpdateNoteOptions options,
295  QUuid requestId);
296 
297  void updateNoteFailed(
298  Note note, LocalStorageManager::UpdateNoteOptions options,
299  ErrorString errorDescription, QUuid requestId);
300 
301  void findNoteComplete(
302  Note foundNote, LocalStorageManager::GetNoteOptions options,
303  QUuid requestId);
304 
305  void findNoteFailed(
306  Note note, LocalStorageManager::GetNoteOptions options,
307  ErrorString errorDescription, QUuid requestId);
308 
309  void listNotesPerNotebookComplete(
310  Notebook notebook, LocalStorageManager::GetNoteOptions options,
311  LocalStorageManager::ListObjectsOptions flag,
312  size_t limit, size_t offset,
315  QList<Note> foundNotes, QUuid requestId);
316 
317  void listNotesPerNotebookFailed(
318  Notebook notebook, LocalStorageManager::GetNoteOptions options,
319  LocalStorageManager::ListObjectsOptions flag,
320  size_t limit, size_t offset,
323  ErrorString errorDescription, QUuid requestId);
324 
325  void listNotesPerTagComplete(
326  Tag tag, LocalStorageManager::GetNoteOptions options,
327  LocalStorageManager::ListObjectsOptions flag,
328  size_t limit, size_t offset,
331  QList<Note> foundNotes, QUuid requestId);
332 
333  void listNotesPerTagFailed(
334  Tag tag, LocalStorageManager::GetNoteOptions options,
335  LocalStorageManager::ListObjectsOptions flag,
336  size_t limit, size_t offset,
339  ErrorString errorDescription, QUuid requestId);
340 
341  void listNotesPerNotebooksAndTagsComplete(
342  QStringList notebookLocalUids,
343  QStringList tagLocalUids,
344  LocalStorageManager::GetNoteOptions options,
345  LocalStorageManager::ListObjectsOptions flag,
346  size_t limit, size_t offset,
349  QList<Note> foundNotes, QUuid requestId);
350 
351  void listNotesPerNotebooksAndTagsFailed(
352  QStringList notebookLocalUids,
353  QStringList tagLocalUids,
354  LocalStorageManager::GetNoteOptions options,
355  LocalStorageManager::ListObjectsOptions flag,
356  size_t limit, size_t offset,
359  ErrorString errorDescription, QUuid requestId);
360 
361  void listNotesByLocalUidsComplete(
362  QStringList noteLocalUids,
363  LocalStorageManager::GetNoteOptions options,
364  LocalStorageManager::ListObjectsOptions flag,
365  size_t limit, size_t offset,
368  QList<Note> foundNotes, QUuid requestId);
369 
370  void listNotesByLocalUidsFailed(
371  QStringList noteLocalUids,
372  LocalStorageManager::GetNoteOptions options,
373  LocalStorageManager::ListObjectsOptions flag,
374  size_t limit, size_t offset,
377  ErrorString errorDescription, QUuid requestId);
378 
379  void listNotesComplete(
380  LocalStorageManager::ListObjectsOptions flag,
381  LocalStorageManager::GetNoteOptions options,
382  size_t limit, size_t offset,
385  QString linkedNotebookGuid, QList<Note> foundNotes,
386  QUuid requestId);
387 
388  void listNotesFailed(
389  LocalStorageManager::ListObjectsOptions flag,
390  LocalStorageManager::GetNoteOptions options,
391  size_t limit, size_t offset,
394  QString linkedNotebookGuid, ErrorString errorDescription,
395  QUuid requestId);
396 
397  void findNoteLocalUidsWithSearchQueryComplete(
398  QStringList noteLocalUids, NoteSearchQuery noteSearchQuery,
399  QUuid requestId);
400 
401  void findNoteLocalUidsWithSearchQueryFailed(
402  NoteSearchQuery noteSearchQuery, ErrorString errorDescription,
403  QUuid requestId);
404 
405  void expungeNoteComplete(Note note, QUuid requestId);
406 
407  void expungeNoteFailed(
408  Note note, ErrorString errorDescription, QUuid requestId);
409 
410  // Specialized signal emitted alongside updateNoteComplete (after it)
411  // if the update of a note causes the change of its notebook
412  void noteMovedToAnotherNotebook(
413  QString noteLocalUid, QString previousNotebookLocalUid,
414  QString newNotebookLocalUid);
415 
416  // Specialized signal emitted alongside updateNoteComplete (after it)
417  // if the update of a note causes the change of its set of tags
418  void noteTagListChanged(
419  QString noteLocalUid, QStringList previousNoteTagLocalUids,
420  QStringList newNoteTagLocalUids);
421 
422  // Tag-related signals:
423  void getTagCountComplete(int tagCount, QUuid requestId);
424  void getTagCountFailed(ErrorString errorDescription, QUuid requestId);
425  void addTagComplete(Tag tag, QUuid requestId);
426  void addTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId);
427  void updateTagComplete(Tag tag, QUuid requestId);
428 
429  void updateTagFailed(
430  Tag tag, ErrorString errorDescription, QUuid requestId);
431 
432  void linkTagWithNoteComplete(Tag tag, Note note, QUuid requestId);
433 
434  void linkTagWithNoteFailed(
435  Tag tag, Note note, ErrorString errorDescription, QUuid requestId);
436 
437  void findTagComplete(Tag tag, QUuid requestId);
438  void findTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId);
439 
440  void listAllTagsPerNoteComplete(
441  QList<Tag> foundTags, Note note,
442  LocalStorageManager::ListObjectsOptions flag,
443  size_t limit, size_t offset,
445  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
446 
447  void listAllTagsPerNoteFailed(
448  Note note, LocalStorageManager::ListObjectsOptions flag,
449  size_t limit, size_t offset,
452  ErrorString errorDescription, QUuid requestId);
453 
454  void listAllTagsComplete(
455  size_t limit, size_t offset,
458  QString linkedNotebookGuid, QList<Tag> foundTags, QUuid requestId);
459 
460  void listAllTagsFailed(
461  size_t limit, size_t offset,
464  QString linkedNotebookGuid, ErrorString errorDescription,
465  QUuid requestId);
466 
467  void listTagsComplete(
468  LocalStorageManager::ListObjectsOptions flag,
469  size_t limit, size_t offset,
472  QString linkedNotebookGuid, QList<Tag> foundTags,
473  QUuid requestId = QUuid());
474 
475  void listTagsFailed(
476  LocalStorageManager::ListObjectsOptions flag,
477  size_t limit, size_t offset,
480  QString linkedNotebookGuid, ErrorString errorDescription,
481  QUuid requestId);
482 
483  void listTagsWithNoteLocalUidsComplete(
484  LocalStorageManager::ListObjectsOptions flag,
485  size_t limit, size_t offset,
488  QString linkedNotebookGuid,
489  QList<std::pair<Tag, QStringList> > foundTags,
490  QUuid requestId);
491 
492  void listTagsWithNoteLocalUidsFailed(
493  LocalStorageManager::ListObjectsOptions flag,
494  size_t limit, size_t offset,
497  QString linkedNotebookGuid, ErrorString errorDescription,
498  QUuid requestId);
499 
500  void expungeTagComplete(
501  Tag tag, QStringList expungedChildTagLocalUids, QUuid requestId);
502 
503  void expungeTagFailed(
504  Tag tag, ErrorString errorDescription, QUuid requestId);
505 
506  void expungeNotelessTagsFromLinkedNotebooksComplete(QUuid requestId);
507 
508  void expungeNotelessTagsFromLinkedNotebooksFailed(
509  ErrorString errorDescription, QUuid requestId);
510 
511  // Resource-related signals:
512  void getResourceCountComplete(int resourceCount, QUuid requestId);
513  void getResourceCountFailed(ErrorString errorDescription, QUuid requestId);
514  void addResourceComplete(Resource resource, QUuid requestId);
515 
516  void addResourceFailed(
517  Resource resource, ErrorString errorDescription, QUuid requestId);
518 
519  void updateResourceComplete(Resource resource, QUuid requestId);
520 
521  void updateResourceFailed(
522  Resource resource, ErrorString errorDescription, QUuid requestId);
523 
524  void findResourceComplete(
525  Resource resource, LocalStorageManager::GetResourceOptions options,
526  QUuid requestId);
527 
528  void findResourceFailed(
529  Resource resource, LocalStorageManager::GetResourceOptions options,
530  ErrorString errorDescription, QUuid requestId);
531 
532  void expungeResourceComplete(Resource resource, QUuid requestId);
533 
534  void expungeResourceFailed(
535  Resource resource, ErrorString errorDescription, QUuid requestId);
536 
537  // Saved search-related signals:
538  void getSavedSearchCountComplete(int savedSearchCount, QUuid requestId);
539 
540  void getSavedSearchCountFailed(
541  ErrorString errorDescription, QUuid requestId);
542 
543  void addSavedSearchComplete(SavedSearch search, QUuid requestId);
544 
545  void addSavedSearchFailed(
546  SavedSearch search, ErrorString errorDescription, QUuid requestId);
547 
548  void updateSavedSearchComplete(SavedSearch search, QUuid requestId);
549 
550  void updateSavedSearchFailed(
551  SavedSearch search, ErrorString errorDescription, QUuid requestId);
552 
553  void findSavedSearchComplete(SavedSearch search, QUuid requestId);
554 
555  void findSavedSearchFailed(
556  SavedSearch search, ErrorString errorDescription, QUuid requestId);
557 
558  void listAllSavedSearchesComplete(
559  size_t limit, size_t offset,
562  QList<SavedSearch> foundSearches, QUuid requestId);
563 
564  void listAllSavedSearchesFailed(
565  size_t limit, size_t offset,
568  ErrorString errorDescription, QUuid requestId);
569 
570  void listSavedSearchesComplete(
571  LocalStorageManager::ListObjectsOptions flag,
572  size_t limit, size_t offset,
575  QList<SavedSearch> foundSearches, QUuid requestId);
576 
577  void listSavedSearchesFailed(
578  LocalStorageManager::ListObjectsOptions flag,
579  size_t limit, size_t offset,
582  ErrorString errorDescription, QUuid requestId);
583 
584  void expungeSavedSearchComplete(SavedSearch search, QUuid requestId);
585 
586  void expungeSavedSearchFailed(
587  SavedSearch search, ErrorString errorDescription, QUuid requestId);
588 
589  void accountHighUsnComplete(
590  qint32 usn, QString linkedNotebookGuid, QUuid requestId);
591 
592  void accountHighUsnFailed(
593  QString linkedNotebookGuid, ErrorString errorDescription,
594  QUuid requestId);
595 
596 public Q_SLOTS:
597  void init();
598 
599  // User-related slots:
600  void onGetUserCountRequest(QUuid requestId);
601 
602  void onSwitchUserRequest(
603  Account account, LocalStorageManager::StartupOptions startupOptions,
604  QUuid requestId);
605 
606  void onAddUserRequest(User user, QUuid requestId);
607  void onUpdateUserRequest(User user, QUuid requestId);
608  void onFindUserRequest(User user, QUuid requestId);
609  void onDeleteUserRequest(User user, QUuid requestId);
610  void onExpungeUserRequest(User user, QUuid requestId);
611 
612  // Notebook-related slots:
613  void onGetNotebookCountRequest(QUuid requestId);
614  void onAddNotebookRequest(Notebook notebook, QUuid requestId);
615  void onUpdateNotebookRequest(Notebook notebook, QUuid requestId);
616  void onFindNotebookRequest(Notebook notebook, QUuid requestId);
617  void onFindDefaultNotebookRequest(Notebook notebook, QUuid requestId);
618  void onFindLastUsedNotebookRequest(Notebook notebook, QUuid requestId);
619 
620  void onFindDefaultOrLastUsedNotebookRequest(
621  Notebook notebook, QUuid requestId);
622 
623  void onListAllNotebooksRequest(
624  size_t limit, size_t offset,
627  QString linkedNotebookGuid, QUuid requestId);
628 
629  void onListAllSharedNotebooksRequest(QUuid requestId);
630 
631  void onListNotebooksRequest(
632  LocalStorageManager::ListObjectsOptions flag,
633  size_t limit, size_t offset,
636  QString linkedNotebookGuid, QUuid requestId);
637 
638  void onListSharedNotebooksPerNotebookGuidRequest(
639  QString notebookGuid, QUuid requestId);
640 
641  void onExpungeNotebookRequest(Notebook notebook, QUuid requestId);
642 
643  // Linked notebook-related slots:
644  void onGetLinkedNotebookCountRequest(QUuid requestId);
645 
646  void onAddLinkedNotebookRequest(
647  LinkedNotebook linkedNotebook, QUuid requestId);
648 
649  void onUpdateLinkedNotebookRequest(
650  LinkedNotebook linkedNotebook, QUuid requestId);
651 
652  void onFindLinkedNotebookRequest(
653  LinkedNotebook linkedNotebook, QUuid requestId);
654 
655  void onListAllLinkedNotebooksRequest(
656  size_t limit, size_t offset,
658  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
659 
660  void onListLinkedNotebooksRequest(
661  LocalStorageManager::ListObjectsOptions flag,
662  size_t limit, size_t offset,
665  QUuid requestId);
666 
667  void onExpungeLinkedNotebookRequest(
668  LinkedNotebook linkedNotebook, QUuid requestId);
669 
670  // Note-related slots:
671  void onGetNoteCountRequest(
672  LocalStorageManager::NoteCountOptions options, QUuid requestId);
673 
674  void onGetNoteCountPerNotebookRequest(
675  Notebook notebook, LocalStorageManager::NoteCountOptions options,
676  QUuid requestId);
677 
678  void onGetNoteCountPerTagRequest(
679  Tag tag, LocalStorageManager::NoteCountOptions options,
680  QUuid requestId);
681 
682  void onGetNoteCountsPerAllTagsRequest(
683  LocalStorageManager::NoteCountOptions options, QUuid requestId);
684 
685  void onGetNoteCountPerNotebooksAndTagsRequest(
686  QStringList notebookLocalUids, QStringList tagLocalUids,
687  LocalStorageManager::NoteCountOptions options, QUuid requestId);
688 
689  void onAddNoteRequest(Note note, QUuid requestId);
690 
691  void onUpdateNoteRequest(
692  Note note, LocalStorageManager::UpdateNoteOptions options,
693  QUuid requestId);
694 
695  void onFindNoteRequest(
696  Note note, LocalStorageManager::GetNoteOptions options,
697  QUuid requestId);
698 
699  void onListNotesPerNotebookRequest(
700  Notebook notebook, LocalStorageManager::GetNoteOptions options,
701  LocalStorageManager::ListObjectsOptions flag,
702  size_t limit, size_t offset,
704  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
705 
706  void onListNotesPerTagRequest(
707  Tag tag, LocalStorageManager::GetNoteOptions options,
708  LocalStorageManager::ListObjectsOptions flag,
709  size_t limit, size_t offset,
711  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
712 
713  void onListNotesPerNotebooksAndTagsRequest(
714  QStringList notebookLocalUids, QStringList tagLocalUids,
715  LocalStorageManager::GetNoteOptions options,
716  LocalStorageManager::ListObjectsOptions flag,
717  size_t limit, size_t offset,
719  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
720 
721  void onListNotesByLocalUidsRequest(
722  QStringList noteLocalUids,
723  LocalStorageManager::GetNoteOptions options,
724  LocalStorageManager::ListObjectsOptions flag,
725  size_t limit, size_t offset,
727  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
728 
729  void onListNotesRequest(
730  LocalStorageManager::ListObjectsOptions flag,
731  LocalStorageManager::GetNoteOptions options,
732  size_t limit, size_t offset,
735  QString linkedNotebookGuid, QUuid requestId);
736 
737  void onFindNoteLocalUidsWithSearchQuery(
738  NoteSearchQuery noteSearchQuery, QUuid requestId);
739 
740  void onExpungeNoteRequest(Note note, QUuid requestId);
741 
742  // Tag-related slots:
743  void onGetTagCountRequest(QUuid requestId);
744  void onAddTagRequest(Tag tag, QUuid requestId);
745  void onUpdateTagRequest(Tag tag, QUuid requestId);
746  void onFindTagRequest(Tag tag, QUuid requestId);
747 
748  void onListAllTagsPerNoteRequest(
749  Note note, LocalStorageManager::ListObjectsOptions flag,
750  size_t limit, size_t offset,
752  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
753 
754  void onListAllTagsRequest(
755  size_t limit, size_t offset,
758  QString linkedNotebookGuid, QUuid requestId);
759 
760  void onListTagsRequest(
761  LocalStorageManager::ListObjectsOptions flag,
762  size_t limit, size_t offset,
765  QString linkedNotebookGuid, QUuid requestId);
766 
767  void onListTagsWithNoteLocalUidsRequest(
768  LocalStorageManager::ListObjectsOptions flag,
769  size_t limit, size_t offset,
772  QString linkedNotebookGuid, QUuid requestId);
773 
774  void onExpungeTagRequest(Tag tag, QUuid requestId);
775  void onExpungeNotelessTagsFromLinkedNotebooksRequest(QUuid requestId);
776 
777  // Resource-related slots:
778  void onGetResourceCountRequest(QUuid requestId);
779  void onAddResourceRequest(Resource resource, QUuid requestId);
780  void onUpdateResourceRequest(Resource resource, QUuid requestId);
781 
782  void onFindResourceRequest(
783  Resource resource,
784  LocalStorageManager::GetResourceOptions options,
785  QUuid requestId);
786 
787  void onExpungeResourceRequest(Resource resource, QUuid requestId);
788 
789  // Saved search-related slots:
790  void onGetSavedSearchCountRequest(QUuid requestId);
791  void onAddSavedSearchRequest(SavedSearch search, QUuid requestId);
792  void onUpdateSavedSearchRequest(SavedSearch search, QUuid requestId);
793  void onFindSavedSearchRequest(SavedSearch search, QUuid requestId);
794 
795  void onListAllSavedSearchesRequest(
796  size_t limit, size_t offset,
798  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
799 
800  void onListSavedSearchesRequest(
801  LocalStorageManager::ListObjectsOptions flag,
802  size_t limit, size_t offset,
804  LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
805 
806  void onExpungeSavedSearchRequest(SavedSearch search, QUuid requestId);
807 
808  void onAccountHighUsnRequest(QString linkedNotebookGuid, QUuid requestId);
809 
810 private:
811  LocalStorageManagerAsync() = delete;
812  Q_DISABLE_COPY(LocalStorageManagerAsync)
813 
814  LocalStorageManagerAsyncPrivate * const d_ptr;
815  Q_DECLARE_PRIVATE(LocalStorageManagerAsync)
816 };
817 
818 } // namespace quentier
819 
820 #endif // LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H
ListLinkedNotebooksOrder
The ListLinkedNotebooksOrder enum allows to specify the results ordering for methods listing linked n...
Definition: LocalStorageManager.h:715
ListNotebooksOrder
The ListNotebooksOrder allows to specify the results ordering for methods listing notebooks from the ...
Definition: LocalStorageManager.h:496
Definition: LinkedNotebook.h:32
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
Definition: Resource.h:29
ListTagsOrder
The ListTagsOrder enum allows to specify the results ordering for methods listing tags from the local...
Definition: LocalStorageManager.h:1453
Definition: LocalStorageManagerAsync.h:44
Definition: DecryptedTextManager.h:26
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:39
Definition: Notebook.h:34
Definition: Tag.h:32
Definition: User.h:33
Definition: Note.h:34
The ILocalStorageCacheExpiryChecker class represents the interface for cache expiry checker used by L...
Definition: ILocalStorageCacheExpiryChecker.h:34
ListNotesOrder
The ListNotesOrder enum allows to specify the results ordering for methods listing notes from the loc...
Definition: LocalStorageManager.h:1110
Definition: NoteSearchQuery.h:30
Definition: LocalStorageCacheManager.h:38
OrderDirection
The OrderDirection enum specifies the direction of ordering of the results for methods listing the ob...
Definition: LocalStorageManager.h:480
Definition: LocalStorageManager.h:55
ListSavedSearchesOrder
The ListSavedSearchesOrder enum allows to specify the results ordering for methods listing saved sear...
Definition: LocalStorageManager.h:1859
Definition: SavedSearch.h:32