19 #ifndef LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H 20 #define LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H 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> 42 QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsyncPrivate)
50 LocalStorageManager::StartupOptions options = 0,
51 QObject * parent =
nullptr);
55 void setUseCache(
const bool useCache);
59 bool installCacheExpiryFunction(
70 void getUserCountComplete(
int userCount, QUuid requestId);
71 void getUserCountFailed(
ErrorString errorDescription, QUuid requestId);
72 void switchUserComplete(
Account account, QUuid requestId);
74 void switchUserFailed(
77 void addUserComplete(
User user, QUuid requestId);
82 void updateUserComplete(
User user, QUuid requestId);
84 void updateUserFailed(
87 void findUserComplete(
User foundUser, QUuid requestId);
92 void deleteUserComplete(
User user, QUuid requestId);
94 void deleteUserFailed(
97 void expungeUserComplete(
User user, QUuid requestId);
99 void expungeUserFailed(
103 void getNotebookCountComplete(
int notebookCount, QUuid requestId);
104 void getNotebookCountFailed(
ErrorString errorDescription, QUuid requestId);
105 void addNotebookComplete(
Notebook notebook, QUuid requestId);
107 void addNotebookFailed(
110 void updateNotebookComplete(
Notebook notebook, QUuid requestId);
112 void updateNotebookFailed(
115 void findNotebookComplete(
Notebook foundNotebook, QUuid requestId);
117 void findNotebookFailed(
120 void findDefaultNotebookComplete(
Notebook foundNotebook, QUuid requestId);
122 void findDefaultNotebookFailed(
125 void findLastUsedNotebookComplete(
Notebook foundNotebook, QUuid requestId);
127 void findLastUsedNotebookFailed(
130 void findDefaultOrLastUsedNotebookComplete(
131 Notebook foundNotebook, QUuid requestId);
133 void findDefaultOrLastUsedNotebookFailed(
136 void listAllNotebooksComplete(
137 size_t limit,
size_t offset,
140 QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
143 void listAllNotebooksFailed(
144 size_t limit,
size_t offset,
147 QString linkedNotebookGuid,
ErrorString errorDescription,
150 void listNotebooksComplete(
151 LocalStorageManager::ListObjectsOptions flag,
152 size_t limit,
size_t offset,
155 QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
158 void listNotebooksFailed(
159 LocalStorageManager::ListObjectsOptions flag,
160 size_t limit,
size_t offset,
163 QString linkedNotebookGuid,
ErrorString errorDescription,
166 void listAllSharedNotebooksComplete(
167 QList<SharedNotebook> foundSharedNotebooks, QUuid requestId);
169 void listAllSharedNotebooksFailed(
172 void listSharedNotebooksPerNotebookGuidComplete(
173 QString notebookGuid, QList<SharedNotebook> foundSharedNotebooks,
176 void listSharedNotebooksPerNotebookGuidFailed(
177 QString notebookGuid,
ErrorString errorDescription, QUuid requestId);
179 void expungeNotebookComplete(
Notebook notebook, QUuid requestId);
181 void expungeNotebookFailed(
185 void getLinkedNotebookCountComplete(
186 int linkedNotebookCount, QUuid requestId);
188 void getLinkedNotebookCountFailed(
191 void addLinkedNotebookComplete(
194 void addLinkedNotebookFailed(
198 void updateLinkedNotebookComplete(
201 void updateLinkedNotebookFailed(
205 void findLinkedNotebookComplete(
208 void findLinkedNotebookFailed(
212 void listAllLinkedNotebooksComplete(
213 size_t limit,
size_t offset,
216 QList<LinkedNotebook> foundLinkedNotebooks,
219 void listAllLinkedNotebooksFailed(
220 size_t limit,
size_t offset,
225 void listLinkedNotebooksComplete(
226 LocalStorageManager::ListObjectsOptions flag,
227 size_t limit,
size_t offset,
230 QList<LinkedNotebook> foundLinkedNotebooks, QUuid requestId);
232 void listLinkedNotebooksFailed(
233 LocalStorageManager::ListObjectsOptions flag,
234 size_t limit,
size_t offset,
239 void expungeLinkedNotebookComplete(
242 void expungeLinkedNotebookFailed(
247 void getNoteCountComplete(
248 int noteCount, LocalStorageManager::NoteCountOptions options,
251 void getNoteCountFailed(
253 LocalStorageManager::NoteCountOptions options, QUuid requestId);
255 void getNoteCountPerNotebookComplete(
257 LocalStorageManager::NoteCountOptions options, QUuid requestId);
259 void getNoteCountPerNotebookFailed(
261 LocalStorageManager::NoteCountOptions options, QUuid requestId);
263 void getNoteCountPerTagComplete(
264 int noteCount,
Tag tag, LocalStorageManager::NoteCountOptions options,
267 void getNoteCountPerTagFailed(
269 LocalStorageManager::NoteCountOptions options, QUuid requestId);
271 void getNoteCountsPerAllTagsComplete(
272 QHash<QString, int> noteCountsPerTagLocalUid,
273 LocalStorageManager::NoteCountOptions options, QUuid requestId);
275 void getNoteCountsPerAllTagsFailed(
277 LocalStorageManager::NoteCountOptions options, QUuid requestId);
279 void getNoteCountPerNotebooksAndTagsComplete(
280 int noteCount, QStringList notebookLocalUids, QStringList tagLocalUids,
281 LocalStorageManager::NoteCountOptions options, QUuid requestId);
283 void getNoteCountPerNotebooksAndTagsFailed(
284 ErrorString errorDescription, QStringList notebookLocalUids,
285 QStringList tagLocalUids, LocalStorageManager::NoteCountOptions options,
288 void addNoteComplete(
Note note, QUuid requestId);
293 void updateNoteComplete(
294 Note note, LocalStorageManager::UpdateNoteOptions options,
297 void updateNoteFailed(
298 Note note, LocalStorageManager::UpdateNoteOptions options,
301 void findNoteComplete(
302 Note foundNote, LocalStorageManager::GetNoteOptions options,
306 Note note, LocalStorageManager::GetNoteOptions options,
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);
317 void listNotesPerNotebookFailed(
318 Notebook notebook, LocalStorageManager::GetNoteOptions options,
319 LocalStorageManager::ListObjectsOptions flag,
320 size_t limit,
size_t offset,
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);
333 void listNotesPerTagFailed(
334 Tag tag, LocalStorageManager::GetNoteOptions options,
335 LocalStorageManager::ListObjectsOptions flag,
336 size_t limit,
size_t offset,
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);
351 void listNotesPerNotebooksAndTagsFailed(
352 QStringList notebookLocalUids,
353 QStringList tagLocalUids,
354 LocalStorageManager::GetNoteOptions options,
355 LocalStorageManager::ListObjectsOptions flag,
356 size_t limit,
size_t offset,
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);
370 void listNotesByLocalUidsFailed(
371 QStringList noteLocalUids,
372 LocalStorageManager::GetNoteOptions options,
373 LocalStorageManager::ListObjectsOptions flag,
374 size_t limit,
size_t offset,
379 void listNotesComplete(
380 LocalStorageManager::ListObjectsOptions flag,
381 LocalStorageManager::GetNoteOptions options,
382 size_t limit,
size_t offset,
385 QString linkedNotebookGuid, QList<Note> foundNotes,
388 void listNotesFailed(
389 LocalStorageManager::ListObjectsOptions flag,
390 LocalStorageManager::GetNoteOptions options,
391 size_t limit,
size_t offset,
394 QString linkedNotebookGuid,
ErrorString errorDescription,
397 void findNoteLocalUidsWithSearchQueryComplete(
401 void findNoteLocalUidsWithSearchQueryFailed(
405 void expungeNoteComplete(
Note note, QUuid requestId);
407 void expungeNoteFailed(
412 void noteMovedToAnotherNotebook(
413 QString noteLocalUid, QString previousNotebookLocalUid,
414 QString newNotebookLocalUid);
418 void noteTagListChanged(
419 QString noteLocalUid, QStringList previousNoteTagLocalUids,
420 QStringList newNoteTagLocalUids);
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);
429 void updateTagFailed(
432 void linkTagWithNoteComplete(
Tag tag,
Note note, QUuid requestId);
434 void linkTagWithNoteFailed(
437 void findTagComplete(
Tag tag, QUuid requestId);
438 void findTagFailed(
Tag tag,
ErrorString errorDescription, QUuid requestId);
440 void listAllTagsPerNoteComplete(
441 QList<Tag> foundTags,
Note note,
442 LocalStorageManager::ListObjectsOptions flag,
443 size_t limit,
size_t offset,
447 void listAllTagsPerNoteFailed(
448 Note note, LocalStorageManager::ListObjectsOptions flag,
449 size_t limit,
size_t offset,
454 void listAllTagsComplete(
455 size_t limit,
size_t offset,
458 QString linkedNotebookGuid, QList<Tag> foundTags, QUuid requestId);
460 void listAllTagsFailed(
461 size_t limit,
size_t offset,
464 QString linkedNotebookGuid,
ErrorString errorDescription,
467 void listTagsComplete(
468 LocalStorageManager::ListObjectsOptions flag,
469 size_t limit,
size_t offset,
472 QString linkedNotebookGuid, QList<Tag> foundTags,
473 QUuid requestId = QUuid());
476 LocalStorageManager::ListObjectsOptions flag,
477 size_t limit,
size_t offset,
480 QString linkedNotebookGuid,
ErrorString errorDescription,
483 void listTagsWithNoteLocalUidsComplete(
484 LocalStorageManager::ListObjectsOptions flag,
485 size_t limit,
size_t offset,
488 QString linkedNotebookGuid,
489 QList<std::pair<Tag, QStringList> > foundTags,
492 void listTagsWithNoteLocalUidsFailed(
493 LocalStorageManager::ListObjectsOptions flag,
494 size_t limit,
size_t offset,
497 QString linkedNotebookGuid,
ErrorString errorDescription,
500 void expungeTagComplete(
501 Tag tag, QStringList expungedChildTagLocalUids, QUuid requestId);
503 void expungeTagFailed(
506 void expungeNotelessTagsFromLinkedNotebooksComplete(QUuid requestId);
508 void expungeNotelessTagsFromLinkedNotebooksFailed(
512 void getResourceCountComplete(
int resourceCount, QUuid requestId);
513 void getResourceCountFailed(
ErrorString errorDescription, QUuid requestId);
514 void addResourceComplete(
Resource resource, QUuid requestId);
516 void addResourceFailed(
519 void updateResourceComplete(
Resource resource, QUuid requestId);
521 void updateResourceFailed(
524 void findResourceComplete(
525 Resource resource, LocalStorageManager::GetResourceOptions options,
528 void findResourceFailed(
529 Resource resource, LocalStorageManager::GetResourceOptions options,
532 void expungeResourceComplete(
Resource resource, QUuid requestId);
534 void expungeResourceFailed(
538 void getSavedSearchCountComplete(
int savedSearchCount, QUuid requestId);
540 void getSavedSearchCountFailed(
543 void addSavedSearchComplete(
SavedSearch search, QUuid requestId);
545 void addSavedSearchFailed(
548 void updateSavedSearchComplete(
SavedSearch search, QUuid requestId);
550 void updateSavedSearchFailed(
553 void findSavedSearchComplete(
SavedSearch search, QUuid requestId);
555 void findSavedSearchFailed(
558 void listAllSavedSearchesComplete(
559 size_t limit,
size_t offset,
562 QList<SavedSearch> foundSearches, QUuid requestId);
564 void listAllSavedSearchesFailed(
565 size_t limit,
size_t offset,
570 void listSavedSearchesComplete(
571 LocalStorageManager::ListObjectsOptions flag,
572 size_t limit,
size_t offset,
575 QList<SavedSearch> foundSearches, QUuid requestId);
577 void listSavedSearchesFailed(
578 LocalStorageManager::ListObjectsOptions flag,
579 size_t limit,
size_t offset,
584 void expungeSavedSearchComplete(
SavedSearch search, QUuid requestId);
586 void expungeSavedSearchFailed(
589 void accountHighUsnComplete(
590 qint32 usn, QString linkedNotebookGuid, QUuid requestId);
592 void accountHighUsnFailed(
593 QString linkedNotebookGuid,
ErrorString errorDescription,
600 void onGetUserCountRequest(QUuid requestId);
602 void onSwitchUserRequest(
603 Account account, LocalStorageManager::StartupOptions startupOptions,
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);
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);
620 void onFindDefaultOrLastUsedNotebookRequest(
621 Notebook notebook, QUuid requestId);
623 void onListAllNotebooksRequest(
624 size_t limit,
size_t offset,
627 QString linkedNotebookGuid, QUuid requestId);
629 void onListAllSharedNotebooksRequest(QUuid requestId);
631 void onListNotebooksRequest(
632 LocalStorageManager::ListObjectsOptions flag,
633 size_t limit,
size_t offset,
636 QString linkedNotebookGuid, QUuid requestId);
638 void onListSharedNotebooksPerNotebookGuidRequest(
639 QString notebookGuid, QUuid requestId);
641 void onExpungeNotebookRequest(
Notebook notebook, QUuid requestId);
644 void onGetLinkedNotebookCountRequest(QUuid requestId);
646 void onAddLinkedNotebookRequest(
649 void onUpdateLinkedNotebookRequest(
652 void onFindLinkedNotebookRequest(
655 void onListAllLinkedNotebooksRequest(
656 size_t limit,
size_t offset,
660 void onListLinkedNotebooksRequest(
661 LocalStorageManager::ListObjectsOptions flag,
662 size_t limit,
size_t offset,
667 void onExpungeLinkedNotebookRequest(
671 void onGetNoteCountRequest(
672 LocalStorageManager::NoteCountOptions options, QUuid requestId);
674 void onGetNoteCountPerNotebookRequest(
675 Notebook notebook, LocalStorageManager::NoteCountOptions options,
678 void onGetNoteCountPerTagRequest(
679 Tag tag, LocalStorageManager::NoteCountOptions options,
682 void onGetNoteCountsPerAllTagsRequest(
683 LocalStorageManager::NoteCountOptions options, QUuid requestId);
685 void onGetNoteCountPerNotebooksAndTagsRequest(
686 QStringList notebookLocalUids, QStringList tagLocalUids,
687 LocalStorageManager::NoteCountOptions options, QUuid requestId);
689 void onAddNoteRequest(
Note note, QUuid requestId);
691 void onUpdateNoteRequest(
692 Note note, LocalStorageManager::UpdateNoteOptions options,
695 void onFindNoteRequest(
696 Note note, LocalStorageManager::GetNoteOptions options,
699 void onListNotesPerNotebookRequest(
700 Notebook notebook, LocalStorageManager::GetNoteOptions options,
701 LocalStorageManager::ListObjectsOptions flag,
702 size_t limit,
size_t offset,
706 void onListNotesPerTagRequest(
707 Tag tag, LocalStorageManager::GetNoteOptions options,
708 LocalStorageManager::ListObjectsOptions flag,
709 size_t limit,
size_t offset,
713 void onListNotesPerNotebooksAndTagsRequest(
714 QStringList notebookLocalUids, QStringList tagLocalUids,
715 LocalStorageManager::GetNoteOptions options,
716 LocalStorageManager::ListObjectsOptions flag,
717 size_t limit,
size_t offset,
721 void onListNotesByLocalUidsRequest(
722 QStringList noteLocalUids,
723 LocalStorageManager::GetNoteOptions options,
724 LocalStorageManager::ListObjectsOptions flag,
725 size_t limit,
size_t offset,
729 void onListNotesRequest(
730 LocalStorageManager::ListObjectsOptions flag,
731 LocalStorageManager::GetNoteOptions options,
732 size_t limit,
size_t offset,
735 QString linkedNotebookGuid, QUuid requestId);
737 void onFindNoteLocalUidsWithSearchQuery(
740 void onExpungeNoteRequest(
Note note, QUuid requestId);
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);
748 void onListAllTagsPerNoteRequest(
749 Note note, LocalStorageManager::ListObjectsOptions flag,
750 size_t limit,
size_t offset,
754 void onListAllTagsRequest(
755 size_t limit,
size_t offset,
758 QString linkedNotebookGuid, QUuid requestId);
760 void onListTagsRequest(
761 LocalStorageManager::ListObjectsOptions flag,
762 size_t limit,
size_t offset,
765 QString linkedNotebookGuid, QUuid requestId);
767 void onListTagsWithNoteLocalUidsRequest(
768 LocalStorageManager::ListObjectsOptions flag,
769 size_t limit,
size_t offset,
772 QString linkedNotebookGuid, QUuid requestId);
774 void onExpungeTagRequest(
Tag tag, QUuid requestId);
775 void onExpungeNotelessTagsFromLinkedNotebooksRequest(QUuid requestId);
778 void onGetResourceCountRequest(QUuid requestId);
779 void onAddResourceRequest(
Resource resource, QUuid requestId);
780 void onUpdateResourceRequest(
Resource resource, QUuid requestId);
782 void onFindResourceRequest(
784 LocalStorageManager::GetResourceOptions options,
787 void onExpungeResourceRequest(
Resource resource, QUuid requestId);
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);
795 void onListAllSavedSearchesRequest(
796 size_t limit,
size_t offset,
800 void onListSavedSearchesRequest(
801 LocalStorageManager::ListObjectsOptions flag,
802 size_t limit,
size_t offset,
806 void onExpungeSavedSearchRequest(
SavedSearch search, QUuid requestId);
808 void onAccountHighUsnRequest(QString linkedNotebookGuid, QUuid requestId);
814 LocalStorageManagerAsyncPrivate *
const d_ptr;
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
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
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