libquentier  0.4.0
The library for rich desktop clients of Evernote service
Classes | Public Types | Signals | Public Member Functions | List of all members
quentier::LocalStorageManager Class Reference
Inheritance diagram for quentier::LocalStorageManager:
Inheritance graph
[legend]
Collaboration diagram for quentier::LocalStorageManager:
Collaboration graph
[legend]

Classes

struct  ListLinkedNotebooksOrder
 The ListLinkedNotebooksOrder struct is a C++98-style scoped enum which allows to specify ordering of the results of methods listing linked notebooks from local storage. More...
 
struct  ListNotebooksOrder
 The ListNotebooksOrder struct is a C++98 style scoped enum which allows to specify the ordering of the results for methods listing the notebooks from the local storage database. More...
 
struct  ListNotesOrder
 The ListNotesOrder struct is a C++98-style scoped enum which allows to specify the ordering of the results of methods listing notes from local storage. More...
 
struct  ListSavedSearchesOrder
 The ListSavedSearchesOrder struct is a C++98-style scoped enum which allows to specify the ordering of the results of methods listing saved searches from local storage. More...
 
struct  ListTagsOrder
 
struct  OrderDirection
 The OrderDirection struct is a C++98 style scoped enum which specifies the direction of ordering of the results for methods listing the objects from the local storage database. More...
 

Public Types

enum  ListObjectsOption {
  ListAll = 0, ListDirty = 1, ListNonDirty = 2, ListElementsWithoutGuid = 4,
  ListElementsWithGuid = 8, ListLocal = 16, ListNonLocal = 32, ListFavoritedElements = 64,
  ListNonFavoritedElements = 128
}
 The ListObjectsOption enum is the base enum for QFlags which allows to specify the desired local storage elements in calls to methods listing them from the database. More...
 

Signals

void upgradeProgress (double progress)
 LocalStorageManager is capable of performing the automatic database upgrades if/when it is necessary. More...
 

Public Member Functions

 LocalStorageManager (const Account &account, const bool startFromScratch, const bool overrideLock)
 LocalStorageManager - constructor. Takes in the account for which the LocalStorageManager instance is created plus some other parameters determining the startup behaviour. More...
 
void switchUser (const Account &account, const bool startFromScratch=false, const bool overrideLock=false)
 switchUser - switches to another local storage database file associated with the passed in account More...
 
bool isLocalStorageVersionTooHigh (ErrorString &errorDescription)
 
bool localStorageRequiresUpgrade (ErrorString &errorDescription)
 
bool upgradeLocalStorage (ErrorString &errorDescription)
 upgradeLocalStorage method performs the upgrade of local storage persistence if upgrade is required; upgradeProgress signal is emitted to inform any listeners of the progress of the upgrade More...
 
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 More...
 
bool addUser (const User &user, ErrorString &errorDescription)
 addUser - adds the passed in User object to the local storage database More...
 
bool updateUser (const User &user, ErrorString &errorDescription)
 updateUser - updates the passed in User object in the local storage database More...
 
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 More...
 
bool deleteUser (const User &user, ErrorString &errorDescription)
 deleteUser - marks the user as deleted in local storage More...
 
bool expungeUser (const User &user, ErrorString &errorDescription)
 expungeUser - permanently deletes the user from the local storage database More...
 
int notebookCount (ErrorString &errorDescription) const
 notebookCount returns the number of notebooks currently stored in the local storage database More...
 
bool addNotebook (Notebook &notebook, ErrorString &errorDescription)
 addNotebook - adds the passed in Notebook to the local storage database More...
 
bool updateNotebook (Notebook &notebook, ErrorString &errorDescription)
 updateNotebook - updates the passed in Notebook in the local storage database More...
 
bool findNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findNotebook - attempts to find and set all found fields of the passed in Notebook object More...
 
bool findDefaultNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findDefaultNotebook - attempts to find the default notebook in the local storage database. More...
 
bool findLastUsedNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findLastUsedNotebook - attempts to find the last used notebook in the local storage database. More...
 
bool findDefaultOrLastUsedNotebook (Notebook &notebook, ErrorString &errorDescription) const
 findDefaultOrLastUsedNotebook - attempts to find either the default or the last used notebook in the local storage database More...
 
QList< NotebooklistAllNotebooks (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotebooksOrder::type order=ListNotebooksOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listAllNotebooks - attempts to list all notebooks within the current account from the local storage database More...
 
QList< NotebooklistNotebooks (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListNotebooksOrder::type order=ListNotebooksOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listNotebooks - attempts to list notebooks within the account according to the specified input flag More...
 
QList< SharedNotebooklistAllSharedNotebooks (ErrorString &errorDescription) const
 listAllSharedNotebooks - attempts to list all shared notebooks within the account More...
 
QList< SharedNotebooklistSharedNotebooksPerNotebookGuid (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) More...
 
bool expungeNotebook (Notebook &notebook, ErrorString &errorDescription)
 expungeNotebook - permanently deletes the specified notebook from the local storage database More...
 
int linkedNotebookCount (ErrorString &errorDescription) const
 linkedNotebookCount - returns the number of linked notebooks stored in the local storage database More...
 
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. More...
 
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. More...
 
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. More...
 
QList< LinkedNotebooklistAllLinkedNotebooks (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListLinkedNotebooksOrder::type order=ListLinkedNotebooksOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending) const
 listAllLinkedNotebooks - attempts to list all linked notebooks within the account More...
 
QList< LinkedNotebooklistLinkedNotebooks (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListLinkedNotebooksOrder::type order=ListLinkedNotebooksOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending) const
 listLinkedNotebooks - attempts to list linked notebooks within the account according to the specified input flag More...
 
bool expungeLinkedNotebook (const LinkedNotebook &linkedNotebook, ErrorString &errorDescription)
 expungeLinkedNotebook - permanently deletes specified linked notebook from local storage. Evernote API doesn't allow to delete linked notebooks from remote storage, it can only be done by official desktop client or web GUI. So this method should be called only during the synchronization with remote database, when some linked notebook is found to be deleted via either official desktop client or web GUI More...
 
int noteCount (ErrorString &errorDescription) const
 noteCount returns the number of non-deleted notes currently stored in local storage database More...
 
int noteCountPerNotebook (const Notebook &notebook, ErrorString &errorDescription) const
 noteCountPerNotebook returns the number of non-deleted notes currently stored in local storage database per given notebook More...
 
int noteCountPerTag (const Tag &tag, ErrorString &errorDescription) const
 noteCountPerTag returns the number of non-deleted notes currently stored in local storage database labeled with given tag More...
 
bool noteCountsPerAllTags (QHash< QString, int > &noteCountsPerTagLocalUid, ErrorString &errorDescription) const
 noteCountsPerAllTags returns the number of non-deleted notes currently stored in local storage database labeled with each tag stored in the local storage database More...
 
bool addNote (Note &note, ErrorString &errorDescription)
 addNote - adds passed in Note to the local storage database. More...
 
bool updateNote (Note &note, const bool updateResources, const bool updateTags, ErrorString &errorDescription)
 updateNote - updates passed in Note in the local storage database More...
 
bool findNote (Note &note, ErrorString &errorDescription, const bool withResourceBinaryData=true) const
 findNote - attempts to find note in the local storage database More...
 
QList< NotelistNotesPerNotebook (const Notebook &notebook, ErrorString &errorDescription, const bool withResourceBinaryData=true, const ListObjectsOptions &flag=ListAll, const size_t limit=0, const size_t offset=0, const ListNotesOrder::type &order=ListNotesOrder::NoOrder, const OrderDirection::type &orderDirection=OrderDirection::Ascending) const
 listNotesPerNotebook - attempts to list notes per given notebook More...
 
QList< NotelistNotesPerTag (const Tag &tag, ErrorString &errorDescription, const bool withResourceBinaryData, const LocalStorageManager::ListObjectsOptions &flag, const size_t limit, const size_t offset, const LocalStorageManager::ListNotesOrder::type &order, const LocalStorageManager::OrderDirection::type &orderDirection) const
 listNotesPerTag - attempts to list notes labeled with a given tag More...
 
QList< NotelistNotes (const ListObjectsOptions flag, ErrorString &errorDescription, const bool withResourceBinaryData=true, const size_t limit=0, const size_t offset=0, const ListNotesOrder::type order=ListNotesOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listNotes - attempts to list notes within the account according to the specified input flag More...
 
QStringList findNoteLocalUidsWithSearchQuery (const NoteSearchQuery &noteSearchQuery, ErrorString &errorDescription) const
 findNoteLocalUidsWithSearchQuery - attempt to find note local uids of notes corresponding to the passed in NoteSearchQuery object. More...
 
NoteList findNotesWithSearchQuery (const NoteSearchQuery &noteSearchQuery, ErrorString &errorDescription, const bool withResourceBinaryData=true) const
 findNotesWithSearchQuery - attempt to find notes corresponding to the passed in NoteSearchQuery object. More...
 
bool expungeNote (Note &note, ErrorString &errorDescription)
 expungeNote - permanently deletes note from local storage. Evernote API doesn't allow to delete notes from remote storage, it can only be done by official desktop client or web GUI. 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 GUI. More...
 
int tagCount (ErrorString &errorDescription) const
 tagCount returns the number of non-deleted tags currently stored in local storage database More...
 
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. More...
 
bool updateTag (Tag &tag, ErrorString &errorDescription)
 updateTag - updates passed in Tag in the local storage database. More...
 
bool findTag (Tag &tag, ErrorString &errorDescription) const
 findTag - attempts to find and fill the fields of passed in tag object. More...
 
QList< TaglistAllTagsPerNote (const Note &note, ErrorString &errorDescription, const ListObjectsOptions &flag=ListAll, const size_t limit=0, const size_t offset=0, const ListTagsOrder::type &order=ListTagsOrder::NoOrder, const OrderDirection::type &orderDirection=OrderDirection::Ascending) const
 listAllTagsPerNote - lists all tags per given note More...
 
QList< TaglistAllTags (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder::type order=ListTagsOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listAllTags - lists all tags within current user's account More...
 
QList< TaglistTags (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListTagsOrder::type &order=ListTagsOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending, const QString &linkedNotebookGuid=QString()) const
 listTags - attempts to list tags within the account according to the specified input flag More...
 
bool expungeTag (Tag &tag, QStringList &expungedChildTagLocalUids, ErrorString &errorDescription)
 expungeTag - permanently deletes tag from local storage. Evernote API doesn't allow to delete tags from remote storage, it can only be done by official desktop client or web GUI. 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 GUI. More...
 
bool expungeNotelessTagsFromLinkedNotebooks (ErrorString &errorDescription)
 expungeNotelessTagsFromLinkedNotebooks - permanently deletes from local storage those tags which belong to some linked notebook and are not linked with any notes in the local storage More...
 
int enResourceCount (ErrorString &errorDescription) const
 enResourceCount (the name is not Resource to prevent problems with Resource macro defined on some versions of Windows) returns the number of resources currently stored in local storage database More...
 
bool addEnResource (Resource &resource, ErrorString &errorDescription)
 addEnResource - adds passed in resource to the local storage database More...
 
bool updateEnResource (Resource &resource, ErrorString &errorDescription)
 updateEnResource - updates passed in resource in the local storage database. More...
 
bool findEnResource (Resource &resource, ErrorString &errorDescription, const bool withBinaryData=true) const
 findEnResource - attempts to find resource in the local storage database More...
 
bool expungeEnResource (Resource &resource, ErrorString &errorDescription)
 expungeResource - permanently deletes resource from local storage completely, without the possibility to restore it More...
 
int savedSearchCount (ErrorString &errorDescription) const
 savedSearchCount returns the number of saved seacrhes currently stored in local storage database More...
 
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. More...
 
bool updateSavedSearch (SavedSearch &search, ErrorString &errorDescription)
 updateSavedSearch - updates passed in SavedSearch in th local storage database. More...
 
bool findSavedSearch (SavedSearch &search, ErrorString &errorDescription) const
 findSavedSearch - attempts to find SavedSearch in the local storage database More...
 
QList< SavedSearchlistAllSavedSearches (ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListSavedSearchesOrder::type order=ListSavedSearchesOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending) const
 listAllSavedSearches - lists all saved searches within the account More...
 
QList< SavedSearchlistSavedSearches (const ListObjectsOptions flag, ErrorString &errorDescription, const size_t limit=0, const size_t offset=0, const ListSavedSearchesOrder::type order=ListSavedSearchesOrder::NoOrder, const OrderDirection::type orderDirection=OrderDirection::Ascending) const
 listSavedSearches - attempts to list saved searches within the account according to the specified input flag More...
 
bool expungeSavedSearch (SavedSearch &search, ErrorString &errorDescription)
 expungeSavedSearch - permanently deletes saved search from local storage completely, without the possibility to restore it More...
 
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 More...
 

Member Enumeration Documentation

◆ ListObjectsOption

The ListObjectsOption enum is the base enum for QFlags 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.

Constructor & Destructor Documentation

◆ LocalStorageManager()

quentier::LocalStorageManager::LocalStorageManager ( const Account account,
const bool  startFromScratch,
const bool  overrideLock 
)

LocalStorageManager - constructor. Takes in the account for which the LocalStorageManager instance is created plus some other parameters determining the startup behaviour.

Parameters
account- the account for which the local storage is being created and initialized
startFromScratch- if set to true, the existing database file for this account (if any) would be purged during the local storage manager construction (used in tests)
overrideLock- if set to true, the constructor would ignore the existing advisory lock (if any) put on the database file; otherwise the presence of advisory lock on the database file would cause the constructor to throw DatabaseLockedException

Member Function Documentation

◆ accountHighUsn()

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

Parameters
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
Returns
either the highest update sequence number - a non-negative value - or a negative number in case of error

◆ addEnResource()

bool quentier::LocalStorageManager::addEnResource ( Resource resource,
ErrorString errorDescription 
)

addEnResource - adds passed in resource to the local storage database

Parameters
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
Returns
true if resource was added successfully, false otherwise

◆ addLinkedNotebook()

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.

Parameters
linkedNotebook- LinkedNotebook to be added to the local storage database
errorDescription- error description if linked notebook could not be added
Returns
true if linked notebook was added successfully, false otherwise

◆ addNote()

bool quentier::LocalStorageManager::addNote ( Note note,
ErrorString errorDescription 
)

addNote - adds passed in Note to the local storage database.

Parameters
note- note to be passed 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
Returns
true if note was added successfully, false otherwise

◆ addNotebook()

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

Parameters
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
Returns
true if the notebook was added successfully, false otherwise

◆ addSavedSearch()

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.

Parameters
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
Returns
true if SavedSearch was added successfully, false otherwise

◆ addTag()

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.

Parameters
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
Returns
true if Tag was added successfully, false otherwise

◆ addUser()

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

Parameters
user- the user to be added to the local storage database
errorDescription- error description if the user could not be added
Returns
true if the user was added successfully, false otherwise

◆ deleteUser()

bool quentier::LocalStorageManager::deleteUser ( const User user,
ErrorString errorDescription 
)

deleteUser - marks the user as deleted in local storage

Parameters
user- the user to be marked as deleted
errorDescription- error description if the user could not be marked as deleted
Returns
true if the user was marked as deleted successfully, false otherwise

◆ enResourceCount()

int quentier::LocalStorageManager::enResourceCount ( ErrorString errorDescription) const

enResourceCount (the name is not Resource to prevent problems with Resource macro defined on some versions of Windows) returns the number of resources currently stored in local storage database

Parameters
errorDescription- error description if the number of resources could not be returned
Returns
either non-negative value with the number of resources or -1 which means some error occurred

◆ expungeEnResource()

bool quentier::LocalStorageManager::expungeEnResource ( Resource resource,
ErrorString errorDescription 
)

expungeResource - permanently deletes resource from local storage completely, without the possibility to restore it

Parameters
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
Returns
true if resource was expunged successfully, false otherwise

◆ expungeLinkedNotebook()

bool quentier::LocalStorageManager::expungeLinkedNotebook ( const LinkedNotebook linkedNotebook,
ErrorString errorDescription 
)

expungeLinkedNotebook - permanently deletes specified linked notebook from local storage. Evernote API doesn't allow to delete linked notebooks from remote storage, it can only be done by official desktop client or web GUI. So this method should be called only during the synchronization with remote database, when some linked notebook is found to be deleted via either official desktop client or web GUI

Parameters
linkedNotebook- linked notebook to be expunged. Must have "remote" guid set
errorDescription- error description if linked notebook could not be expunged
Returns
true if linked notebook was expunged successfully, false otherwise

◆ expungeNote()

bool quentier::LocalStorageManager::expungeNote ( Note note,
ErrorString errorDescription 
)

expungeNote - permanently deletes note from local storage. Evernote API doesn't allow to delete notes from remote storage, it can only be done by official desktop client or web GUI. 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 GUI.

Parameters
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
Returns
true if note was expunged successfully, false otherwise

◆ expungeNotebook()

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

Parameters
notebook- the notebook to be expunged. Must have either "remote" 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
Returns
true if the notebook was expunged successfully, false otherwise

◆ expungeNotelessTagsFromLinkedNotebooks()

bool quentier::LocalStorageManager::expungeNotelessTagsFromLinkedNotebooks ( ErrorString errorDescription)

expungeNotelessTagsFromLinkedNotebooks - permanently deletes from local storage those tags which belong to some linked notebook and are not linked with any notes in the local storage

Parameters
errorDescription- error description if tag could not be expunged
Returns
true if relevant tags were expunged successfully, false otherwise

◆ expungeSavedSearch()

bool quentier::LocalStorageManager::expungeSavedSearch ( SavedSearch search,
ErrorString errorDescription 
)

expungeSavedSearch - permanently deletes saved search from local storage completely, without the possibility to restore it

Parameters
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
Returns
true if saved search was expunged successfully, false otherwise

◆ expungeTag()

bool quentier::LocalStorageManager::expungeTag ( Tag tag,
QStringList &  expungedChildTagLocalUids,
ErrorString errorDescription 
)

expungeTag - permanently deletes tag from local storage. Evernote API doesn't allow to delete tags from remote storage, it can only be done by official desktop client or web GUI. 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 GUI.

Parameters
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
Returns
true if tag was expunged successfully, false otherwise

◆ expungeUser()

bool quentier::LocalStorageManager::expungeUser ( const User user,
ErrorString errorDescription 
)

expungeUser - permanently deletes the user from the local storage database

Parameters
user- the user to be expunged
errorDescription- error description if the user could not be expunged
Returns
true if the user was expunged successfully, false otherwise

◆ findDefaultNotebook()

bool quentier::LocalStorageManager::findDefaultNotebook ( Notebook notebook,
ErrorString errorDescription 
) const

findDefaultNotebook - attempts to find the default notebook in the local storage database.

Parameters
notebook- the default notebook to be found
errorDescription- error description if the default notebook could not be found
Returns
true if the default notebook was found, false otherwise

◆ findDefaultOrLastUsedNotebook()

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

Parameters
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
Returns
true if the default or the last used notebook were found, false otherwise

◆ findEnResource()

bool quentier::LocalStorageManager::findEnResource ( Resource resource,
ErrorString errorDescription,
const bool  withBinaryData = true 
) const

findEnResource - attempts to find resource in the local storage database

Parameters
resource- resource to be found in the local storage database. If it has "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
errorDescription- error description if resource could not be found
withBinaryData- optional parameter defining whether found resource should have dataBody recognitionBody, alternateDataBody filled with actual binary data. By default this parameter is true.
Returns
true if resource was found successfully, false otherwise

◆ findLastUsedNotebook()

bool quentier::LocalStorageManager::findLastUsedNotebook ( Notebook notebook,
ErrorString errorDescription 
) const

findLastUsedNotebook - attempts to find the last used notebook in the local storage database.

Parameters
notebook- the last used notebook to be found
errorDescription- error description if the last used notebook could not be found
Returns
true if the last used notebook was found, false otherwise

◆ findLinkedNotebook()

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.

Parameters
linkedNotebook- linked notebook to be found. Must have "remote" guid set
errorDescription- error description if linked notebook could not be found
Returns
true if linked notebook was found, false otherwise

◆ findNote()

bool quentier::LocalStorageManager::findNote ( Note note,
ErrorString errorDescription,
const bool  withResourceBinaryData = true 
) const

findNote - attempts to find note in the local storage database

Parameters
note- note to be found in the local storage database. Must have either local or "remote" Evernote service's guid set
errorDescription- error description if note could not be found
withResourceBinaryData- optional boolean parameter defining whether found note should be filled with all the contents of its attached resources. By default this parameter is true which means the whole contents of all resources would be filled. If it's false, dataBody, recognitionBody or alternateDataBody won't be present within the found note's resources
Returns
true if note was found, false otherwise

◆ findNotebook()

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.

Parameters
notebook- the notebook to be found. Must have either "remote" or local uid or name set
errorDescription- error description if the notebook could not be found
Returns
true if the notebook was found, false otherwise

◆ findNoteLocalUidsWithSearchQuery()

QStringList quentier::LocalStorageManager::findNoteLocalUidsWithSearchQuery ( const NoteSearchQuery noteSearchQuery,
ErrorString errorDescription 
) const

findNoteLocalUidsWithSearchQuery - attempt to find note local uids of notes corresponding to the passed in NoteSearchQuery object.

Parameters
noteSearchQuery- filled NoteSearchQuery object used to filter the notes
errorDescription- error description in case note local uids could not be listed

◆ findNotesWithSearchQuery()

NoteList quentier::LocalStorageManager::findNotesWithSearchQuery ( const NoteSearchQuery noteSearchQuery,
ErrorString errorDescription,
const bool  withResourceBinaryData = true 
) const

findNotesWithSearchQuery - attempt to find notes corresponding to the passed in NoteSearchQuery object.

Parameters
noteSearchQuery- filled NoteSearchQuery object used to filter the notes
errorDescription- error description in case notes could not be listed
withResourceBinaryData- optional boolean parameter defining whether found notes should be filled with all the contents of their respective attached resources. By default this parameter is true which means the whole contents of all resources would be filled. If it's false, dataBody, recognitionBody or alternateDataBody won't be present within each found note's resources
Returns
either list of notes per NoteSearchQuery or empty list in case of error or no notes presence for the given NoteSearchQuery

◆ findSavedSearch()

bool quentier::LocalStorageManager::findSavedSearch ( SavedSearch search,
ErrorString errorDescription 
) const

findSavedSearch - attempts to find SavedSearch in the local storage database

Parameters
search- SavedSearch to be found in the local storage database. If it would have "remote" Evernote service's guid set, it would be used to identify the search in the local storage database. Otherwise its local uid would be used.
errorDescription- error description if SavedSearch could not be found
Returns
true if SavedSearch was found, false otherwise

◆ findTag()

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.

Parameters
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
Returns
true if tag was found, false otherwise

◆ findUser()

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

Parameters
user- the user to be found. Must have "id" field set
errorDescription- error description if the user could not be found
Returns
true if the user was found successfully, false otherwise

◆ highestSupportedLocalStorageVersion()

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

Returns
highest supported local storage version

◆ isLocalStorageVersionTooHigh()

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 stotage, 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.

Parameters
errorDescriptionTextual 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
Returns
true if local storage version is too high for the currently run version of libquentier to work with, false otherwise

◆ linkedNotebookCount()

int quentier::LocalStorageManager::linkedNotebookCount ( ErrorString errorDescription) const

linkedNotebookCount - returns the number of linked notebooks stored in the local storage database

Parameters
errorDescription- error description if the number of linked notebooks count not be returned
Returns
either non-negative number of linked notebooks or -1 if some error has occurred

◆ listAllLinkedNotebooks()

QList<LinkedNotebook> quentier::LocalStorageManager::listAllLinkedNotebooks ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListLinkedNotebooksOrder::type  order = ListLinkedNotebooksOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending 
) const

listAllLinkedNotebooks - attempts to list all linked notebooks within the account

Parameters
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
Returns
either list of all linked notebooks or empty list in case of error or no linked notebooks presence within the account

◆ listAllNotebooks()

QList<Notebook> quentier::LocalStorageManager::listAllNotebooks ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotebooksOrder::type  order = ListNotebooksOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listAllNotebooks - attempts to list all notebooks within the current account from the local storage database

Parameters
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
Returns
either the list of all notebooks within the account or empty list in cases of error or no notebooks presence within the account

◆ listAllSavedSearches()

QList<SavedSearch> quentier::LocalStorageManager::listAllSavedSearches ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListSavedSearchesOrder::type  order = ListSavedSearchesOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending 
) const

listAllSavedSearches - lists all saved searches within the account

Parameters
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
Returns
either the list of all saved searches within the account or empty list in case of error or if there are no saved searches within the account

◆ listAllSharedNotebooks()

QList<SharedNotebook> quentier::LocalStorageManager::listAllSharedNotebooks ( ErrorString errorDescription) const

listAllSharedNotebooks - attempts to list all shared notebooks within the account

Parameters
errorDescription- error description if shared notebooks could not be listed; if no error happens, this parameter is untouched
Returns
either the list of all shared notebooks within the account or empty list in cases of error or no shared notebooks presence within the account

◆ listAllTags()

QList<Tag> quentier::LocalStorageManager::listAllTags ( ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder::type  order = ListTagsOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listAllTags - lists all tags within current user's account

Parameters
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
Returns
the list of found tags within the account

◆ listAllTagsPerNote()

QList<Tag> quentier::LocalStorageManager::listAllTagsPerNote ( const Note note,
ErrorString errorDescription,
const ListObjectsOptions &  flag = ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder::type &  order = ListTagsOrder::NoOrder,
const OrderDirection::type &  orderDirection = OrderDirection::Ascending 
) const

listAllTagsPerNote - lists all tags per given note

Parameters
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;
Returns
the list of found tags per note

◆ listLinkedNotebooks()

QList<LinkedNotebook> quentier::LocalStorageManager::listLinkedNotebooks ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListLinkedNotebooksOrder::type  order = ListLinkedNotebooksOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending 
) const

listLinkedNotebooks - attempts to list linked notebooks within the account according to the specified input flag

Parameters
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
Returns
either list of linked notebooks within the account conforming to the filter or empty list in cases of error or no linked notebooks conforming to the filter exist within the account

◆ listNotebooks()

QList<Notebook> quentier::LocalStorageManager::listNotebooks ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotebooksOrder::type  order = ListNotebooksOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listNotebooks - attempts to list notebooks within the account according to the specified input flag

Parameters
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 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
Returns
either the list of notebooks within the account conforming to the filter or empty list in cases of error or no notebooks conforming to the filter exist within the account

◆ listNotes()

QList<Note> quentier::LocalStorageManager::listNotes ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const bool  withResourceBinaryData = true,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder::type  order = ListNotesOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listNotes - attempts to list notes within the account according to the specified input flag

Parameters
flag- input parameter used to set the filter for the desired notes to be listed
errorDescription- error description if notes within the account could not be listed; if no error happens, this parameter is untouched
withResourceBinaryData- optional boolean parameter defining whether found notes should be filled with all the contents of their respective attached resources. By default this parameter is true which means the whole contents of all resources would be filled. If it's false, dataBody, recognitionBody or alternateDataBody won't be present within each found note's resources
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
Returns
either list of notes within the account conforming to the filter or empty list in cases of error or no notes conforming to the filter exist within the account

◆ listNotesPerNotebook()

QList<Note> quentier::LocalStorageManager::listNotesPerNotebook ( const Notebook notebook,
ErrorString errorDescription,
const bool  withResourceBinaryData = true,
const ListObjectsOptions &  flag = ListAll,
const size_t  limit = 0,
const size_t  offset = 0,
const ListNotesOrder::type &  order = ListNotesOrder::NoOrder,
const OrderDirection::type &  orderDirection = OrderDirection::Ascending 
) const

listNotesPerNotebook - attempts to list notes per given notebook

Parameters
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
errorDescription- error description in case notes could not be listed
withResourceBinaryData- optional boolean parameter defining whether found notes should be filled with all the contents of their respective attached resources. By default this parameter is true which means the whole contents of all resources would be filled. If it's false, dataBody, recognitionBody or alternateDataBody won't be present within each found note's resources
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;
Returns
either list of notes per notebook or empty list in case of error or no notes presence in the given notebook

◆ listNotesPerTag()

QList<Note> quentier::LocalStorageManager::listNotesPerTag ( const Tag tag,
ErrorString errorDescription,
const bool  withResourceBinaryData,
const LocalStorageManager::ListObjectsOptions &  flag,
const size_t  limit,
const size_t  offset,
const LocalStorageManager::ListNotesOrder::type &  order,
const LocalStorageManager::OrderDirection::type &  orderDirection 
) const

listNotesPerTag - attempts to list notes labeled with a given tag

Parameters
tag- tag for which the list of notes labeled with it is requested. If it has the "remote" Evernote service's guid set, it would be used to identify the tag in the local storage database, otherwise its local uid would be used
errorDescription- error description in case notes could not be listed
withResourceBinaryData- optional boolean parameter defining whether found notes should be filled with all the contents of their respective attached resources. By default this parameter is true which means the whole contents of all resources would be filled. If it's false, dataBody, recognitionBody or alternateDataBody won't be present within each found note's resources
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;
Returns
either list of notes per tag or empty list in case of error or no notes labeled with the given tag presence

◆ listSavedSearches()

QList<SavedSearch> quentier::LocalStorageManager::listSavedSearches ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListSavedSearchesOrder::type  order = ListSavedSearchesOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending 
) const

listSavedSearches - attempts to list saved searches within the account according to the specified input flag

Parameters
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
Returns
either list of saved searches within the account conforming to the filter or empty list in cases of error or no saved searches conforming to the filter exist within the account

◆ listSharedNotebooksPerNotebookGuid()

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)

Parameters
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
Returns
either the list of shared notebooks per notebook guid or empty list in case of error or no shared notebooks presence per given notebook guid

◆ listTags()

QList<Tag> quentier::LocalStorageManager::listTags ( const ListObjectsOptions  flag,
ErrorString errorDescription,
const size_t  limit = 0,
const size_t  offset = 0,
const ListTagsOrder::type &  order = ListTagsOrder::NoOrder,
const OrderDirection::type  orderDirection = OrderDirection::Ascending,
const QString &  linkedNotebookGuid = QString() 
) const

listTags - attempts to list tags within the account according to the specified input flag

Parameters
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
Returns
either list of tags within the account conforming to the filter or empty list in cases of error or no tags conforming to the filter exist within the account

◆ localStorageRequiresUpgrade()

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 stotage, 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.

Parameters
errorDescriptionTextual 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
Returns
true if local storage requires upgrade, false otherwise

◆ localStorageVersion()

qint32 quentier::LocalStorageManager::localStorageVersion ( ErrorString errorDescription)

localStorageVersion method fetches the current version of local storage persistence which can be used for informational purposes

Parameters
errorDescriptionTextual description of the error if the method was unable to determine the current version of local storage persistence
Returns
positive number indication local storage version or negative number in case of error retrieving the local storage version

◆ notebookCount()

int quentier::LocalStorageManager::notebookCount ( ErrorString errorDescription) const

notebookCount returns the number of notebooks currently stored in the local storage database

Parameters
errorDescription- error description if the number of notebooks could not be returned
Returns
either non-negative value with the number of notebooks or -1 which means some error has occurred

◆ noteCount()

int quentier::LocalStorageManager::noteCount ( ErrorString errorDescription) const

noteCount returns the number of non-deleted notes currently stored in local storage database

Parameters
errorDescription- error description if the number of notes could not be returned
Returns
either non-negative value with the number of notes or -1 which means some error occurred

◆ noteCountPerNotebook()

int quentier::LocalStorageManager::noteCountPerNotebook ( const Notebook notebook,
ErrorString errorDescription 
) const

noteCountPerNotebook returns the number of non-deleted notes currently stored in local storage database per given notebook

Parameters
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
Returns
either non-negative value with the number of notes per given notebook or -1 which means some error occurred

◆ noteCountPerTag()

int quentier::LocalStorageManager::noteCountPerTag ( const Tag tag,
ErrorString errorDescription 
) const

noteCountPerTag returns the number of non-deleted notes currently stored in local storage database labeled with given tag

Parameters
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
Returns
either non-negative value with the number of notes per given tag or -1 which means some error occurred

◆ noteCountsPerAllTags()

bool quentier::LocalStorageManager::noteCountsPerAllTags ( QHash< QString, int > &  noteCountsPerTagLocalUid,
ErrorString errorDescription 
) const

noteCountsPerAllTags returns the number of non-deleted notes currently stored in local storage database labeled with each tag stored in the local storage database

Parameters
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
Returns
true if note counts for all tags were computed successfully, false otherwise

◆ savedSearchCount()

int quentier::LocalStorageManager::savedSearchCount ( ErrorString errorDescription) const

savedSearchCount returns the number of saved seacrhes currently stored in local storage database

Parameters
errorDescription- error description if the number of saved seacrhes could not be returned
Returns
either non-negative value with the number of saved seacrhes or -1 which means some error occurred

◆ switchUser()

void quentier::LocalStorageManager::switchUser ( const Account account,
const bool  startFromScratch = false,
const bool  overrideLock = false 
)

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

Parameters
account- the account to which the local storage is to be switched
startFromScratch- optional, false by default; if true and database file for this user existed previously, it is erased before open
overrideLock- optional, false by default; if true and the database file does have the advisory lock put on it, the lock would be forcefully removed; otherwise the presence of advisory lock on the database file would cause the method to throw DatabaseLockedException

◆ tagCount()

int quentier::LocalStorageManager::tagCount ( ErrorString errorDescription) const

tagCount returns the number of non-deleted tags currently stored in local storage database

Parameters
errorDescription- error description if the number of tags could not be returned
Returns
either non-negative value with the number of tags or -1 which means some error occurred

◆ updateEnResource()

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.

Parameters
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
Returns
true if resource was updated successfully, false otherwise

◆ updateLinkedNotebook()

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.

Parameters
linkedNotebook- LinkedNotebook to be updated in the local storage database
errorDescription- error description if linked notebook could not be updated
Returns
true if linked notebook was updated successfully, false otherwise

◆ updateNote()

bool quentier::LocalStorageManager::updateNote ( Note note,
const bool  updateResources,
const bool  updateTags,
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.

Parameters
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 "updateResources" input parameter was false as well as it may not have the representative tags if "updateTags" input parameter was false
updateResources- flag indicating whether the note's resources should be updated along with the note; if not, the existing resource information stored in the local storage is not touched
updateTags- flag indicating whether the note's tags should be updated along with the note; if not, the existing tags to note linkage information is not touched
errorDescription- error description if note could not be updated
Returns
true if note was updated successfully, false otherwise

◆ updateNotebook()

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. If no notebook with such guid is found, the local uid is used to identify the notebook in the local storage database. If the notebook has no guid, the local uid is used to identify it in the local storage database.

Parameters
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
Returns
true if the notebook was updated successfully, false otherwise

◆ updateSavedSearch()

bool quentier::LocalStorageManager::updateSavedSearch ( SavedSearch search,
ErrorString errorDescription 
)

updateSavedSearch - updates passed in SavedSearch in th local storage database.

If search has "remote" Evernote service's guid set, it is identified in the database by this guid. If no saved search with such guid is found, the local uid is used to identify the saved search in the local storage database. If the saved search has no guid, the local uid is used to identify it in the local storage database.

Parameters
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
Returns
true if SavedSearch was updated successfully, false otherwise

◆ updateTag()

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 no tag with such guid is found, the local uid is used to identify the tag in the local storage database. If the tag has no guid, the local uid is used to identify it in the local storage database.

Parameters
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
Returns
true if Tag was updated successfully, false otherwise

◆ updateUser()

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

Parameters
user- the user to be updated in the local storage database
errorDescription- error description if the user could not be updated
Returns
true if the user was updated successfully, false otherwise

◆ upgradeLocalStorage()

bool quentier::LocalStorageManager::upgradeLocalStorage ( ErrorString errorDescription)

upgradeLocalStorage method performs the upgrade of local storage persistence if upgrade is required; upgradeProgress signal is emitted to inform any listeners of the progress of the upgrade

Parameters
errorDescriptionTextual description of the error if the local storage upgrade failed, otherwise this parameter is not touched by the method
Returns
true if local storage persistence was upgraded successfully, false if local storage persistence was not upgraded either due to error or due to the fact the local storage persistence doesn't require an upgrade

◆ upgradeProgress

void quentier::LocalStorageManager::upgradeProgress ( double  progress)
signal

LocalStorageManager is capable of performing the 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

Parameters
progress- the value from 0 to 1 denoting the database upgrade progress

◆ userCount()

int quentier::LocalStorageManager::userCount ( ErrorString errorDescription) const

userCount - returns the number of non-deleted users currently stored in the local storage database

Parameters
errorDescription- error description if the number of users could not be returned
Returns
either non-negative value with the number of users or -1 which means some error has occurred