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>
41QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsyncPrivate)
49#
if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
50 LocalStorageManager::StartupOptions options = {},
52 LocalStorageManager::StartupOptions options = 0,
54 QObject * parent =
nullptr);
58 void setUseCache(
const bool useCache);
62 bool installCacheExpiryFunction(
73 void getUserCountComplete(
int userCount, QUuid requestId);
74 void getUserCountFailed(
ErrorString errorDescription, QUuid requestId);
75 void switchUserComplete(
Account account, QUuid requestId);
77 void switchUserFailed(
80 void addUserComplete(
User user, QUuid requestId);
85 void updateUserComplete(
User user, QUuid requestId);
87 void updateUserFailed(
90 void findUserComplete(
User foundUser, QUuid requestId);
95 void deleteUserComplete(
User user, QUuid requestId);
97 void deleteUserFailed(
100 void expungeUserComplete(
User user, QUuid requestId);
102 void expungeUserFailed(
106 void getNotebookCountComplete(
int notebookCount, QUuid requestId);
107 void getNotebookCountFailed(
ErrorString errorDescription, QUuid requestId);
108 void addNotebookComplete(
Notebook notebook, QUuid requestId);
110 void addNotebookFailed(
113 void updateNotebookComplete(
Notebook notebook, QUuid requestId);
115 void updateNotebookFailed(
118 void findNotebookComplete(
Notebook foundNotebook, QUuid requestId);
120 void findNotebookFailed(
123 void findDefaultNotebookComplete(
Notebook foundNotebook, QUuid requestId);
125 void findDefaultNotebookFailed(
128 void findLastUsedNotebookComplete(
Notebook foundNotebook, QUuid requestId);
130 void findLastUsedNotebookFailed(
133 void findDefaultOrLastUsedNotebookComplete(
134 Notebook foundNotebook, QUuid requestId);
136 void findDefaultOrLastUsedNotebookFailed(
139 void listAllNotebooksComplete(
140 size_t limit,
size_t offset,
143 QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
146 void listAllNotebooksFailed(
147 size_t limit,
size_t offset,
150 QString linkedNotebookGuid,
ErrorString errorDescription,
153 void listNotebooksComplete(
154 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
157 QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
160 void listNotebooksFailed(
161 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
164 QString linkedNotebookGuid,
ErrorString errorDescription,
167 void listAllSharedNotebooksComplete(
168 QList<SharedNotebook> foundSharedNotebooks, QUuid requestId);
170 void listAllSharedNotebooksFailed(
173 void listSharedNotebooksPerNotebookGuidComplete(
174 QString notebookGuid, QList<SharedNotebook> foundSharedNotebooks,
177 void listSharedNotebooksPerNotebookGuidFailed(
178 QString notebookGuid,
ErrorString errorDescription, QUuid requestId);
180 void expungeNotebookComplete(
Notebook notebook, QUuid requestId);
182 void expungeNotebookFailed(
186 void getLinkedNotebookCountComplete(
187 int linkedNotebookCount, QUuid requestId);
189 void getLinkedNotebookCountFailed(
192 void addLinkedNotebookComplete(
195 void addLinkedNotebookFailed(
199 void updateLinkedNotebookComplete(
202 void updateLinkedNotebookFailed(
206 void findLinkedNotebookComplete(
209 void findLinkedNotebookFailed(
213 void listAllLinkedNotebooksComplete(
214 size_t limit,
size_t offset,
217 QList<LinkedNotebook> foundLinkedNotebooks, QUuid requestId);
219 void listAllLinkedNotebooksFailed(
220 size_t limit,
size_t offset,
225 void listLinkedNotebooksComplete(
226 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
229 QList<LinkedNotebook> foundLinkedNotebooks, QUuid requestId);
231 void listLinkedNotebooksFailed(
232 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
237 void expungeLinkedNotebookComplete(
240 void expungeLinkedNotebookFailed(
245 void getNoteCountComplete(
246 int noteCount, LocalStorageManager::NoteCountOptions options,
249 void getNoteCountFailed(
251 LocalStorageManager::NoteCountOptions options, QUuid requestId);
253 void getNoteCountPerNotebookComplete(
255 LocalStorageManager::NoteCountOptions options, QUuid requestId);
257 void getNoteCountPerNotebookFailed(
259 LocalStorageManager::NoteCountOptions options, QUuid requestId);
261 void getNoteCountPerTagComplete(
262 int noteCount,
Tag tag, LocalStorageManager::NoteCountOptions options,
265 void getNoteCountPerTagFailed(
267 LocalStorageManager::NoteCountOptions options, QUuid requestId);
269 void getNoteCountsPerAllTagsComplete(
270 QHash<QString, int> noteCountsPerTagLocalUid,
271 LocalStorageManager::NoteCountOptions options, QUuid requestId);
273 void getNoteCountsPerAllTagsFailed(
275 LocalStorageManager::NoteCountOptions options, QUuid requestId);
277 void getNoteCountPerNotebooksAndTagsComplete(
278 int noteCount, QStringList notebookLocalUids, QStringList tagLocalUids,
279 LocalStorageManager::NoteCountOptions options, QUuid requestId);
281 void getNoteCountPerNotebooksAndTagsFailed(
282 ErrorString errorDescription, QStringList notebookLocalUids,
283 QStringList tagLocalUids, LocalStorageManager::NoteCountOptions options,
286 void addNoteComplete(
Note note, QUuid requestId);
291 void updateNoteComplete(
292 Note note, LocalStorageManager::UpdateNoteOptions options,
295 void updateNoteFailed(
296 Note note, LocalStorageManager::UpdateNoteOptions options,
299 void findNoteComplete(
300 Note foundNote, LocalStorageManager::GetNoteOptions options,
304 Note note, LocalStorageManager::GetNoteOptions options,
307 void listNotesPerNotebookComplete(
308 Notebook notebook, LocalStorageManager::GetNoteOptions options,
309 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
312 QList<Note> foundNotes, QUuid requestId);
314 void listNotesPerNotebookFailed(
315 Notebook notebook, LocalStorageManager::GetNoteOptions options,
316 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
321 void listNotesPerTagComplete(
322 Tag tag, LocalStorageManager::GetNoteOptions options,
323 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
326 QList<Note> foundNotes, QUuid requestId);
328 void listNotesPerTagFailed(
329 Tag tag, LocalStorageManager::GetNoteOptions options,
330 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
335 void listNotesPerNotebooksAndTagsComplete(
336 QStringList notebookLocalUids, QStringList tagLocalUids,
337 LocalStorageManager::GetNoteOptions options,
338 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
341 QList<Note> foundNotes, QUuid requestId);
343 void listNotesPerNotebooksAndTagsFailed(
344 QStringList notebookLocalUids, QStringList tagLocalUids,
345 LocalStorageManager::GetNoteOptions options,
346 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
351 void listNotesByLocalUidsComplete(
352 QStringList noteLocalUids, LocalStorageManager::GetNoteOptions options,
353 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
356 QList<Note> foundNotes, QUuid requestId);
358 void listNotesByLocalUidsFailed(
359 QStringList noteLocalUids, LocalStorageManager::GetNoteOptions options,
360 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
365 void listNotesComplete(
366 LocalStorageManager::ListObjectsOptions flag,
367 LocalStorageManager::GetNoteOptions options,
size_t limit,
370 QString linkedNotebookGuid, QList<Note> foundNotes, QUuid requestId);
372 void listNotesFailed(
373 LocalStorageManager::ListObjectsOptions flag,
374 LocalStorageManager::GetNoteOptions options,
size_t limit,
377 QString linkedNotebookGuid,
ErrorString errorDescription,
380 void findNoteLocalUidsWithSearchQueryComplete(
384 void findNoteLocalUidsWithSearchQueryFailed(
388 void expungeNoteComplete(
Note note, QUuid requestId);
390 void expungeNoteFailed(
395 void noteMovedToAnotherNotebook(
396 QString noteLocalUid, QString previousNotebookLocalUid,
397 QString newNotebookLocalUid);
401 void noteTagListChanged(
402 QString noteLocalUid, QStringList previousNoteTagLocalUids,
403 QStringList newNoteTagLocalUids);
406 void getTagCountComplete(
int tagCount, QUuid requestId);
407 void getTagCountFailed(
ErrorString errorDescription, QUuid requestId);
408 void addTagComplete(
Tag tag, QUuid requestId);
409 void addTagFailed(
Tag tag,
ErrorString errorDescription, QUuid requestId);
410 void updateTagComplete(
Tag tag, QUuid requestId);
412 void updateTagFailed(
415 void linkTagWithNoteComplete(
Tag tag,
Note note, QUuid requestId);
417 void linkTagWithNoteFailed(
420 void findTagComplete(
Tag tag, QUuid requestId);
421 void findTagFailed(
Tag tag,
ErrorString errorDescription, QUuid requestId);
423 void listAllTagsPerNoteComplete(
424 QList<Tag> foundTags,
Note note,
425 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
429 void listAllTagsPerNoteFailed(
430 Note note, LocalStorageManager::ListObjectsOptions flag,
size_t limit,
435 void listAllTagsComplete(
438 QString linkedNotebookGuid, QList<Tag> foundTags, QUuid requestId);
440 void listAllTagsFailed(
443 QString linkedNotebookGuid,
ErrorString errorDescription,
446 void listTagsComplete(
447 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
450 QString linkedNotebookGuid, QList<Tag> foundTags,
451 QUuid requestId = QUuid());
454 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
457 QString linkedNotebookGuid,
ErrorString errorDescription,
460 void listTagsWithNoteLocalUidsComplete(
461 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
464 QString linkedNotebookGuid,
465 QList<std::pair<Tag, QStringList>> foundTags, QUuid requestId);
467 void listTagsWithNoteLocalUidsFailed(
468 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
471 QString linkedNotebookGuid,
ErrorString errorDescription,
474 void expungeTagComplete(
475 Tag tag, QStringList expungedChildTagLocalUids, QUuid requestId);
477 void expungeTagFailed(
480 void expungeNotelessTagsFromLinkedNotebooksComplete(QUuid requestId);
482 void expungeNotelessTagsFromLinkedNotebooksFailed(
486 void getResourceCountComplete(
int resourceCount, QUuid requestId);
487 void getResourceCountFailed(
ErrorString errorDescription, QUuid requestId);
488 void addResourceComplete(
Resource resource, QUuid requestId);
490 void addResourceFailed(
493 void updateResourceComplete(
Resource resource, QUuid requestId);
495 void updateResourceFailed(
498 void findResourceComplete(
499 Resource resource, LocalStorageManager::GetResourceOptions options,
502 void findResourceFailed(
503 Resource resource, LocalStorageManager::GetResourceOptions options,
506 void expungeResourceComplete(
Resource resource, QUuid requestId);
508 void expungeResourceFailed(
512 void getSavedSearchCountComplete(
int savedSearchCount, QUuid requestId);
514 void getSavedSearchCountFailed(
517 void addSavedSearchComplete(
SavedSearch search, QUuid requestId);
519 void addSavedSearchFailed(
522 void updateSavedSearchComplete(
SavedSearch search, QUuid requestId);
524 void updateSavedSearchFailed(
527 void findSavedSearchComplete(
SavedSearch search, QUuid requestId);
529 void findSavedSearchFailed(
532 void listAllSavedSearchesComplete(
533 size_t limit,
size_t offset,
536 QList<SavedSearch> foundSearches, QUuid requestId);
538 void listAllSavedSearchesFailed(
539 size_t limit,
size_t offset,
544 void listSavedSearchesComplete(
545 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
548 QList<SavedSearch> foundSearches, QUuid requestId);
550 void listSavedSearchesFailed(
551 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
556 void expungeSavedSearchComplete(
SavedSearch search, QUuid requestId);
558 void expungeSavedSearchFailed(
561 void accountHighUsnComplete(
562 qint32 usn, QString linkedNotebookGuid, QUuid requestId);
564 void accountHighUsnFailed(
565 QString linkedNotebookGuid,
ErrorString errorDescription,
572 void onGetUserCountRequest(QUuid requestId);
574 void onSwitchUserRequest(
575 Account account, LocalStorageManager::StartupOptions startupOptions,
578 void onAddUserRequest(
User user, QUuid requestId);
579 void onUpdateUserRequest(
User user, QUuid requestId);
580 void onFindUserRequest(
User user, QUuid requestId);
581 void onDeleteUserRequest(
User user, QUuid requestId);
582 void onExpungeUserRequest(
User user, QUuid requestId);
585 void onGetNotebookCountRequest(QUuid requestId);
586 void onAddNotebookRequest(
Notebook notebook, QUuid requestId);
587 void onUpdateNotebookRequest(
Notebook notebook, QUuid requestId);
588 void onFindNotebookRequest(
Notebook notebook, QUuid requestId);
589 void onFindDefaultNotebookRequest(
Notebook notebook, QUuid requestId);
590 void onFindLastUsedNotebookRequest(
Notebook notebook, QUuid requestId);
592 void onFindDefaultOrLastUsedNotebookRequest(
593 Notebook notebook, QUuid requestId);
595 void onListAllNotebooksRequest(
596 size_t limit,
size_t offset,
599 QString linkedNotebookGuid, QUuid requestId);
601 void onListAllSharedNotebooksRequest(QUuid requestId);
603 void onListNotebooksRequest(
604 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
607 QString linkedNotebookGuid, QUuid requestId);
609 void onListSharedNotebooksPerNotebookGuidRequest(
610 QString notebookGuid, QUuid requestId);
612 void onExpungeNotebookRequest(
Notebook notebook, QUuid requestId);
615 void onGetLinkedNotebookCountRequest(QUuid requestId);
617 void onAddLinkedNotebookRequest(
620 void onUpdateLinkedNotebookRequest(
623 void onFindLinkedNotebookRequest(
626 void onListAllLinkedNotebooksRequest(
627 size_t limit,
size_t offset,
631 void onListLinkedNotebooksRequest(
632 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
636 void onExpungeLinkedNotebookRequest(
640 void onGetNoteCountRequest(
641 LocalStorageManager::NoteCountOptions options, QUuid requestId);
643 void onGetNoteCountPerNotebookRequest(
644 Notebook notebook, LocalStorageManager::NoteCountOptions options,
647 void onGetNoteCountPerTagRequest(
648 Tag tag, LocalStorageManager::NoteCountOptions options,
651 void onGetNoteCountsPerAllTagsRequest(
652 LocalStorageManager::NoteCountOptions options, QUuid requestId);
654 void onGetNoteCountPerNotebooksAndTagsRequest(
655 QStringList notebookLocalUids, QStringList tagLocalUids,
656 LocalStorageManager::NoteCountOptions options, QUuid requestId);
658 void onAddNoteRequest(
Note note, QUuid requestId);
660 void onUpdateNoteRequest(
661 Note note, LocalStorageManager::UpdateNoteOptions options,
664 void onFindNoteRequest(
665 Note note, LocalStorageManager::GetNoteOptions options,
668 void onListNotesPerNotebookRequest(
669 Notebook notebook, LocalStorageManager::GetNoteOptions options,
670 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
674 void onListNotesPerTagRequest(
675 Tag tag, LocalStorageManager::GetNoteOptions options,
676 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
680 void onListNotesPerNotebooksAndTagsRequest(
681 QStringList notebookLocalUids, QStringList tagLocalUids,
682 LocalStorageManager::GetNoteOptions options,
683 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
687 void onListNotesByLocalUidsRequest(
688 QStringList noteLocalUids, LocalStorageManager::GetNoteOptions options,
689 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
693 void onListNotesRequest(
694 LocalStorageManager::ListObjectsOptions flag,
695 LocalStorageManager::GetNoteOptions options,
size_t limit,
698 QString linkedNotebookGuid, QUuid requestId);
700 void onFindNoteLocalUidsWithSearchQuery(
703 void onExpungeNoteRequest(
Note note, QUuid requestId);
706 void onGetTagCountRequest(QUuid requestId);
707 void onAddTagRequest(
Tag tag, QUuid requestId);
708 void onUpdateTagRequest(
Tag tag, QUuid requestId);
709 void onFindTagRequest(
Tag tag, QUuid requestId);
711 void onListAllTagsPerNoteRequest(
712 Note note, LocalStorageManager::ListObjectsOptions flag,
size_t limit,
716 void onListAllTagsRequest(
719 QString linkedNotebookGuid, QUuid requestId);
721 void onListTagsRequest(
722 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
725 QString linkedNotebookGuid, QUuid requestId);
727 void onListTagsWithNoteLocalUidsRequest(
728 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
731 QString linkedNotebookGuid, QUuid requestId);
733 void onExpungeTagRequest(
Tag tag, QUuid requestId);
734 void onExpungeNotelessTagsFromLinkedNotebooksRequest(QUuid requestId);
737 void onGetResourceCountRequest(QUuid requestId);
738 void onAddResourceRequest(
Resource resource, QUuid requestId);
739 void onUpdateResourceRequest(
Resource resource, QUuid requestId);
741 void onFindResourceRequest(
742 Resource resource, LocalStorageManager::GetResourceOptions options,
745 void onExpungeResourceRequest(
Resource resource, QUuid requestId);
748 void onGetSavedSearchCountRequest(QUuid requestId);
749 void onAddSavedSearchRequest(
SavedSearch search, QUuid requestId);
750 void onUpdateSavedSearchRequest(
SavedSearch search, QUuid requestId);
751 void onFindSavedSearchRequest(
SavedSearch search, QUuid requestId);
753 void onListAllSavedSearchesRequest(
754 size_t limit,
size_t offset,
758 void onListSavedSearchesRequest(
759 LocalStorageManager::ListObjectsOptions flag,
size_t limit,
763 void onExpungeSavedSearchRequest(
SavedSearch search, QUuid requestId);
765 void onAccountHighUsnRequest(QString linkedNotebookGuid, QUuid requestId);
771 LocalStorageManagerAsyncPrivate *
const d_ptr;
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition Account.h:39
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition ErrorString.h:44
The ILocalStorageCacheExpiryChecker class represents the interface for cache expiry checker used by L...
Definition ILocalStorageCacheExpiryChecker.h:35
Definition LinkedNotebook.h:33
Definition LocalStorageCacheManager.h:39
Definition LocalStorageManagerAsync.h:44
Definition LocalStorageManager.h:55
ListSavedSearchesOrder
The ListSavedSearchesOrder enum allows to specify the results ordering for methods listing saved sear...
Definition LocalStorageManager.h:1869
ListNotesOrder
The ListNotesOrder enum allows to specify the results ordering for methods listing notes from the loc...
Definition LocalStorageManager.h:1119
OrderDirection
The OrderDirection enum specifies the direction of ordering of the results for methods listing the ob...
Definition LocalStorageManager.h:493
ListTagsOrder
The ListTagsOrder enum allows to specify the results ordering for methods listing tags from the local...
Definition LocalStorageManager.h:1462
ListNotebooksOrder
The ListNotebooksOrder allows to specify the results ordering for methods listing notebooks from the ...
Definition LocalStorageManager.h:509
ListLinkedNotebooksOrder
The ListLinkedNotebooksOrder enum allows to specify the results ordering for methods listing linked n...
Definition LocalStorageManager.h:727
Definition NoteSearchQuery.h:31
Definition SavedSearch.h:33