libquentier 0.5.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
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
35#include <QObject>
36
37#include <memory>
38
39namespace quentier {
40
41QT_FORWARD_DECLARE_CLASS(LocalStorageManagerAsyncPrivate)
42
43class QUENTIER_EXPORT LocalStorageManagerAsync : public QObject
44{
45 Q_OBJECT
46public:
48 const Account & account,
49#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
50 LocalStorageManager::StartupOptions options = {},
51#else
52 LocalStorageManager::StartupOptions options = 0,
53#endif
54 QObject * parent = nullptr);
55
57
58 void setUseCache(const bool useCache);
59
60 const LocalStorageCacheManager * localStorageCacheManager() const;
61
62 bool installCacheExpiryFunction(
63 const ILocalStorageCacheExpiryChecker & checker);
64
65 const LocalStorageManager * localStorageManager() const;
66 LocalStorageManager * localStorageManager();
67
68Q_SIGNALS:
69 // Sent when the initialization is complete
70 void initialized();
71
72 // User-related signals:
73 void getUserCountComplete(int userCount, QUuid requestId);
74 void getUserCountFailed(ErrorString errorDescription, QUuid requestId);
75 void switchUserComplete(Account account, QUuid requestId);
76
77 void switchUserFailed(
78 Account account, ErrorString errorDescription, QUuid requestId);
79
80 void addUserComplete(User user, QUuid requestId);
81
82 void addUserFailed(
83 User user, ErrorString errorDescription, QUuid requestId);
84
85 void updateUserComplete(User user, QUuid requestId);
86
87 void updateUserFailed(
88 User user, ErrorString errorDescription, QUuid requestId);
89
90 void findUserComplete(User foundUser, QUuid requestId);
91
92 void findUserFailed(
93 User user, ErrorString errorDescription, QUuid requestId);
94
95 void deleteUserComplete(User user, QUuid requestId);
96
97 void deleteUserFailed(
98 User user, ErrorString errorDescription, QUuid requestId);
99
100 void expungeUserComplete(User user, QUuid requestId);
101
102 void expungeUserFailed(
103 User user, ErrorString errorDescription, QUuid requestId);
104
105 // Notebook-related signals:
106 void getNotebookCountComplete(int notebookCount, QUuid requestId);
107 void getNotebookCountFailed(ErrorString errorDescription, QUuid requestId);
108 void addNotebookComplete(Notebook notebook, QUuid requestId);
109
110 void addNotebookFailed(
111 Notebook notebook, ErrorString errorDescription, QUuid requestId);
112
113 void updateNotebookComplete(Notebook notebook, QUuid requestId);
114
115 void updateNotebookFailed(
116 Notebook notebook, ErrorString errorDescription, QUuid requestId);
117
118 void findNotebookComplete(Notebook foundNotebook, QUuid requestId);
119
120 void findNotebookFailed(
121 Notebook notebook, ErrorString errorDescription, QUuid requestId);
122
123 void findDefaultNotebookComplete(Notebook foundNotebook, QUuid requestId);
124
125 void findDefaultNotebookFailed(
126 Notebook notebook, ErrorString errorDescription, QUuid requestId);
127
128 void findLastUsedNotebookComplete(Notebook foundNotebook, QUuid requestId);
129
130 void findLastUsedNotebookFailed(
131 Notebook notebook, ErrorString errorDescription, QUuid requestId);
132
133 void findDefaultOrLastUsedNotebookComplete(
134 Notebook foundNotebook, QUuid requestId);
135
136 void findDefaultOrLastUsedNotebookFailed(
137 Notebook notebook, ErrorString errorDescription, QUuid requestId);
138
139 void listAllNotebooksComplete(
140 size_t limit, size_t offset,
143 QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
144 QUuid requestId);
145
146 void listAllNotebooksFailed(
147 size_t limit, size_t offset,
150 QString linkedNotebookGuid, ErrorString errorDescription,
151 QUuid requestId);
152
153 void listNotebooksComplete(
154 LocalStorageManager::ListObjectsOptions flag, size_t limit,
155 size_t offset, LocalStorageManager::ListNotebooksOrder order,
157 QString linkedNotebookGuid, QList<Notebook> foundNotebooks,
158 QUuid requestId);
159
160 void listNotebooksFailed(
161 LocalStorageManager::ListObjectsOptions flag, size_t limit,
162 size_t offset, LocalStorageManager::ListNotebooksOrder order,
164 QString linkedNotebookGuid, ErrorString errorDescription,
165 QUuid requestId);
166
167 void listAllSharedNotebooksComplete(
168 QList<SharedNotebook> foundSharedNotebooks, QUuid requestId);
169
170 void listAllSharedNotebooksFailed(
171 ErrorString errorDescription, QUuid requestId);
172
173 void listSharedNotebooksPerNotebookGuidComplete(
174 QString notebookGuid, QList<SharedNotebook> foundSharedNotebooks,
175 QUuid requestId);
176
177 void listSharedNotebooksPerNotebookGuidFailed(
178 QString notebookGuid, ErrorString errorDescription, QUuid requestId);
179
180 void expungeNotebookComplete(Notebook notebook, QUuid requestId);
181
182 void expungeNotebookFailed(
183 Notebook notebook, ErrorString errorDescription, QUuid requestId);
184
185 // Linked notebook-related signals:
186 void getLinkedNotebookCountComplete(
187 int linkedNotebookCount, QUuid requestId);
188
189 void getLinkedNotebookCountFailed(
190 ErrorString errorDescription, QUuid requestId);
191
192 void addLinkedNotebookComplete(
193 LinkedNotebook linkedNotebook, QUuid requestId);
194
195 void addLinkedNotebookFailed(
196 LinkedNotebook linkedNotebook, ErrorString errorDescription,
197 QUuid requestId);
198
199 void updateLinkedNotebookComplete(
200 LinkedNotebook linkedNotebook, QUuid requestId);
201
202 void updateLinkedNotebookFailed(
203 LinkedNotebook linkedNotebook, ErrorString errorDescription,
204 QUuid requestId);
205
206 void findLinkedNotebookComplete(
207 LinkedNotebook foundLinkedNotebook, QUuid requestId);
208
209 void findLinkedNotebookFailed(
210 LinkedNotebook linkedNotebook, ErrorString errorDescription,
211 QUuid requestId);
212
213 void listAllLinkedNotebooksComplete(
214 size_t limit, size_t offset,
217 QList<LinkedNotebook> foundLinkedNotebooks, 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, size_t limit,
229 QList<LinkedNotebook> foundLinkedNotebooks, QUuid requestId);
230
231 void listLinkedNotebooksFailed(
232 LocalStorageManager::ListObjectsOptions flag, size_t limit,
235 ErrorString errorDescription, QUuid requestId);
236
237 void expungeLinkedNotebookComplete(
238 LinkedNotebook linkedNotebook, QUuid requestId);
239
240 void expungeLinkedNotebookFailed(
241 LinkedNotebook linkedNotebook, ErrorString errorDescription,
242 QUuid requestId);
243
244 // Note-related signals:
245 void getNoteCountComplete(
246 int noteCount, LocalStorageManager::NoteCountOptions options,
247 QUuid requestId);
248
249 void getNoteCountFailed(
250 ErrorString errorDescription,
251 LocalStorageManager::NoteCountOptions options, QUuid requestId);
252
253 void getNoteCountPerNotebookComplete(
254 int noteCount, Notebook notebook,
255 LocalStorageManager::NoteCountOptions options, QUuid requestId);
256
257 void getNoteCountPerNotebookFailed(
258 ErrorString errorDescription, Notebook notebook,
259 LocalStorageManager::NoteCountOptions options, QUuid requestId);
260
261 void getNoteCountPerTagComplete(
262 int noteCount, Tag tag, LocalStorageManager::NoteCountOptions options,
263 QUuid requestId);
264
265 void getNoteCountPerTagFailed(
266 ErrorString errorDescription, Tag tag,
267 LocalStorageManager::NoteCountOptions options, QUuid requestId);
268
269 void getNoteCountsPerAllTagsComplete(
270 QHash<QString, int> noteCountsPerTagLocalUid,
271 LocalStorageManager::NoteCountOptions options, QUuid requestId);
272
273 void getNoteCountsPerAllTagsFailed(
274 ErrorString errorDescription,
275 LocalStorageManager::NoteCountOptions options, QUuid requestId);
276
277 void getNoteCountPerNotebooksAndTagsComplete(
278 int noteCount, QStringList notebookLocalUids, QStringList tagLocalUids,
279 LocalStorageManager::NoteCountOptions options, QUuid requestId);
280
281 void getNoteCountPerNotebooksAndTagsFailed(
282 ErrorString errorDescription, QStringList notebookLocalUids,
283 QStringList tagLocalUids, LocalStorageManager::NoteCountOptions options,
284 QUuid requestId);
285
286 void addNoteComplete(Note note, QUuid requestId);
287
288 void addNoteFailed(
289 Note note, ErrorString errorDescription, QUuid requestId);
290
291 void updateNoteComplete(
292 Note note, LocalStorageManager::UpdateNoteOptions options,
293 QUuid requestId);
294
295 void updateNoteFailed(
296 Note note, LocalStorageManager::UpdateNoteOptions options,
297 ErrorString errorDescription, QUuid requestId);
298
299 void findNoteComplete(
300 Note foundNote, LocalStorageManager::GetNoteOptions options,
301 QUuid requestId);
302
303 void findNoteFailed(
304 Note note, LocalStorageManager::GetNoteOptions options,
305 ErrorString errorDescription, QUuid requestId);
306
307 void listNotesPerNotebookComplete(
308 Notebook notebook, LocalStorageManager::GetNoteOptions options,
309 LocalStorageManager::ListObjectsOptions flag, size_t limit,
310 size_t offset, LocalStorageManager::ListNotesOrder order,
312 QList<Note> foundNotes, QUuid requestId);
313
314 void listNotesPerNotebookFailed(
315 Notebook notebook, LocalStorageManager::GetNoteOptions options,
316 LocalStorageManager::ListObjectsOptions flag, size_t limit,
317 size_t offset, LocalStorageManager::ListNotesOrder order,
319 ErrorString errorDescription, QUuid requestId);
320
321 void listNotesPerTagComplete(
322 Tag tag, LocalStorageManager::GetNoteOptions options,
323 LocalStorageManager::ListObjectsOptions flag, size_t limit,
324 size_t offset, LocalStorageManager::ListNotesOrder order,
326 QList<Note> foundNotes, QUuid requestId);
327
328 void listNotesPerTagFailed(
329 Tag tag, LocalStorageManager::GetNoteOptions options,
330 LocalStorageManager::ListObjectsOptions flag, size_t limit,
331 size_t offset, LocalStorageManager::ListNotesOrder order,
333 ErrorString errorDescription, QUuid requestId);
334
335 void listNotesPerNotebooksAndTagsComplete(
336 QStringList notebookLocalUids, QStringList tagLocalUids,
337 LocalStorageManager::GetNoteOptions options,
338 LocalStorageManager::ListObjectsOptions flag, size_t limit,
339 size_t offset, LocalStorageManager::ListNotesOrder order,
341 QList<Note> foundNotes, QUuid requestId);
342
343 void listNotesPerNotebooksAndTagsFailed(
344 QStringList notebookLocalUids, QStringList tagLocalUids,
345 LocalStorageManager::GetNoteOptions options,
346 LocalStorageManager::ListObjectsOptions flag, size_t limit,
347 size_t offset, LocalStorageManager::ListNotesOrder order,
349 ErrorString errorDescription, QUuid requestId);
350
351 void listNotesByLocalUidsComplete(
352 QStringList noteLocalUids, LocalStorageManager::GetNoteOptions options,
353 LocalStorageManager::ListObjectsOptions flag, size_t limit,
354 size_t offset, LocalStorageManager::ListNotesOrder order,
356 QList<Note> foundNotes, QUuid requestId);
357
358 void listNotesByLocalUidsFailed(
359 QStringList noteLocalUids, LocalStorageManager::GetNoteOptions options,
360 LocalStorageManager::ListObjectsOptions flag, size_t limit,
361 size_t offset, LocalStorageManager::ListNotesOrder order,
363 ErrorString errorDescription, QUuid requestId);
364
365 void listNotesComplete(
366 LocalStorageManager::ListObjectsOptions flag,
367 LocalStorageManager::GetNoteOptions options, size_t limit,
368 size_t offset, LocalStorageManager::ListNotesOrder order,
370 QString linkedNotebookGuid, QList<Note> foundNotes, QUuid requestId);
371
372 void listNotesFailed(
373 LocalStorageManager::ListObjectsOptions flag,
374 LocalStorageManager::GetNoteOptions options, size_t limit,
375 size_t offset, LocalStorageManager::ListNotesOrder order,
377 QString linkedNotebookGuid, ErrorString errorDescription,
378 QUuid requestId);
379
380 void findNoteLocalUidsWithSearchQueryComplete(
381 QStringList noteLocalUids, NoteSearchQuery noteSearchQuery,
382 QUuid requestId);
383
384 void findNoteLocalUidsWithSearchQueryFailed(
385 NoteSearchQuery noteSearchQuery, ErrorString errorDescription,
386 QUuid requestId);
387
388 void expungeNoteComplete(Note note, QUuid requestId);
389
390 void expungeNoteFailed(
391 Note note, ErrorString errorDescription, QUuid requestId);
392
393 // Specialized signal emitted alongside updateNoteComplete (after it)
394 // if the update of a note causes the change of its notebook
395 void noteMovedToAnotherNotebook(
396 QString noteLocalUid, QString previousNotebookLocalUid,
397 QString newNotebookLocalUid);
398
399 // Specialized signal emitted alongside updateNoteComplete (after it)
400 // if the update of a note causes the change of its set of tags
401 void noteTagListChanged(
402 QString noteLocalUid, QStringList previousNoteTagLocalUids,
403 QStringList newNoteTagLocalUids);
404
405 // Tag-related signals:
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);
411
412 void updateTagFailed(
413 Tag tag, ErrorString errorDescription, QUuid requestId);
414
415 void linkTagWithNoteComplete(Tag tag, Note note, QUuid requestId);
416
417 void linkTagWithNoteFailed(
418 Tag tag, Note note, ErrorString errorDescription, QUuid requestId);
419
420 void findTagComplete(Tag tag, QUuid requestId);
421 void findTagFailed(Tag tag, ErrorString errorDescription, QUuid requestId);
422
423 void listAllTagsPerNoteComplete(
424 QList<Tag> foundTags, Note note,
425 LocalStorageManager::ListObjectsOptions flag, size_t limit,
426 size_t offset, LocalStorageManager::ListTagsOrder order,
427 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
428
429 void listAllTagsPerNoteFailed(
430 Note note, LocalStorageManager::ListObjectsOptions flag, size_t limit,
431 size_t offset, LocalStorageManager::ListTagsOrder order,
433 ErrorString errorDescription, QUuid requestId);
434
435 void listAllTagsComplete(
436 size_t limit, size_t offset, LocalStorageManager::ListTagsOrder order,
438 QString linkedNotebookGuid, QList<Tag> foundTags, QUuid requestId);
439
440 void listAllTagsFailed(
441 size_t limit, size_t offset, LocalStorageManager::ListTagsOrder order,
443 QString linkedNotebookGuid, ErrorString errorDescription,
444 QUuid requestId);
445
446 void listTagsComplete(
447 LocalStorageManager::ListObjectsOptions flag, size_t limit,
448 size_t offset, LocalStorageManager::ListTagsOrder order,
450 QString linkedNotebookGuid, QList<Tag> foundTags,
451 QUuid requestId = QUuid());
452
453 void listTagsFailed(
454 LocalStorageManager::ListObjectsOptions flag, size_t limit,
455 size_t offset, LocalStorageManager::ListTagsOrder order,
457 QString linkedNotebookGuid, ErrorString errorDescription,
458 QUuid requestId);
459
460 void listTagsWithNoteLocalUidsComplete(
461 LocalStorageManager::ListObjectsOptions flag, size_t limit,
462 size_t offset, LocalStorageManager::ListTagsOrder order,
464 QString linkedNotebookGuid,
465 QList<std::pair<Tag, QStringList>> foundTags, QUuid requestId);
466
467 void listTagsWithNoteLocalUidsFailed(
468 LocalStorageManager::ListObjectsOptions flag, size_t limit,
469 size_t offset, LocalStorageManager::ListTagsOrder order,
471 QString linkedNotebookGuid, ErrorString errorDescription,
472 QUuid requestId);
473
474 void expungeTagComplete(
475 Tag tag, QStringList expungedChildTagLocalUids, QUuid requestId);
476
477 void expungeTagFailed(
478 Tag tag, ErrorString errorDescription, QUuid requestId);
479
480 void expungeNotelessTagsFromLinkedNotebooksComplete(QUuid requestId);
481
482 void expungeNotelessTagsFromLinkedNotebooksFailed(
483 ErrorString errorDescription, QUuid requestId);
484
485 // Resource-related signals:
486 void getResourceCountComplete(int resourceCount, QUuid requestId);
487 void getResourceCountFailed(ErrorString errorDescription, QUuid requestId);
488 void addResourceComplete(Resource resource, QUuid requestId);
489
490 void addResourceFailed(
491 Resource resource, ErrorString errorDescription, QUuid requestId);
492
493 void updateResourceComplete(Resource resource, QUuid requestId);
494
495 void updateResourceFailed(
496 Resource resource, ErrorString errorDescription, QUuid requestId);
497
498 void findResourceComplete(
499 Resource resource, LocalStorageManager::GetResourceOptions options,
500 QUuid requestId);
501
502 void findResourceFailed(
503 Resource resource, LocalStorageManager::GetResourceOptions options,
504 ErrorString errorDescription, QUuid requestId);
505
506 void expungeResourceComplete(Resource resource, QUuid requestId);
507
508 void expungeResourceFailed(
509 Resource resource, ErrorString errorDescription, QUuid requestId);
510
511 // Saved search-related signals:
512 void getSavedSearchCountComplete(int savedSearchCount, QUuid requestId);
513
514 void getSavedSearchCountFailed(
515 ErrorString errorDescription, QUuid requestId);
516
517 void addSavedSearchComplete(SavedSearch search, QUuid requestId);
518
519 void addSavedSearchFailed(
520 SavedSearch search, ErrorString errorDescription, QUuid requestId);
521
522 void updateSavedSearchComplete(SavedSearch search, QUuid requestId);
523
524 void updateSavedSearchFailed(
525 SavedSearch search, ErrorString errorDescription, QUuid requestId);
526
527 void findSavedSearchComplete(SavedSearch search, QUuid requestId);
528
529 void findSavedSearchFailed(
530 SavedSearch search, ErrorString errorDescription, QUuid requestId);
531
532 void listAllSavedSearchesComplete(
533 size_t limit, size_t offset,
536 QList<SavedSearch> foundSearches, QUuid requestId);
537
538 void listAllSavedSearchesFailed(
539 size_t limit, size_t offset,
542 ErrorString errorDescription, QUuid requestId);
543
544 void listSavedSearchesComplete(
545 LocalStorageManager::ListObjectsOptions flag, size_t limit,
548 QList<SavedSearch> foundSearches, QUuid requestId);
549
550 void listSavedSearchesFailed(
551 LocalStorageManager::ListObjectsOptions flag, size_t limit,
554 ErrorString errorDescription, QUuid requestId);
555
556 void expungeSavedSearchComplete(SavedSearch search, QUuid requestId);
557
558 void expungeSavedSearchFailed(
559 SavedSearch search, ErrorString errorDescription, QUuid requestId);
560
561 void accountHighUsnComplete(
562 qint32 usn, QString linkedNotebookGuid, QUuid requestId);
563
564 void accountHighUsnFailed(
565 QString linkedNotebookGuid, ErrorString errorDescription,
566 QUuid requestId);
567
568public Q_SLOTS:
569 void init();
570
571 // User-related slots:
572 void onGetUserCountRequest(QUuid requestId);
573
574 void onSwitchUserRequest(
575 Account account, LocalStorageManager::StartupOptions startupOptions,
576 QUuid requestId);
577
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);
583
584 // Notebook-related slots:
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);
591
592 void onFindDefaultOrLastUsedNotebookRequest(
593 Notebook notebook, QUuid requestId);
594
595 void onListAllNotebooksRequest(
596 size_t limit, size_t offset,
599 QString linkedNotebookGuid, QUuid requestId);
600
601 void onListAllSharedNotebooksRequest(QUuid requestId);
602
603 void onListNotebooksRequest(
604 LocalStorageManager::ListObjectsOptions flag, size_t limit,
605 size_t offset, LocalStorageManager::ListNotebooksOrder order,
607 QString linkedNotebookGuid, QUuid requestId);
608
609 void onListSharedNotebooksPerNotebookGuidRequest(
610 QString notebookGuid, QUuid requestId);
611
612 void onExpungeNotebookRequest(Notebook notebook, QUuid requestId);
613
614 // Linked notebook-related slots:
615 void onGetLinkedNotebookCountRequest(QUuid requestId);
616
617 void onAddLinkedNotebookRequest(
618 LinkedNotebook linkedNotebook, QUuid requestId);
619
620 void onUpdateLinkedNotebookRequest(
621 LinkedNotebook linkedNotebook, QUuid requestId);
622
623 void onFindLinkedNotebookRequest(
624 LinkedNotebook linkedNotebook, QUuid requestId);
625
626 void onListAllLinkedNotebooksRequest(
627 size_t limit, size_t offset,
629 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
630
631 void onListLinkedNotebooksRequest(
632 LocalStorageManager::ListObjectsOptions flag, size_t limit,
634 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
635
636 void onExpungeLinkedNotebookRequest(
637 LinkedNotebook linkedNotebook, QUuid requestId);
638
639 // Note-related slots:
640 void onGetNoteCountRequest(
641 LocalStorageManager::NoteCountOptions options, QUuid requestId);
642
643 void onGetNoteCountPerNotebookRequest(
644 Notebook notebook, LocalStorageManager::NoteCountOptions options,
645 QUuid requestId);
646
647 void onGetNoteCountPerTagRequest(
648 Tag tag, LocalStorageManager::NoteCountOptions options,
649 QUuid requestId);
650
651 void onGetNoteCountsPerAllTagsRequest(
652 LocalStorageManager::NoteCountOptions options, QUuid requestId);
653
654 void onGetNoteCountPerNotebooksAndTagsRequest(
655 QStringList notebookLocalUids, QStringList tagLocalUids,
656 LocalStorageManager::NoteCountOptions options, QUuid requestId);
657
658 void onAddNoteRequest(Note note, QUuid requestId);
659
660 void onUpdateNoteRequest(
661 Note note, LocalStorageManager::UpdateNoteOptions options,
662 QUuid requestId);
663
664 void onFindNoteRequest(
665 Note note, LocalStorageManager::GetNoteOptions options,
666 QUuid requestId);
667
668 void onListNotesPerNotebookRequest(
669 Notebook notebook, LocalStorageManager::GetNoteOptions options,
670 LocalStorageManager::ListObjectsOptions flag, size_t limit,
671 size_t offset, LocalStorageManager::ListNotesOrder order,
672 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
673
674 void onListNotesPerTagRequest(
675 Tag tag, LocalStorageManager::GetNoteOptions options,
676 LocalStorageManager::ListObjectsOptions flag, size_t limit,
677 size_t offset, LocalStorageManager::ListNotesOrder order,
678 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
679
680 void onListNotesPerNotebooksAndTagsRequest(
681 QStringList notebookLocalUids, QStringList tagLocalUids,
682 LocalStorageManager::GetNoteOptions options,
683 LocalStorageManager::ListObjectsOptions flag, size_t limit,
684 size_t offset, LocalStorageManager::ListNotesOrder order,
685 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
686
687 void onListNotesByLocalUidsRequest(
688 QStringList noteLocalUids, LocalStorageManager::GetNoteOptions options,
689 LocalStorageManager::ListObjectsOptions flag, size_t limit,
690 size_t offset, LocalStorageManager::ListNotesOrder order,
691 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
692
693 void onListNotesRequest(
694 LocalStorageManager::ListObjectsOptions flag,
695 LocalStorageManager::GetNoteOptions options, size_t limit,
696 size_t offset, LocalStorageManager::ListNotesOrder order,
698 QString linkedNotebookGuid, QUuid requestId);
699
700 void onFindNoteLocalUidsWithSearchQuery(
701 NoteSearchQuery noteSearchQuery, QUuid requestId);
702
703 void onExpungeNoteRequest(Note note, QUuid requestId);
704
705 // Tag-related slots:
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);
710
711 void onListAllTagsPerNoteRequest(
712 Note note, LocalStorageManager::ListObjectsOptions flag, size_t limit,
713 size_t offset, LocalStorageManager::ListTagsOrder order,
714 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
715
716 void onListAllTagsRequest(
717 size_t limit, size_t offset, LocalStorageManager::ListTagsOrder order,
719 QString linkedNotebookGuid, QUuid requestId);
720
721 void onListTagsRequest(
722 LocalStorageManager::ListObjectsOptions flag, size_t limit,
723 size_t offset, LocalStorageManager::ListTagsOrder order,
725 QString linkedNotebookGuid, QUuid requestId);
726
727 void onListTagsWithNoteLocalUidsRequest(
728 LocalStorageManager::ListObjectsOptions flag, size_t limit,
729 size_t offset, LocalStorageManager::ListTagsOrder order,
731 QString linkedNotebookGuid, QUuid requestId);
732
733 void onExpungeTagRequest(Tag tag, QUuid requestId);
734 void onExpungeNotelessTagsFromLinkedNotebooksRequest(QUuid requestId);
735
736 // Resource-related slots:
737 void onGetResourceCountRequest(QUuid requestId);
738 void onAddResourceRequest(Resource resource, QUuid requestId);
739 void onUpdateResourceRequest(Resource resource, QUuid requestId);
740
741 void onFindResourceRequest(
742 Resource resource, LocalStorageManager::GetResourceOptions options,
743 QUuid requestId);
744
745 void onExpungeResourceRequest(Resource resource, QUuid requestId);
746
747 // Saved search-related slots:
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);
752
753 void onListAllSavedSearchesRequest(
754 size_t limit, size_t offset,
756 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
757
758 void onListSavedSearchesRequest(
759 LocalStorageManager::ListObjectsOptions flag, size_t limit,
761 LocalStorageManager::OrderDirection orderDirection, QUuid requestId);
762
763 void onExpungeSavedSearchRequest(SavedSearch search, QUuid requestId);
764
765 void onAccountHighUsnRequest(QString linkedNotebookGuid, QUuid requestId);
766
767private:
768 LocalStorageManagerAsync() = delete;
769 Q_DISABLE_COPY(LocalStorageManagerAsync)
770
771 LocalStorageManagerAsyncPrivate * const d_ptr;
772 Q_DECLARE_PRIVATE(LocalStorageManagerAsync)
773};
774
775} // namespace quentier
776
777#endif // LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_ASYNC_H
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 Note.h:35
Definition Notebook.h:35
Definition Resource.h:30
Definition SavedSearch.h:33
Definition Tag.h:33
Definition User.h:34