19 #ifndef LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_H 20 #define LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_H 22 #include <quentier/types/Account.h> 23 #include <quentier/local_storage/Lists.h> 24 #include <quentier/local_storage/NoteSearchQuery.h> 25 #include <quentier/utility/Linkage.h> 26 #include <quentier/utility/Macros.h> 27 #include <quentier/types/ErrorString.h> 29 #include <QScopedPointer> 30 #include <QSharedPointer> 35 QT_FORWARD_DECLARE_STRUCT(ResourceAttributes)
36 QT_FORWARD_DECLARE_STRUCT(NoteAttributes)
37 QT_FORWARD_DECLARE_STRUCT(UserAttributes)
38 QT_FORWARD_DECLARE_STRUCT(Accounting)
39 QT_FORWARD_DECLARE_STRUCT(PremiumInfo)
40 QT_FORWARD_DECLARE_STRUCT(BusinessUserInfo)
41 QT_FORWARD_DECLARE_STRUCT(SharedNotebook)
42 QT_FORWARD_DECLARE_STRUCT(NotebookRestrictions)
47 QT_FORWARD_DECLARE_CLASS(LocalStorageManagerPrivate)
76 void upgradeProgress(
double progress);
91 ListElementsWithoutGuid = 4,
92 ListElementsWithGuid = 8,
95 ListFavoritedElements = 64,
96 ListNonFavoritedElements = 128
98 Q_DECLARE_FLAGS(ListObjectsOptions, ListObjectsOption)
117 void switchUser(
const Account & account,
const bool startFromScratch =
false,
118 const bool overrideLock =
false);
125 int userCount(
ErrorString & errorDescription)
const;
182 int notebookCount(
ErrorString & errorDescription)
const;
262 bool findDefaultOrLastUsedNotebook(
Notebook & notebook,
ErrorString & errorDescription)
const;
285 ByUpdateSequenceNumber = 0,
288 ByModificationTimestamp,
309 QList<Notebook> listAllNotebooks(
ErrorString & errorDescription,
const size_t limit = 0,
310 const size_t offset = 0,
const ListNotebooksOrder::type order = ListNotebooksOrder::NoOrder,
311 const OrderDirection::type orderDirection = OrderDirection::Ascending,
312 const QString & linkedNotebookGuid = QString())
const;
331 QList<Notebook> listNotebooks(
const ListObjectsOptions flag,
ErrorString & errorDescription,
332 const size_t limit = 0,
const size_t offset = 0,
333 const ListNotebooksOrder::type order = ListNotebooksOrder::NoOrder,
334 const OrderDirection::type orderDirection = OrderDirection::Ascending,
335 const QString & linkedNotebookGuid = QString())
const;
344 QList<SharedNotebook> listAllSharedNotebooks(
ErrorString & errorDescription)
const;
356 QList<SharedNotebook> listSharedNotebooksPerNotebookGuid(
const QString & notebookGuid,
380 int linkedNotebookCount(
ErrorString & errorDescription)
const;
422 ByUpdateSequenceNumber = 0,
441 QList<LinkedNotebook> listAllLinkedNotebooks(
ErrorString & errorDescription,
const size_t limit = 0,
const size_t offset = 0,
442 const ListLinkedNotebooksOrder::type order = ListLinkedNotebooksOrder::NoOrder,
443 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
459 QList<LinkedNotebook> listLinkedNotebooks(
const ListObjectsOptions flag,
ErrorString & errorDescription,
460 const size_t limit = 0,
const size_t offset = 0,
461 const ListLinkedNotebooksOrder::type order = ListLinkedNotebooksOrder::NoOrder,
462 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
481 int noteCount(
ErrorString & errorDescription)
const;
499 int noteCountPerTag(
const Tag & tag,
ErrorString & errorDescription)
const;
508 bool noteCountsPerAllTags(QHash<QString, int> & noteCountsPerTagLocalUid,
ErrorString & errorDescription)
const;
542 bool updateNote(
Note & note,
const bool updateResources,
543 const bool updateTags,
ErrorString & errorDescription);
558 const bool withResourceBinaryData =
true)
const;
568 ByUpdateSequenceNumber = 0,
571 ByModificationTimestamp,
601 QList<Note> listNotesPerNotebook(
const Notebook & notebook,
ErrorString & errorDescription,
602 const bool withResourceBinaryData =
true,
603 const ListObjectsOptions & flag = ListAll,
604 const size_t limit = 0,
const size_t offset = 0,
605 const ListNotesOrder::type & order = ListNotesOrder::NoOrder,
606 const OrderDirection::type & orderDirection = OrderDirection::Ascending)
const;
626 QList<Note> listNotesPerTag(
const Tag & tag,
ErrorString & errorDescription,
627 const bool withResourceBinaryData,
628 const LocalStorageManager::ListObjectsOptions & flag,
629 const size_t limit,
const size_t offset,
630 const LocalStorageManager::ListNotesOrder::type & order,
631 const LocalStorageManager::OrderDirection::type & orderDirection)
const;
654 QList<Note> listNotes(
const ListObjectsOptions flag,
ErrorString & errorDescription,
655 const bool withResourceBinaryData =
true,
const size_t limit = 0,
656 const size_t offset = 0,
const ListNotesOrder::type order = ListNotesOrder::NoOrder,
657 const OrderDirection::type orderDirection = OrderDirection::Ascending,
658 const QString & linkedNotebookGuid = QString())
const;
666 QStringList findNoteLocalUidsWithSearchQuery(
const NoteSearchQuery & noteSearchQuery,
682 NoteList findNotesWithSearchQuery(
const NoteSearchQuery & noteSearchQuery,
684 const bool withResourceBinaryData =
true)
const;
704 int tagCount(
ErrorString & errorDescription)
const;
758 ByUpdateSequenceNumber,
780 QList<Tag> listAllTagsPerNote(
const Note & note,
ErrorString & errorDescription,
781 const ListObjectsOptions & flag = ListAll,
782 const size_t limit = 0,
const size_t offset = 0,
783 const ListTagsOrder::type & order = ListTagsOrder::NoOrder,
784 const OrderDirection::type & orderDirection = OrderDirection::Ascending)
const;
802 QList<Tag> listAllTags(
ErrorString & errorDescription,
const size_t limit = 0,
803 const size_t offset = 0,
const ListTagsOrder::type order = ListTagsOrder::NoOrder,
804 const OrderDirection::type orderDirection = OrderDirection::Ascending,
805 const QString & linkedNotebookGuid = QString())
const;
823 QList<Tag> listTags(
const ListObjectsOptions flag,
ErrorString & errorDescription,
824 const size_t limit = 0,
const size_t offset = 0,
825 const ListTagsOrder::type & order = ListTagsOrder::NoOrder,
826 const OrderDirection::type orderDirection = OrderDirection::Ascending,
827 const QString & linkedNotebookGuid = QString())
const;
842 bool expungeTag(
Tag & tag, QStringList & expungedChildTagLocalUids,
ErrorString & errorDescription);
850 bool expungeNotelessTagsFromLinkedNotebooks(
ErrorString & errorDescription);
858 int enResourceCount(
ErrorString & errorDescription)
const;
896 bool findEnResource(
Resource & resource,
ErrorString & errorDescription,
const bool withBinaryData =
true)
const;
916 int savedSearchCount(
ErrorString & errorDescription)
const;
962 ByUpdateSequenceNumber = 0,
981 QList<SavedSearch> listAllSavedSearches(
ErrorString & errorDescription,
const size_t limit = 0,
const size_t offset = 0,
982 const ListSavedSearchesOrder::type order = ListSavedSearchesOrder::NoOrder,
983 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
999 QList<SavedSearch> listSavedSearches(
const ListObjectsOptions flag,
ErrorString & errorDescription,
const size_t limit = 0,
const size_t offset = 0,
1000 const ListSavedSearchesOrder::type order = ListSavedSearchesOrder::NoOrder,
1001 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
1025 qint32 accountHighUsn(
const QString & linkedNotebookGuid,
ErrorString & errorDescription);
1031 QScopedPointer<LocalStorageManagerPrivate> d_ptr;
1039 #endif // LIB_QUENTIER_LOCAL_STORAGE_LOCAL_STORAGE_MANAGER_H ListObjectsOption
The ListObjectsOption enum is the base enum for QFlags which allows to specify the desired local stor...
Definition: LocalStorageManager.h:87
Definition: LinkedNotebook.h:36
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:38
The OrderDirection struct is a C++98 style scoped enum which specifies the direction of ordering of t...
Definition: LocalStorageManager.h:268
Definition: Resource.h:29
Definition: DecryptedTextManager.h:25
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition: Account.h:24
The ListSavedSearchesOrder struct is a C++98-style scoped enum which allows to specify the ordering o...
Definition: LocalStorageManager.h:958
Definition: Notebook.h:38
The ListNotesOrder struct is a C++98-style scoped enum which allows to specify the ordering of the re...
Definition: LocalStorageManager.h:564
Definition: NoteSearchQuery.h:29
Definition: LocalStorageManager.h:34
The ListLinkedNotebooksOrder struct is a C++98-style scoped enum which allows to specify ordering of ...
Definition: LocalStorageManager.h:418
The ListNotebooksOrder struct is a C++98 style scoped enum which allows to specify the ordering of th...
Definition: LocalStorageManager.h:281
Definition: LocalStorageManager.h:49
Definition: SavedSearch.h:36