libquentier 0.5.0
The library for rich desktop clients of Evernote service
|
Public Types | |
enum class | StartupOption { ClearDatabase = 1 , OverrideLock = 2 } |
The StartupOption enum is a QFlags enum which allows to specify some options to be applied to the local storage database on startup or on call to switchUser method. More... | |
enum class | ListObjectsOption { ListAll = 0 , ListDirty = 1 , ListNonDirty = 2 , ListElementsWithoutGuid = 4 , ListElementsWithGuid = 8 , ListLocal = 16 , ListNonLocal = 32 , ListFavoritedElements = 64 , ListNonFavoritedElements = 128 } |
The ListObjectsOption enum is a QFlags enum which allows to specify the desired local storage elements in calls to methods listing them from the database. More... | |
enum class | OrderDirection { Ascending = 0 , Descending } |
The OrderDirection enum specifies the direction of ordering of the results for methods listing the objects from the local storage database. | |
enum class | ListNotebooksOrder { ByUpdateSequenceNumber = 0 , ByNotebookName , ByCreationTimestamp , ByModificationTimestamp , NoOrder } |
The ListNotebooksOrder allows to specify the results ordering for methods listing notebooks from the local storage database. | |
enum class | ListLinkedNotebooksOrder { ByUpdateSequenceNumber = 0 , ByShareName , ByUsername , NoOrder } |
The ListLinkedNotebooksOrder enum allows to specify the results ordering for methods listing linked notebooks from local storage. | |
enum class | NoteCountOption { IncludeNonDeletedNotes = 1 , IncludeDeletedNotes = 2 } |
The NoteCountOption enum is a QFlags enum which allows to specify some options for methods returning note counts from local storage. | |
enum class | UpdateNoteOption { UpdateResourceMetadata = 1 , UpdateResourceBinaryData = 2 , UpdateTags = 4 } |
The UpdateNoteOption enum is a QFlags enum which allows to specify which note fields should be updated when updateNote method is called. More... | |
enum class | GetNoteOption { WithResourceMetadata = 1 , WithResourceBinaryData = 2 } |
The GetNoteOption enum is a QFlags enum which allows to specify which note fields should be included when findNote or one of listNote* methods is called. More... | |
enum class | ListNotesOrder { ByUpdateSequenceNumber = 0 , ByTitle , ByCreationTimestamp , ByModificationTimestamp , ByDeletionTimestamp , ByAuthor , BySource , BySourceApplication , ByReminderTime , ByPlaceName , NoOrder } |
The ListNotesOrder enum allows to specify the results ordering for methods listing notes from the local storage database. | |
enum class | ListTagsOrder { ByUpdateSequenceNumber , ByName , NoOrder } |
The ListTagsOrder enum allows to specify the results ordering for methods listing tags from the local storage database. | |
enum class | GetResourceOption { WithBinaryData = 1 } |
The GetResourceOption enum is a QFlags enum which allows to specify which resource fields should be included when findEnResource method is called. More... | |
enum class | ListSavedSearchesOrder { ByUpdateSequenceNumber = 0 , ByName , ByFormat , NoOrder } |
The ListSavedSearchesOrder enum allows to specify the results ordering for methods listing saved searches from local storage. | |
Signals | |
void | upgradeProgress (double progress) |
LocalStorageManager is capable of performing automatic database upgrades if/when it is necessary. | |
Public Member Functions | |
LocalStorageManager (const Account &account, const StartupOptions options={}, QObject *parent=nullptr) | |
LocalStorageManager - constructor. Takes in the account for which the LocalStorageManager instance is created plus some other parameters determining the startup behaviour. | |
void | switchUser (const Account &account, const StartupOptions options={}) |
switchUser - switches to another local storage database file associated with the passed in account | |
bool | isLocalStorageVersionTooHigh (ErrorString &errorDescription) |
bool | localStorageRequiresUpgrade (ErrorString &errorDescription) |
QVector< std::shared_ptr< ILocalStoragePatch > > | requiredLocalStoragePatches () |
qint32 | localStorageVersion (ErrorString &errorDescription) |
qint32 | highestSupportedLocalStorageVersion () const |
int | userCount (ErrorString &errorDescription) const |
userCount returns the number of non-deleted users currently stored in the local storage database | |
bool | addUser (const User &user, ErrorString &errorDescription) |
addUser adds the passed in User object to the local storage database | |
bool | updateUser (const User &user, ErrorString &errorDescription) |
updateUser updates the passed in User object in the local storage database | |
bool | findUser (User &user, ErrorString &errorDescription) const |
findUser attempts to find and fill the fields of the passed in User object which must have "id" field set as this value is used as the identifier of User objects in the local storage database | |
bool | deleteUser (const User &user, ErrorString &errorDescription) |
deleteUser marks the user as deleted in local storage | |
bool | expungeUser (const User &user, ErrorString &errorDescription) |
expungeUser permanently deletes the user from the local storage database | |
int | notebookCount (ErrorString &errorDescription) const |
notebookCount returns the number of notebooks currently stored in the local storage database | |
bool | addNotebook (Notebook ¬ebook, ErrorString &errorDescription) |
addNotebook adds the passed in Notebook to the local storage database | |
bool | updateNotebook (Notebook ¬ebook, ErrorString &errorDescription) |
updateNotebook updates the passed in Notebook in the local storage database | |
bool | findNotebook (Notebook ¬ebook, ErrorString &errorDescription) const |
findNotebook attempts to find and set all found fields of the passed in Notebook object | |
bool | findDefaultNotebook (Notebook ¬ebook, ErrorString &errorDescription) const |
findDefaultNotebook attempts to find the default notebook in the local storage database. | |
bool | findLastUsedNotebook (Notebook ¬ebook, ErrorString &errorDescription) const |
findLastUsedNotebook attempts to find the last used notebook in the local storage database. | |
bool | findDefaultOrLastUsedNotebook (Notebook ¬ebook, ErrorString &errorDescription) const |
findDefaultOrLastUsedNotebook attempts to find either the default or the last used notebook in the local storage database. | |
QList< Notebook > | listAllNotebooks (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotebooksOrder order=ListNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const |
listAllNotebooks attempts to list all notebooks within the current account from the local storage database. | |
QList< Notebook > | listNotebooks (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotebooksOrder order=ListNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const |
listNotebooks attempts to list notebooks within the account according to the specified input flag | |
QList< SharedNotebook > | listAllSharedNotebooks (ErrorString &errorDescription) const |
listAllSharedNotebooks attempts to list all shared notebooks within the account. | |
QList< SharedNotebook > | listSharedNotebooksPerNotebookGuid (const QString ¬ebookGuid, ErrorString &errorDescription) const |
listSharedNotebooksPerNotebookGuid - attempts to list all shared notebooks per given notebook's remote guid (not local uid, it's important). | |
bool | expungeNotebook (Notebook ¬ebook, ErrorString &errorDescription) |
expungeNotebook permanently deletes the specified notebook from the local storage database. | |
int | linkedNotebookCount (ErrorString &errorDescription) const |
linkedNotebookCount returns the number of linked notebooks stored in the local storage database. | |
bool | addLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription) |
addLinkedNotebook adds passed in LinkedNotebook to the local storage database; LinkedNotebook must have "remote" Evernote service's guid set. It is not possible to add a linked notebook in offline mode so it doesn't make sense for LinkedNotebook objects to not have guid. | |
bool | updateLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription) |
updateLinkedNotebook updates passd in LinkedNotebook in the local storage database; LinkedNotebook must have "remote" Evernote service's guid set. | |
bool | findLinkedNotebook (LinkedNotebook &linkedNotebook, ErrorString &errorDescription) const |
findLinkedNotebook attempts to find and set all found fields for passed in by reference LinkedNotebook object. For LinkedNotebook local uid doesn't mean anything because it can only be considered valid if it has "remote" Evernote service's guid set. So this passed in LinkedNotebook object must have guid set to identify the linked notebook in the local storage database. | |
QList< LinkedNotebook > | listAllLinkedNotebooks (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListLinkedNotebooksOrder order=ListLinkedNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const |
listAllLinkedNotebooks - attempts to list all linked notebooks within the account. | |
QList< LinkedNotebook > | listLinkedNotebooks (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListLinkedNotebooksOrder order=ListLinkedNotebooksOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const |
listLinkedNotebooks attempts to list linked notebooks within the account according to the specified input flag. | |
bool | expungeLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription) |
expungeLinkedNotebook permanently deletes specified linked notebook from the local storage database. | |
int | noteCount (ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const |
noteCount returns the number of notes currently stored in the local storage database. | |
int | noteCountPerNotebook (const Notebook ¬ebook, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const |
noteCountPerNotebook returns the number of notes currently stored in the local storage database per given notebook. | |
int | noteCountPerTag (const Tag &tag, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const |
noteCountPerTag returns the number of notes currently stored in local storage database labeled with given tag. | |
bool | noteCountsPerAllTags (QHash< QString, int > ¬eCountsPerTagLocalUid, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const |
noteCountsPerAllTags returns the number of notes currently stored in local storage database labeled with each tag stored in the local storage database. | |
int | noteCountPerNotebooksAndTags (const QStringList ¬ebookLocalUids, const QStringList &tagLocalUids, ErrorString &errorDescription, const NoteCountOptions options=NoteCountOption::IncludeNonDeletedNotes) const |
noteCountPerNotebooksAndTags returns the number of notes currently stored in local storage database belonging to one of notebooks corresponding to given notebook local uids and labeled by at least one of tags corresponding to given tag local uids | |
bool | addNote (Note ¬e, ErrorString &errorDescription) |
addNote adds passed in Note to the local storage database. | |
bool | updateNote (Note ¬e, const UpdateNoteOptions options, ErrorString &errorDescription) |
updateNote updates passed in Note in the local storage database. | |
bool | findNote (Note ¬e, const GetNoteOptions options, ErrorString &errorDescription) const |
findNote - attempts to find note in the local storage database | |
QList< Note > | listNotesPerNotebook (const Notebook ¬ebook, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const |
listNotesPerNotebook attempts to list notes per given notebook | |
QList< Note > | listNotesPerTag (const Tag &tag, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const |
listNotesPerTag attempts to list notes labeled with a given tag | |
QList< Note > | listNotesPerNotebooksAndTags (const QStringList ¬ebookLocalUids, const QStringList &tagLocalUids, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const |
listNotesPerNotebooksAndTags attempts to list notes which are present within one of specified notebooks and are labeled with at least one of specified tags | |
QList< Note > | listNotesByLocalUids (const QStringList ¬eLocalUids, const GetNoteOptions options, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder &order=ListNotesOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const |
listNotesByLocalUids attempts to list notes given their local uids | |
QList< Note > | listNotes (const ListObjectsOptions flag, const GetNoteOptions options, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotesOrder order=ListNotesOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const |
listNotes attempts to list notes within the account according to the specified input flag. | |
QStringList | findNoteLocalUidsWithSearchQuery (const NoteSearchQuery ¬eSearchQuery, ErrorString &errorDescription) const |
findNoteLocalUidsWithSearchQuery attempts to find note local uids of notes corresponding to the passed in NoteSearchQuery object. | |
NoteList | findNotesWithSearchQuery (const NoteSearchQuery ¬eSearchQuery, const GetNoteOptions options, ErrorString &errorDescription) const |
findNotesWithSearchQuery attempts to find notes corresponding to the passed in NoteSearchQuery object. | |
bool | expungeNote (Note ¬e, ErrorString &errorDescription) |
expungeNote permanently deletes note from local storage. | |
int | tagCount (ErrorString &errorDescription) const |
tagCount returns the number of non-deleted tags currently stored in the local storage database. | |
bool | addTag (Tag &tag, ErrorString &errorDescription) |
addTag adds passed in Tag to the local storage database. If tag has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid. | |
bool | updateTag (Tag &tag, ErrorString &errorDescription) |
updateTag updates passed in Tag in the local storage database. | |
bool | findTag (Tag &tag, ErrorString &errorDescription) const |
findTag attempts to find and fill the fields of passed in tag object. | |
QList< Tag > | listAllTagsPerNote (const Note ¬e, ErrorString &errorDescription, const ListObjectsOptions &flag=ListObjectsOption::ListAll, const size_t limit=0, const size_t offset=0, const ListTagsOrder &order=ListTagsOrder::NoOrder, const OrderDirection &orderDirection=OrderDirection::Ascending) const |
listAllTagsPerNote lists all tags per given note | |
QList< Tag > | listAllTags (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder order=ListTagsOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const |
listAllTags lists all tags within the current user's account. | |
QList< Tag > | listTags (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder &order=ListTagsOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const |
listTags attempts to list tags within the account according to the specified input flag. | |
QList< std::pair< Tag, QStringList > > | listTagsWithNoteLocalUids (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder &order=ListTagsOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const |
listTagsWithNoteLocalUids attempts to list tags and their corresponding local uids within the account according to the specified input flag | |
bool | expungeTag (Tag &tag, QStringList &expungedChildTagLocalUids, ErrorString &errorDescription) |
expungeTag permanently deletes tag from the local storage database. | |
bool | expungeNotelessTagsFromLinkedNotebooks (ErrorString &errorDescription) |
expungeNotelessTagsFromLinkedNotebooks permanently deletes from the local storage database those tags which belong to some linked notebook and are not linked with any notes. | |
int | enResourceCount (ErrorString &errorDescription) const |
enResourceCount (the name is not Resource to prevent problems with macro defined on some versions of Windows) returns the number of resources currently stored in the local storage database. | |
bool | addEnResource (Resource &resource, ErrorString &errorDescription) |
addEnResource adds passed in resource to the local storage database. | |
bool | updateEnResource (Resource &resource, ErrorString &errorDescription) |
updateEnResource updates passed in resource in the local storage database. | |
bool | findEnResource (Resource &resource, const GetResourceOptions options, ErrorString &errorDescription) const |
findEnResource method attempts to find resource in the local storage database | |
bool | expungeEnResource (Resource &resource, ErrorString &errorDescription) |
expungeResource permanently deletes resource from the local storage database. | |
int | savedSearchCount (ErrorString &errorDescription) const |
savedSearchCount returns the number of saved seacrhes currently stored in local storage database. | |
bool | addSavedSearch (SavedSearch &search, ErrorString &errorDescription) |
addSavedSearch adds passed in SavedSearch to the local storage database; if search has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid. | |
bool | updateSavedSearch (SavedSearch &search, ErrorString &errorDescription) |
updateSavedSearch updates passed in SavedSearch in the local storage database. | |
bool | findSavedSearch (SavedSearch &search, ErrorString &errorDescription) const |
findSavedSearch attempts to find and fill the fields of passed in saved search object. | |
QList< SavedSearch > | listAllSavedSearches (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListSavedSearchesOrder order=ListSavedSearchesOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const |
listAllSavedSearches lists all saved searches within the account. | |
QList< SavedSearch > | listSavedSearches (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListSavedSearchesOrder order=ListSavedSearchesOrder::NoOrder, const OrderDirection orderDirection=OrderDirection::Ascending) const |
listSavedSearches attempts to list saved searches within the account according to the specified input flag. | |
bool | expungeSavedSearch (SavedSearch &search, ErrorString &errorDescription) |
expungeSavedSearch permanently deletes saved search from the local storage database. | |
qint32 | accountHighUsn (const QString &linkedNotebookGuid, ErrorString &errorDescription) |
accountHighUsn returns the highest update sequence number within the data elements stored in the local storage database, either for user's own account or for some linked notebook. | |
Friends | |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const StartupOption option) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const StartupOption option) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const StartupOptions options) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const StartupOptions options) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListObjectsOption option) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const ListObjectsOption option) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListObjectsOptions options) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const ListObjectsOptions options) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const OrderDirection orderDirection) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const OrderDirection orderDirection) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListNotebooksOrder order) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const ListNotebooksOrder order) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListLinkedNotebooksOrder order) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const ListLinkedNotebooksOrder order) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const NoteCountOption option) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const NoteCountOption option) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const NoteCountOptions options) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const NoteCountOptions options) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const UpdateNoteOption option) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const UpdateNoteOption option) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const UpdateNoteOptions options) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const UpdateNoteOptions options) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const GetNoteOption option) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &dbg, const GetNoteOption option) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const GetNoteOptions options) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const GetNoteOptions options) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListNotesOrder order) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const ListNotesOrder order) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListTagsOrder order) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const ListTagsOrder order) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const GetResourceOption option) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const GetResourceOption option) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const GetResourceOptions options) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const GetResourceOptions options) |
QUENTIER_EXPORT QTextStream & | operator<< (QTextStream &strm, const ListSavedSearchesOrder order) |
QUENTIER_EXPORT QDebug & | operator<< (QDebug &strm, const ListSavedSearchesOrder order) |
|
strong |
The GetNoteOption enum is a QFlags enum which allows to specify which note fields should be included when findNote or one of listNote* methods is called.
Most note data is included unconditionally - note title, content, attributes (if any) etc. However, some specific data can be opted to not be included into the returned note data - notably, metadata of resources and binary data of resources. If these are omitted, findNote or any of listNote* methods might work faster than otherwise
|
strong |
The GetResourceOption enum is a QFlags enum which allows to specify which resource fields should be included when findEnResource method is called.
Most resource data is included unconditionally but some specific data can be opted to not be included into the returned resource data - notably, binary data of the resource. If it is omitted, findEnResource method might work faster than otherwise
Enumerator | |
---|---|
WithBinaryData | WithBinaryData value specifies than dataBody and alternateDataBody should be included into the returned resource |
|
strong |
The ListObjectsOption enum is a QFlags enum which allows to specify the desired local storage elements in calls to methods listing them from the database.
For example, one can either list all available elements of certain type from local storage or only elements marked as dirty (modified locally, not yet synchronized) or elements never synchronized with the remote storage or elements which are synchronizable with the remote storage etc.
|
strong |
The StartupOption enum is a QFlags enum which allows to specify some options to be applied to the local storage database on startup or on call to switchUser method.
Enumerator | |
---|---|
ClearDatabase | If ClearDatabase flag is active, LocalStorageManager would wipe any existing database contents; the net effect would be as if no database existed for the given user before the creation of LocalStorageManager or before the call to its switchUser method |
OverrideLock | If OverrideLock flag is active, LocalStorageManager would ignore the existing advisory lock (if any) put on the database file; if this flag is not active, the attempt to create LocalStorageManager (or the attempt to call its switchUser method) with the advisory lock on the database file put by someone else would cause the throwing of DatabaseLockedException |
|
strong |
The UpdateNoteOption enum is a QFlags enum which allows to specify which note fields should be updated when updateNote method is called.
Most note data is updated unconditionally - note title, content, attributes (if any) etc. However, some specific data can be chosen to not update - notably, metadata of resources, binary data of resources or lists of note's tags
|
explicit |
LocalStorageManager - constructor. Takes in the account for which the LocalStorageManager instance is created plus some other parameters determining the startup behaviour.
account | The account for which the local storage is being created and initialized |
options | Startup options for the local storage, none enabled by default |
parent | Parent QObject |
qint32 quentier::LocalStorageManager::accountHighUsn | ( | const QString & | linkedNotebookGuid, |
ErrorString & | errorDescription | ||
) |
accountHighUsn returns the highest update sequence number within the data elements stored in the local storage database, either for user's own account or for some linked notebook.
linkedNotebookGuid | The guid of the linked notebook for which the highest update sequence number is requested; if null or empty, the highest update sequence number for user's own account is returned |
errorDescription | Error description if account's highest update sequence number could not be returned |
bool quentier::LocalStorageManager::addEnResource | ( | Resource & | resource, |
ErrorString & | errorDescription | ||
) |
addEnResource adds passed in resource to the local storage database.
resource | Resource to be added to the database, must have either note's local uid set or note's "remote" Evernote service's guid set; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call |
errorDescription | Error description if resource could not be added |
bool quentier::LocalStorageManager::addLinkedNotebook | ( | const LinkedNotebook & | linkedNotebook, |
ErrorString & | errorDescription | ||
) |
addLinkedNotebook adds passed in LinkedNotebook to the local storage database; LinkedNotebook must have "remote" Evernote service's guid set. It is not possible to add a linked notebook in offline mode so it doesn't make sense for LinkedNotebook objects to not have guid.
linkedNotebook | LinkedNotebook to be added to the local storage database |
errorDescription | Error description if linked notebook could not be added |
bool quentier::LocalStorageManager::addNote | ( | Note & | note, |
ErrorString & | errorDescription | ||
) |
addNote adds passed in Note to the local storage database.
note | Note to be added to local storage database; required to contain either "remote" notebook guid or local notebook uid; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call; also tag guids are filled if the note passed in contained only tag local uids and tag local uids are filled if the note passed in contained only tag guids |
errorDescription | Error description if note could not be added |
bool quentier::LocalStorageManager::addNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) |
addNotebook adds the passed in Notebook to the local storage database
If the notebook has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. Otherwise it is identified by the local uid
notebook | The notebook to be added to the local storage database; the object is passed by reference and may be changed as a result of the call (filled with autocompleted fields like local uid if it was empty before the call) |
errorDescription | Error description if the notebook could not be added |
bool quentier::LocalStorageManager::addSavedSearch | ( | SavedSearch & | search, |
ErrorString & | errorDescription | ||
) |
addSavedSearch adds passed in SavedSearch to the local storage database; if search has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid.
search | SavedSearch to be added to the local storage; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call |
errorDescription | Error description if SavedSearch could not be added |
bool quentier::LocalStorageManager::addTag | ( | Tag & | tag, |
ErrorString & | errorDescription | ||
) |
addTag adds passed in Tag to the local storage database. If tag has "remote" Evernote service's guid set, it is identified in the database by this guid. Otherwise it is identified by local uid.
tag | Tag to be added to the local storage; may be changed as a result of the call, filled with autogenerated fields like local uid if it was empty before the call |
errorDescription | Error description if Tag could not be added |
bool quentier::LocalStorageManager::addUser | ( | const User & | user, |
ErrorString & | errorDescription | ||
) |
addUser adds the passed in User object to the local storage database
The table with Users is only involved in operations with notebooks which have "contact" field set which in turn is used with business accounts
user | The user to be added to the local storage database |
errorDescription | Error description if the user could not be added |
bool quentier::LocalStorageManager::deleteUser | ( | const User & | user, |
ErrorString & | errorDescription | ||
) |
deleteUser marks the user as deleted in local storage
user | The user to be marked as deleted |
errorDescription | Error description if the user could not be marked as deleted |
int quentier::LocalStorageManager::enResourceCount | ( | ErrorString & | errorDescription | ) | const |
enResourceCount (the name is not Resource to prevent problems with macro defined on some versions of Windows) returns the number of resources currently stored in the local storage database.
errorDescription | Error description if the number of resources could not be returned |
bool quentier::LocalStorageManager::expungeEnResource | ( | Resource & | resource, |
ErrorString & | errorDescription | ||
) |
expungeResource permanently deletes resource from the local storage database.
resource | Resource to be expunged; may be changed as a result of the call, automatically filled with local uid and note local uid and/or guid if these were empty before the call |
errorDescription | Error description if resource could not be expunged |
bool quentier::LocalStorageManager::expungeLinkedNotebook | ( | const LinkedNotebook & | linkedNotebook, |
ErrorString & | errorDescription | ||
) |
expungeLinkedNotebook permanently deletes specified linked notebook from the local storage database.
Evernote API doesn't allow to delete linked notebooks from the remote storage, it can only be done by official desktop client or web client. So this method should be called only during the synchronization with remote service, when some linked notebook is found to be deleted via either official desktop client or web cient.
linkedNotebook | Linked notebook to be expunged. Must have "remote" guid set |
errorDescription | Error description if linked notebook could not be expunged |
bool quentier::LocalStorageManager::expungeNote | ( | Note & | note, |
ErrorString & | errorDescription | ||
) |
expungeNote permanently deletes note from local storage.
Evernote API doesn't allow to delete notes from the remote storage, it can only be done by official desktop client or web client. So this method should be called only during the synchronization with remote database, when some note is found to be deleted via either official desktop client or web client.
note | Note to be expunged; may be changed as a result of the call, filled with fields like local uid or notebook guid or local uid |
errorDescription | Error description if note could not be expunged |
bool quentier::LocalStorageManager::expungeNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) |
expungeNotebook permanently deletes the specified notebook from the local storage database.
Evernote API doesn't allow to delete the notebooks from the remote storage, it can only be done by the official desktop Evernote client or via its web client. So this method should be called only during the synchronization with the remote storage, when some notebook is found to be deleted via either the official desktop client or via the web client; also, this method can be called for local notebooks not synchronized with Evernote at all.
notebook | The notebook to be expunged. Must have either "remote" guid or local uid set; the object is passed by reference and may be changed as a result of the call (filled with local uid if it was empty before the call) |
errorDescription | Error description if the notebook could not be expunged |
bool quentier::LocalStorageManager::expungeNotelessTagsFromLinkedNotebooks | ( | ErrorString & | errorDescription | ) |
expungeNotelessTagsFromLinkedNotebooks permanently deletes from the local storage database those tags which belong to some linked notebook and are not linked with any notes.
errorDescription | Error description if tag could not be expunged |
bool quentier::LocalStorageManager::expungeSavedSearch | ( | SavedSearch & | search, |
ErrorString & | errorDescription | ||
) |
expungeSavedSearch permanently deletes saved search from the local storage database.
search | Saved search to be expunged; may be changed as a result of the call filled local uid if it was empty before the call |
errorDescription | Error description if saved search could not be expunged |
bool quentier::LocalStorageManager::expungeTag | ( | Tag & | tag, |
QStringList & | expungedChildTagLocalUids, | ||
ErrorString & | errorDescription | ||
) |
expungeTag permanently deletes tag from the local storage database.
Evernote API doesn't allow to delete tags from remote storage, it can only be done by official desktop client or web client. So this method should be called only during the synchronization with remote database, when some tag is found to be deleted via either official desktop client or web client.
tag | Tag to be expunged; may be changed as a result of the call, automatically filled with local uid if it was empty before the call |
expungedChildTagLocalUids | If the expunged tag was a parent of some other tags, these were expunged as well; this parameter would contain the local uids of expunged child tags |
errorDescription | Error description if tag could not be expunged |
bool quentier::LocalStorageManager::expungeUser | ( | const User & | user, |
ErrorString & | errorDescription | ||
) |
expungeUser permanently deletes the user from the local storage database
user | The user to be expunged |
errorDescription | Error description if the user could not be expunged |
bool quentier::LocalStorageManager::findDefaultNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) | const |
findDefaultNotebook attempts to find the default notebook in the local storage database.
notebook | The default notebook to be found |
errorDescription | Error description if the default notebook could not be found |
bool quentier::LocalStorageManager::findDefaultOrLastUsedNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) | const |
findDefaultOrLastUsedNotebook attempts to find either the default or the last used notebook in the local storage database.
notebook | Either the default or the last used notebook to be found |
errorDescription | Error description if the default or the last used notebook could not be found |
bool quentier::LocalStorageManager::findEnResource | ( | Resource & | resource, |
const GetResourceOptions | options, | ||
ErrorString & | errorDescription | ||
) | const |
findEnResource method attempts to find resource in the local storage database
resource | Resource to be found in the local storage database. If it has the "remote" Evernote service's guid set, this guid is used to identify the resource in the local storage database. Otherwise resource's local uid is used |
options | Options specifying which optionally includable fields of the resource should actually be included |
errorDescription | Error description if resource could not be found |
bool quentier::LocalStorageManager::findLastUsedNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) | const |
findLastUsedNotebook attempts to find the last used notebook in the local storage database.
notebook | The last used notebook to be found |
errorDescription | Error description if the last used notebook could not be found |
bool quentier::LocalStorageManager::findLinkedNotebook | ( | LinkedNotebook & | linkedNotebook, |
ErrorString & | errorDescription | ||
) | const |
findLinkedNotebook attempts to find and set all found fields for passed in by reference LinkedNotebook object. For LinkedNotebook local uid doesn't mean anything because it can only be considered valid if it has "remote" Evernote service's guid set. So this passed in LinkedNotebook object must have guid set to identify the linked notebook in the local storage database.
linkedNotebook | Linked notebook to be found. Must have "remote" guid set |
errorDescription | Error description if linked notebook could not be found |
bool quentier::LocalStorageManager::findNote | ( | Note & | note, |
const GetNoteOptions | options, | ||
ErrorString & | errorDescription | ||
) | const |
findNote - attempts to find note in the local storage database
note | - note to be found in the local storage database. Must have either local or "remote" Evernote service's guid set |
options | - options specifying which optionally includable fields of the note should actually be included |
errorDescription | - error description if note could not be found |
bool quentier::LocalStorageManager::findNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) | const |
findNotebook attempts to find and set all found fields of the passed in Notebook object
If "remote" Evernote service's guid for the notebook is set, it is used to identify the notebook in the local storage database. Otherwise the notebook is identified by its local uid. If it's empty, the search would attempt to find the notebook by its name. If the name is also not set, the search would attempt to find the notebook by linked notebook guid assuming that no more than one notebook corresponds to the linked notebook guid. If linked notebook guid is also not set, the search would fail.
Important! Due to the fact that the notebook name is only unique within the users's own account as well as within each linked notebook, the result of the search by name depends on the notebook's linked notebook guid: if it is not set, the search by name would only search for the notebook with the specified name within the user's own account. If it is set, the search would only consider the linked notebook with the corresponding guid.
notebook | The notebook to be found. Must have either "remote" or local uid or name or linked notebook guid set |
errorDescription | Error description if the notebook could not be found |
QStringList quentier::LocalStorageManager::findNoteLocalUidsWithSearchQuery | ( | const NoteSearchQuery & | noteSearchQuery, |
ErrorString & | errorDescription | ||
) | const |
findNoteLocalUidsWithSearchQuery attempts to find note local uids of notes corresponding to the passed in NoteSearchQuery object.
noteSearchQuery | Filled NoteSearchQuery object used to filter the notes |
errorDescription | Error description in case note local uids could not be listed |
NoteList quentier::LocalStorageManager::findNotesWithSearchQuery | ( | const NoteSearchQuery & | noteSearchQuery, |
const GetNoteOptions | options, | ||
ErrorString & | errorDescription | ||
) | const |
findNotesWithSearchQuery attempts to find notes corresponding to the passed in NoteSearchQuery object.
noteSearchQuery | Filled NoteSearchQuery object used to filter the notes |
options | Options specifying which optionally includable fields of the note should actually be included |
errorDescription | Error description in case notes could not be listed |
bool quentier::LocalStorageManager::findSavedSearch | ( | SavedSearch & | search, |
ErrorString & | errorDescription | ||
) | const |
findSavedSearch attempts to find and fill the fields of passed in saved search object.
If "remote" Evernote services's guid for the saved search is set, it would be used to identify the saved search in the local storage. Otherwise the local uid would be used. If neither guid not local uid are set, saved search's name would be used. If the name is also not set, the search for saved search would fail.
search | SavedSearch to be found in the local storage database |
errorDescription | Error description if SavedSearch could not be found |
bool quentier::LocalStorageManager::findTag | ( | Tag & | tag, |
ErrorString & | errorDescription | ||
) | const |
findTag attempts to find and fill the fields of passed in tag object.
If "remote" Evernote service's guid for the tag is set, it would be used to identify the tag in the local storage database. Otherwise the local uid would be used. If neither guid nor local uid are set, tag's name would be used. If the name is also not set, the search would fail.
Important! Due to the fact that the tag name is only unique within the users's own account as well as within each linked notebook, the result of the search by name depends on the tag's linked notebook guid: if it is not set, the search by name would only search for the tag with the specified name within the user's own account. If it is set, the search would only consider tags from a linked notebook with the corresponding guid.
tag | Tag to be found in the local storage database; must have either guid, local uid or name set |
errorDescription | Error description in case tag could not be found |
bool quentier::LocalStorageManager::findUser | ( | User & | user, |
ErrorString & | errorDescription | ||
) | const |
findUser attempts to find and fill the fields of the passed in User object which must have "id" field set as this value is used as the identifier of User objects in the local storage database
user | The user to be found. Must have "id" field set |
errorDescription | Error description if the user could not be found |
qint32 quentier::LocalStorageManager::highestSupportedLocalStorageVersion | ( | ) | const |
highestSupportedLocalStorageVersion returns the highest version of local storage persistence which the current build of libquentier is capable of working with
bool quentier::LocalStorageManager::isLocalStorageVersionTooHigh | ( | ErrorString & | errorDescription | ) |
isLocalStorageVersionTooHigh method checks whether the existing local storage persistence has version which is too high for the currenly run version of libquentier to work with i.e. whether the local storage has already been upgraded using a new version of libquentier.
NOTE: it is libquentier client code's responsibility to call this method and/or localStorageRequiresUpgrade method, libquentier won't call any of these on its own and will just attempt to work with the existing local storage, whatever version it is of. If version is too high, things can fail in most mysterious way, so the client code is obliged to call these methods to ensure the local storage version is checked properly.
errorDescription | Textual description of the error if the method was unable to determine whether the local storage version is too high for the currently run version of libquentier to work with, otherwise this parameter is not touched by the method |
int quentier::LocalStorageManager::linkedNotebookCount | ( | ErrorString & | errorDescription | ) | const |
linkedNotebookCount returns the number of linked notebooks stored in the local storage database.
errorDescription | Error description if the number of linked notebooks count not be returned |
QList< LinkedNotebook > quentier::LocalStorageManager::listAllLinkedNotebooks | ( | ErrorString & | errorDescription, |
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListLinkedNotebooksOrder | order = ListLinkedNotebooksOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending |
||
) | const |
listAllLinkedNotebooks - attempts to list all linked notebooks within the account.
errorDescription | Error description if linked notebooks could not be listed, otherwise this parameter is untouched |
limit | Limit for the max number of linked notebooks in the result, zero by default which means no limit is set |
offset | Number of linked notebooks to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of linked notebooks in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
QList< Notebook > quentier::LocalStorageManager::listAllNotebooks | ( | ErrorString & | errorDescription, |
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotebooksOrder | order = ListNotebooksOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending , |
||
const QString & | linkedNotebookGuid = QString() |
||
) | const |
listAllNotebooks attempts to list all notebooks within the current account from the local storage database.
errorDescription | Error description if all notebooks could not be listed; if no error happens, this parameter is untouched |
limit | The limit for the max number of notebooks in the result, zero by default which means no limit is set |
offset | The number of notebooks to skip in the beginning of the result, zero by default |
order | Allows to specify a particular ordering of notebooks in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
linkedNotebookGuid | If it's null, the method would list the notebooks ignoring their belonging to the current account or to some linked notebook; if it's empty, only the non-linked notebooks would be listed; otherwise, the only one notebook from the corresponding linked notebook would be listed |
QList< SavedSearch > quentier::LocalStorageManager::listAllSavedSearches | ( | ErrorString & | errorDescription, |
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListSavedSearchesOrder | order = ListSavedSearchesOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending |
||
) | const |
listAllSavedSearches lists all saved searches within the account.
errorDescription | Error description if all saved searches could not be listed; otherwise this parameter is untouched |
limit | Limit for the max number of saved searches in the result, zero by default which means no limit is set |
offset | Number of saved searches to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of saved searches in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
QList< SharedNotebook > quentier::LocalStorageManager::listAllSharedNotebooks | ( | ErrorString & | errorDescription | ) | const |
listAllSharedNotebooks attempts to list all shared notebooks within the account.
errorDescription | Error description if shared notebooks could not be listed; if no error happens, this parameter is untouched |
QList< Tag > quentier::LocalStorageManager::listAllTags | ( | ErrorString & | errorDescription, |
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListTagsOrder | order = ListTagsOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending , |
||
const QString & | linkedNotebookGuid = QString() |
||
) | const |
listAllTags lists all tags within the current user's account.
errorDescription | Error description if tags were not listed successfully. In such case the returned list of tags would be empty and error description won't be empty. However, if, for example, the list of tags is empty and error description is empty too, it means the current account does not have any tags created. |
limit | Limit for the max number of tags in the result, zero by default which means no limit is set |
offset | Number of tags to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of tags in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
linkedNotebookGuid | If it's null, the method would list tags ignoring their belonging to the current account or to some linked notebook; if it's empty, only the tags from user's own account would be listed; otherwise, only the tags corresponding to the certain linked notebook would be listed |
QList< Tag > quentier::LocalStorageManager::listAllTagsPerNote | ( | const Note & | note, |
ErrorString & | errorDescription, | ||
const ListObjectsOptions & | flag = ListObjectsOption::ListAll , |
||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListTagsOrder & | order = ListTagsOrder::NoOrder , |
||
const OrderDirection & | orderDirection = OrderDirection::Ascending |
||
) | const |
listAllTagsPerNote lists all tags per given note
note | Note for which the list of tags is requested. If it has "remote" Evernote service's guid set, it is used to identify the note in the local storage database. Otherwise its local uid is used for that. |
errorDescription | Error description if tags were not listed successfully. In such case the returned list of tags would be empty and error description won't be empty. However, if, for example, the list of tags is empty and error description is empty too, it means the provided note does not have any tags assigned to it. |
flag | Input parameter used to set the filter for the desired tags to be listed |
limit | Limit for the max number of tags in the result, zero by default which means no limit is set |
offset | Number of tags to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of tags in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; |
QList< LinkedNotebook > quentier::LocalStorageManager::listLinkedNotebooks | ( | const ListObjectsOptions | flag, |
ErrorString & | errorDescription, | ||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListLinkedNotebooksOrder | order = ListLinkedNotebooksOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending |
||
) | const |
listLinkedNotebooks attempts to list linked notebooks within the account according to the specified input flag.
flag | Input parameter used to set the filter for the desired linked notebooks to be listed |
errorDescription | Error description if linked notebooks within the account could not be listed; if no error happens, this parameter is untouched |
limit | Limit for the max number of linked notebooks in the result, zero by default which means no limit is set |
offset | Number of linked notebooks to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of linked notebooks in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
QList< Notebook > quentier::LocalStorageManager::listNotebooks | ( | const ListObjectsOptions | flag, |
ErrorString & | errorDescription, | ||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotebooksOrder | order = ListNotebooksOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending , |
||
const QString & | linkedNotebookGuid = QString() |
||
) | const |
listNotebooks attempts to list notebooks within the account according to the specified input flag
flag | Input parameter used to set the filter for the desired notebooks to be listed |
errorDescription | Error description if notebooks within the account could not be listed; if no error happens, this parameter is untouched |
limit | The limit for the max number of notebooks in the result, zero by default which means no limit is set |
offset | The number of notebooks to skip in the beginning of the result, zero by default |
order | Allows to specify a particular ordering of notebooks in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
linkedNotebookGuid | If it's null, the method would list notebooks ignoring their belonging to the current account or to some linked notebook; if it's empty, only the non-linked notebooks would be listed; otherwise, the only one notebook from the corresponding linked notebook would be listed |
QList< Note > quentier::LocalStorageManager::listNotes | ( | const ListObjectsOptions | flag, |
const GetNoteOptions | options, | ||
ErrorString & | errorDescription, | ||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotesOrder | order = ListNotesOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending , |
||
const QString & | linkedNotebookGuid = QString() |
||
) | const |
listNotes attempts to list notes within the account according to the specified input flag.
flag | Input parameter used to set the filter for the desired notes to be listed |
options | Options specifying which optionally includable fields of the note should actually be included |
errorDescription | Error description if notes within the account could not be listed; if no error happens, this parameter is untouched |
limit | Limit for the max number of notes in the result, zero by default which means no limit is set |
offset | Number of notes to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of notes in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
linkedNotebookGuid | If it's null, notes from both user's own notebooks and linked notebooks would be listed; if it's empty, only the notes from non-linked notebooks would be listed; otherwise, only the notes from the specified linked notebook would be listed |
QList< Note > quentier::LocalStorageManager::listNotesByLocalUids | ( | const QStringList & | noteLocalUids, |
const GetNoteOptions | options, | ||
ErrorString & | errorDescription, | ||
const ListObjectsOptions & | flag = ListObjectsOption::ListAll , |
||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotesOrder & | order = ListNotesOrder::NoOrder , |
||
const OrderDirection & | orderDirection = OrderDirection::Ascending |
||
) | const |
listNotesByLocalUids attempts to list notes given their local uids
The method would only return notes which it managed to find within the local storage i.e. having an invalid local uid in the list won't result in an error, just in the corresponding note not returned within the result
Notes within the result can be additionally filtered with flag parameter
noteLocalUids | Local uids of notes to be listed |
options | Options specifying which optionally includable fields of the note should actually be included |
errorDescription | Error description in case notes could not be listed |
flag | Input parameter used to set the filter for the desired notes to be listed |
limit | Limit for the max number of notes in the result, zero by default which means no limit is set |
offset | Number of notes to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of notes in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; |
QList< Note > quentier::LocalStorageManager::listNotesPerNotebook | ( | const Notebook & | notebook, |
const GetNoteOptions | options, | ||
ErrorString & | errorDescription, | ||
const ListObjectsOptions & | flag = ListObjectsOption::ListAll , |
||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotesOrder & | order = ListNotesOrder::NoOrder , |
||
const OrderDirection & | orderDirection = OrderDirection::Ascending |
||
) | const |
listNotesPerNotebook attempts to list notes per given notebook
notebook | Notebook for which the list of notes is requested. If it has the "remote" Evernote service's guid set, it would be used to identify the notebook in the local storage database, otherwise its local uid would be used |
options | Options specifying which optionally includable fields of the note should actually be included |
errorDescription | Error description in case notes could not be listed |
flag | Input parameter used to set the filter for the desired notes to be listed |
limit | Limit for the max number of notes in the result, zero by default which means no limit is set |
offset | Number of notes to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of notes in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; |
QList< Note > quentier::LocalStorageManager::listNotesPerNotebooksAndTags | ( | const QStringList & | notebookLocalUids, |
const QStringList & | tagLocalUids, | ||
const GetNoteOptions | options, | ||
ErrorString & | errorDescription, | ||
const ListObjectsOptions & | flag = ListObjectsOption::ListAll , |
||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotesOrder & | order = ListNotesOrder::NoOrder , |
||
const OrderDirection & | orderDirection = OrderDirection::Ascending |
||
) | const |
listNotesPerNotebooksAndTags attempts to list notes which are present within one of specified notebooks and are labeled with at least one of specified tags
notebookLocalUids | Local uids of notebooks to which the listed notes might belong |
tagLocalUids | Local uids of tags with which the listed notes might be labeled |
options | Options specifying which optionally includable fields of the note should actually be included |
errorDescription | Error description in case notes could not be listed |
flag | Input parameter used to set the filter for the desired notes to be listed |
limit | Limit for the max number of notes in the result, zero by default which means no limit is set |
offset | Number of notes to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of notes in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; |
QList< Note > quentier::LocalStorageManager::listNotesPerTag | ( | const Tag & | tag, |
const GetNoteOptions | options, | ||
ErrorString & | errorDescription, | ||
const ListObjectsOptions & | flag = ListObjectsOption::ListAll , |
||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListNotesOrder & | order = ListNotesOrder::NoOrder , |
||
const OrderDirection & | orderDirection = OrderDirection::Ascending |
||
) | const |
listNotesPerTag attempts to list notes labeled with a given tag
tag | Tag for which the list of notes labeled with it is requested. If it has the "remote" Evernote service's guid set, it is used to identify the tag in the local storage database, otherwise its local uid is used |
options | Options specifying which optionally includable fields of the note should actually be included |
errorDescription | Error description in case notes could not be listed |
flag | Input parameter used to set the filter for the desired notes to be listed |
limit | Limit for the max number of notes in the result, zero by default which means no limit is set |
offset | Number of notes to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of notes in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; |
QList< SavedSearch > quentier::LocalStorageManager::listSavedSearches | ( | const ListObjectsOptions | flag, |
ErrorString & | errorDescription, | ||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListSavedSearchesOrder | order = ListSavedSearchesOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending |
||
) | const |
listSavedSearches attempts to list saved searches within the account according to the specified input flag.
flag | Input parameter used to set the filter for the desired saved searches to be listed |
errorDescription | Error description if saved searches within the account could not be listed; if no error happens, this parameter is untouched |
limit | Limit for the max number of saved searches in the result, zero by default which means no limit is set |
offset | Number of saved searches to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of saved searches in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
QList< SharedNotebook > quentier::LocalStorageManager::listSharedNotebooksPerNotebookGuid | ( | const QString & | notebookGuid, |
ErrorString & | errorDescription | ||
) | const |
listSharedNotebooksPerNotebookGuid - attempts to list all shared notebooks per given notebook's remote guid (not local uid, it's important).
notebookGuid | Remote Evernote service's guid of the notebook for which the shared notebooks are requested |
errorDescription | Error description if shared notebooks per notebook guid could not be listed; if no error happens, this parameter is untouched |
QList< Tag > quentier::LocalStorageManager::listTags | ( | const ListObjectsOptions | flag, |
ErrorString & | errorDescription, | ||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListTagsOrder & | order = ListTagsOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending , |
||
const QString & | linkedNotebookGuid = QString() |
||
) | const |
listTags attempts to list tags within the account according to the specified input flag.
flag | Input parameter used to set the filter for the desired tags to be listed |
errorDescription | Error description if notes within the account could not be listed; if no error happens, this parameter is untouched |
limit | Limit for the max number of tags in the result, zero by default which means no limit is set |
offset | Number of tags to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of tags in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
linkedNotebookGuid | If it's null, the method would list tags ignoring their belonging to the current account or to some linked notebook; if it's empty, only the tags from user's own account would be listed; otherwise, only the tags corresponding to the certain linked notebook would be listed |
QList< std::pair< Tag, QStringList > > quentier::LocalStorageManager::listTagsWithNoteLocalUids | ( | const ListObjectsOptions | flag, |
ErrorString & | errorDescription, | ||
const size_t | limit = 0 , |
||
const size_t | offset = 0 , |
||
const ListTagsOrder & | order = ListTagsOrder::NoOrder , |
||
const OrderDirection | orderDirection = OrderDirection::Ascending , |
||
const QString & | linkedNotebookGuid = QString() |
||
) | const |
listTagsWithNoteLocalUids attempts to list tags and their corresponding local uids within the account according to the specified input flag
The method is very similar to listTags only for each listed tag it returns the list of note local uids corresponding to notes labeled with the respective tag.
flag | Input parameter used to set the filter for the desired tags to be listed |
errorDescription | Error description if notes within the account could not be listed; if no error happens, this parameter is untouched |
limit | Limit for the max number of tags in the result, zero by default which means no limit is set |
offset | Number of tags to skip in the beginning of the result, zero by default |
order | Allows to specify particular ordering of tags in the result, NoOrder by default |
orderDirection | Specifies the direction of ordering, by default ascending direction is used; this parameter has no meaning if order is equal to NoOrder |
linkedNotebookGuid | If it's null, the method would list tags ignoring their belonging to the current account or to some linked notebook; if it's empty, only the tags from user's own account would be listed; otherwise, only the tags corresponding to the certain linked notebook would be listed |
bool quentier::LocalStorageManager::localStorageRequiresUpgrade | ( | ErrorString & | errorDescription | ) |
localStorageRequiresUpgrade method checks whether the existing local storage persistence requires to be upgraded. The upgrades may be required sometimes when new version of libquentier is rolled out which changes something in the internals of local storage organization. This method only checks for changes which are backwards incompatible i.e. once the local storage is upgraded, previous version of libquentier won't be able to work with it properly!
NOTE: it is libquentier client code's responsibility to call this method and/or isLocalStorageVersionTooHigh method, libquentier won't call any of these on its own and will just attempt to work with the existing local storage, whatever version it is of. If version is too high, things can fail in most mysterious way, so the client code is obliged to call these methods to ensure the local storage version is checked properly.
errorDescription | Textual description of the error if the method was unable to determine whether the local storage requires upgrade, otherwise this parameter is not touched by the method |
qint32 quentier::LocalStorageManager::localStorageVersion | ( | ErrorString & | errorDescription | ) |
localStorageVersion method fetches the current version of local storage persistence which can be used for informational purposes.
errorDescription | Textual description of the error if the method was unable to determine the current version of local storage persistence |
int quentier::LocalStorageManager::notebookCount | ( | ErrorString & | errorDescription | ) | const |
notebookCount returns the number of notebooks currently stored in the local storage database
errorDescription | Error description if the number of notebooks could not be returned |
int quentier::LocalStorageManager::noteCount | ( | ErrorString & | errorDescription, |
const NoteCountOptions | options = NoteCountOption::IncludeNonDeletedNotes |
||
) | const |
noteCount returns the number of notes currently stored in the local storage database.
errorDescription | Error description if the number of notes could not be returned |
options | Options clarifying which notes to list; by default only non-deleted notes are listed |
int quentier::LocalStorageManager::noteCountPerNotebook | ( | const Notebook & | notebook, |
ErrorString & | errorDescription, | ||
const NoteCountOptions | options = NoteCountOption::IncludeNonDeletedNotes |
||
) | const |
noteCountPerNotebook returns the number of notes currently stored in the local storage database per given notebook.
notebook | Notebook for which the number of notes is requested. If its guid is set, it is used to identify the notebook, otherwise its local uid is used |
errorDescription | Error description if the number of notes per given notebook could not be returned |
options | Options clarifying which notes to list; by default only non-deleted notes are listed |
int quentier::LocalStorageManager::noteCountPerNotebooksAndTags | ( | const QStringList & | notebookLocalUids, |
const QStringList & | tagLocalUids, | ||
ErrorString & | errorDescription, | ||
const NoteCountOptions | options = NoteCountOption::IncludeNonDeletedNotes |
||
) | const |
noteCountPerNotebooksAndTags returns the number of notes currently stored in local storage database belonging to one of notebooks corresponding to given notebook local uids and labeled by at least one of tags corresponding to given tag local uids
notebookLocalUids | The list of notebook local uids used for filtering |
tagLocalUids | The list of tag local uids used for filtering |
errorDescription | Error description if the number of notes per notebooks and tags could not be returned |
options | Options clarifying which notes to list; by default only non-deleted notes are listed |
int quentier::LocalStorageManager::noteCountPerTag | ( | const Tag & | tag, |
ErrorString & | errorDescription, | ||
const NoteCountOptions | options = NoteCountOption::IncludeNonDeletedNotes |
||
) | const |
noteCountPerTag returns the number of notes currently stored in local storage database labeled with given tag.
tag | Tag for which the number of notes labeled with it is requested. If its guid is set, it is used to identify the tag, otherwise its local uid is used |
errorDescription | Error description if the number of notes per given tag could not be returned |
options | Options clarifying which notes to list; by default only non-deleted notes are listed |
bool quentier::LocalStorageManager::noteCountsPerAllTags | ( | QHash< QString, int > & | noteCountsPerTagLocalUid, |
ErrorString & | errorDescription, | ||
const NoteCountOptions | options = NoteCountOption::IncludeNonDeletedNotes |
||
) | const |
noteCountsPerAllTags returns the number of notes currently stored in local storage database labeled with each tag stored in the local storage database.
noteCountsPerTagLocalUid | The result hash: note counts by tag local uids |
errorDescription | Error description if the number of notes per all tags could not be returned |
options | Options clarifying which notes to list; by default only non-deleted notes are listed |
QVector< std::shared_ptr< ILocalStoragePatch > > quentier::LocalStorageManager::requiredLocalStoragePatches | ( | ) |
requiredLocalStoragePatches provides the client code with the list of patches which need to be applied to the current state of local storage in order to bring it to a state compatible with the current version of code. If no patches are required, an empty list of patches is returned.
The client code should apply each patch in the exact order in which they are returned by this method.
int quentier::LocalStorageManager::savedSearchCount | ( | ErrorString & | errorDescription | ) | const |
savedSearchCount returns the number of saved seacrhes currently stored in local storage database.
errorDescription | Error description if the number of saved seacrhes could not be returned |
void quentier::LocalStorageManager::switchUser | ( | const Account & | account, |
const StartupOptions | options = {} |
||
) |
switchUser - switches to another local storage database file associated with the passed in account
If optional "startFromScratch" parameter is set to true (it is false by default), the database file would be erased and only then - opened. If optional "overrideLock" parameter is set to true, the advisory lock set on the database file (if any) would be forcefully removed; otherwise, if this parameter if set to false, the presence of advisory lock on the database file woud cause the method to throw DatabaseLockedException
account | The account to which the local storage is to be switched |
options | Startup options for the local storage, none enabled by default |
int quentier::LocalStorageManager::tagCount | ( | ErrorString & | errorDescription | ) | const |
tagCount returns the number of non-deleted tags currently stored in the local storage database.
errorDescription | Error description if the number of tags could not be returned |
bool quentier::LocalStorageManager::updateEnResource | ( | Resource & | resource, |
ErrorString & | errorDescription | ||
) |
updateEnResource updates passed in resource in the local storage database.
If the resource has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. If no resource with such guid is found, the local uid is used to identify the resource in the local storage database. If the resource has no guid, the local uid is used to identify it in the local storage database.
resource | Resource to be updated; may be changed as a result of the call, automatically filled with local uid and note local uid and/or guid if these were empty before the call |
errorDescription | Error description if resource could not be updated |
bool quentier::LocalStorageManager::updateLinkedNotebook | ( | const LinkedNotebook & | linkedNotebook, |
ErrorString & | errorDescription | ||
) |
updateLinkedNotebook updates passd in LinkedNotebook in the local storage database; LinkedNotebook must have "remote" Evernote service's guid set.
linkedNotebook | LinkedNotebook to be updated in the local storage database |
errorDescription | Error description if linked notebook could not be updated |
bool quentier::LocalStorageManager::updateNote | ( | Note & | note, |
const UpdateNoteOptions | options, | ||
ErrorString & | errorDescription | ||
) |
updateNote updates passed in Note in the local storage database.
If the note has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. If no note with such guid is found, the local uid is used to identify the note in the local storage database. If the note has no guid, the local uid is used to identify it in the local storage database.
A special way in which this method might be used is the update of a note which clears note's guid. This way is special because it imposes certain requirements onto the resources which the note might have. However, it is only relevant if options input parameter has UpdateResourceMetadata flag enabled. The requirements for this special case are as follows:
note | Note to be updated in the local storage database; required to contain either "remote" notebook guid or local notebook uid; may be changed as a result of the call, filled with fields like local uid or notebook guid or local uid if any of these were empty before the call; also tag guids are filled if the note passed in contained only tag local uids and tag local uids are filled if the note passed in contained only tag guids. Bear in mind that after the call the note may not have the representative resources if "updateNoteOptions" input parameter contained no "UpdateResourceMetadata" flag as well as it may not have the representative tags if "UpdateTags" flag was not set |
options | Options specifying which optionally updatable fields of the note should actually be updated |
errorDescription | Error description if note could not be updated |
bool quentier::LocalStorageManager::updateNotebook | ( | Notebook & | notebook, |
ErrorString & | errorDescription | ||
) |
updateNotebook updates the passed in Notebook in the local storage database
If the notebook has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. Otherwise it is identified by the local uid.
notebook | Notebook to be updated in the local storage database; the object is passed by reference and may be changed as a result of the call (filled with autocompleted fields like local uid if it was empty before the call) |
errorDescription | Error description if the notebook could not be updated |
bool quentier::LocalStorageManager::updateSavedSearch | ( | SavedSearch & | search, |
ErrorString & | errorDescription | ||
) |
updateSavedSearch updates passed in SavedSearch in the local storage database.
If search has "remote" Evernote service's guid set, it is identified in the database by this guid. If the saved search has no guid, the local uid is used to identify it in the local storage database.
search | SavedSearch filled with values to be updated in the local storage database; may be changed as a result of the call filled local uid if it was empty before the call |
errorDescription | Error description if SavedSearch could not be updated |
bool quentier::LocalStorageManager::updateTag | ( | Tag & | tag, |
ErrorString & | errorDescription | ||
) |
updateTag updates passed in Tag in the local storage database.
If the tag has "remote" Evernote service's guid set, it is identified by this guid in the local storage database. If the tag has no guid, the local uid is used to identify it in the local storage database.
tag | Tag filled with values to be updated in the local storage database. Note that it can be changed * as a result of the call: automatically filled with local uid if it was empty before the call |
errorDescription | Error description if tag could not be updated |
bool quentier::LocalStorageManager::updateUser | ( | const User & | user, |
ErrorString & | errorDescription | ||
) |
updateUser updates the passed in User object in the local storage database
The table with Users is only involved in operations with notebooks which have "contact" field set which in turn is used with business accounts
user | The user to be updated in the local storage database |
errorDescription | Error description if the user could not be updated |
|
signal |
LocalStorageManager is capable of performing automatic database upgrades if/when it is necessary.
As the database upgrade can be a lengthy operation, this signal is meant to provide some feedback on the progress of the upgrade
progress | The value from 0 to 1 denoting the database upgrade progress |
int quentier::LocalStorageManager::userCount | ( | ErrorString & | errorDescription | ) | const |
userCount returns the number of non-deleted users currently stored in the local storage database
errorDescription | Error description if the number of users could not be returned |