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> 34 namespace qevercloud {
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);
135 bool isLocalStorageVersionTooHigh(
ErrorString & errorDescription);
152 bool localStorageRequiresUpgrade(
ErrorString & errorDescription);
162 bool upgradeLocalStorage(
ErrorString & errorDescription);
171 qint32 localStorageVersion(
ErrorString & errorDescription);
179 qint32 highestSupportedLocalStorageVersion()
const;
186 int userCount(
ErrorString & errorDescription)
const;
243 int notebookCount(
ErrorString & errorDescription)
const;
323 bool findDefaultOrLastUsedNotebook(
Notebook & notebook,
ErrorString & errorDescription)
const;
346 ByUpdateSequenceNumber = 0,
349 ByModificationTimestamp,
370 QList<Notebook> listAllNotebooks(
ErrorString & errorDescription,
const size_t limit = 0,
371 const size_t offset = 0,
const ListNotebooksOrder::type order = ListNotebooksOrder::NoOrder,
372 const OrderDirection::type orderDirection = OrderDirection::Ascending,
373 const QString & linkedNotebookGuid = QString())
const;
392 QList<Notebook> listNotebooks(
const ListObjectsOptions flag,
ErrorString & errorDescription,
393 const size_t limit = 0,
const size_t offset = 0,
394 const ListNotebooksOrder::type order = ListNotebooksOrder::NoOrder,
395 const OrderDirection::type orderDirection = OrderDirection::Ascending,
396 const QString & linkedNotebookGuid = QString())
const;
405 QList<SharedNotebook> listAllSharedNotebooks(
ErrorString & errorDescription)
const;
417 QList<SharedNotebook> listSharedNotebooksPerNotebookGuid(
const QString & notebookGuid,
441 int linkedNotebookCount(
ErrorString & errorDescription)
const;
483 ByUpdateSequenceNumber = 0,
502 QList<LinkedNotebook> listAllLinkedNotebooks(
ErrorString & errorDescription,
const size_t limit = 0,
const size_t offset = 0,
503 const ListLinkedNotebooksOrder::type order = ListLinkedNotebooksOrder::NoOrder,
504 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
520 QList<LinkedNotebook> listLinkedNotebooks(
const ListObjectsOptions flag,
ErrorString & errorDescription,
521 const size_t limit = 0,
const size_t offset = 0,
522 const ListLinkedNotebooksOrder::type order = ListLinkedNotebooksOrder::NoOrder,
523 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
542 int noteCount(
ErrorString & errorDescription)
const;
560 int noteCountPerTag(
const Tag & tag,
ErrorString & errorDescription)
const;
569 bool noteCountsPerAllTags(QHash<QString, int> & noteCountsPerTagLocalUid,
ErrorString & errorDescription)
const;
603 bool updateNote(
Note & note,
const bool updateResources,
604 const bool updateTags,
ErrorString & errorDescription);
619 const bool withResourceBinaryData =
true)
const;
629 ByUpdateSequenceNumber = 0,
632 ByModificationTimestamp,
662 QList<Note> listNotesPerNotebook(
const Notebook & notebook,
ErrorString & errorDescription,
663 const bool withResourceBinaryData =
true,
664 const ListObjectsOptions & flag = ListAll,
665 const size_t limit = 0,
const size_t offset = 0,
666 const ListNotesOrder::type & order = ListNotesOrder::NoOrder,
667 const OrderDirection::type & orderDirection = OrderDirection::Ascending)
const;
687 QList<Note> listNotesPerTag(
const Tag & tag,
ErrorString & errorDescription,
688 const bool withResourceBinaryData,
689 const LocalStorageManager::ListObjectsOptions & flag,
690 const size_t limit,
const size_t offset,
691 const LocalStorageManager::ListNotesOrder::type & order,
692 const LocalStorageManager::OrderDirection::type & orderDirection)
const;
715 QList<Note> listNotes(
const ListObjectsOptions flag,
ErrorString & errorDescription,
716 const bool withResourceBinaryData =
true,
const size_t limit = 0,
717 const size_t offset = 0,
const ListNotesOrder::type order = ListNotesOrder::NoOrder,
718 const OrderDirection::type orderDirection = OrderDirection::Ascending,
719 const QString & linkedNotebookGuid = QString())
const;
727 QStringList findNoteLocalUidsWithSearchQuery(
const NoteSearchQuery & noteSearchQuery,
743 NoteList findNotesWithSearchQuery(
const NoteSearchQuery & noteSearchQuery,
745 const bool withResourceBinaryData =
true)
const;
765 int tagCount(
ErrorString & errorDescription)
const;
819 ByUpdateSequenceNumber,
841 QList<Tag> listAllTagsPerNote(
const Note & note,
ErrorString & errorDescription,
842 const ListObjectsOptions & flag = ListAll,
843 const size_t limit = 0,
const size_t offset = 0,
844 const ListTagsOrder::type & order = ListTagsOrder::NoOrder,
845 const OrderDirection::type & orderDirection = OrderDirection::Ascending)
const;
863 QList<Tag> listAllTags(
ErrorString & errorDescription,
const size_t limit = 0,
864 const size_t offset = 0,
const ListTagsOrder::type order = ListTagsOrder::NoOrder,
865 const OrderDirection::type orderDirection = OrderDirection::Ascending,
866 const QString & linkedNotebookGuid = QString())
const;
884 QList<Tag> listTags(
const ListObjectsOptions flag,
ErrorString & errorDescription,
885 const size_t limit = 0,
const size_t offset = 0,
886 const ListTagsOrder::type & order = ListTagsOrder::NoOrder,
887 const OrderDirection::type orderDirection = OrderDirection::Ascending,
888 const QString & linkedNotebookGuid = QString())
const;
903 bool expungeTag(
Tag & tag, QStringList & expungedChildTagLocalUids,
ErrorString & errorDescription);
911 bool expungeNotelessTagsFromLinkedNotebooks(
ErrorString & errorDescription);
919 int enResourceCount(
ErrorString & errorDescription)
const;
957 bool findEnResource(
Resource & resource,
ErrorString & errorDescription,
const bool withBinaryData =
true)
const;
977 int savedSearchCount(
ErrorString & errorDescription)
const;
1023 ByUpdateSequenceNumber = 0,
1042 QList<SavedSearch> listAllSavedSearches(
ErrorString & errorDescription,
const size_t limit = 0,
const size_t offset = 0,
1043 const ListSavedSearchesOrder::type order = ListSavedSearchesOrder::NoOrder,
1044 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
1060 QList<SavedSearch> listSavedSearches(
const ListObjectsOptions flag,
ErrorString & errorDescription,
const size_t limit = 0,
const size_t offset = 0,
1061 const ListSavedSearchesOrder::type order = ListSavedSearchesOrder::NoOrder,
1062 const OrderDirection::type orderDirection = OrderDirection::Ascending)
const;
1086 qint32 accountHighUsn(
const QString & linkedNotebookGuid,
ErrorString & errorDescription);
1092 QScopedPointer<LocalStorageManagerPrivate> d_ptr;
1100 #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:329
Definition: Resource.h:29
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:1019
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:625
Definition: NoteSearchQuery.h:29
The ListLinkedNotebooksOrder struct is a C++98-style scoped enum which allows to specify ordering of ...
Definition: LocalStorageManager.h:479
The ListNotebooksOrder struct is a C++98 style scoped enum which allows to specify the ordering of th...
Definition: LocalStorageManager.h:342
Definition: LocalStorageManager.h:49
Definition: SavedSearch.h:36