IUserStore is the interface for UserStore used by SynchronizationManager: it provides signatures of methods required for the implementation of Evernote EDAM sync protocol.
More...
#include <IUserStore.h>
|
qevercloud::IUserStorePtr | getQecUserStore () const |
|
void | setQecUserStore (const qevercloud::IUserStorePtr &pQecUserStore) |
|
QString | authenticationToken () const |
|
void | setAuthenticationToken (const QString &authToken) |
|
QList< QNetworkCookie > | cookies () const |
|
void | setCookies (QList< QNetworkCookie > cookies) |
|
virtual IUserStore * | create (const QString &host) const =0 |
|
virtual bool | checkVersion (const QString &clientName, qint16 edamVersionMajor, qint16 edamVersionMinor, ErrorString &errorDescription)=0 |
|
virtual qint32 | getUser (User &user, ErrorString &errorDescription, qint32 &rateLimitSeconds)=0 |
|
virtual qint32 | getAccountLimits (const qevercloud::ServiceLevel serviceLevel, qevercloud::AccountLimits &limits, ErrorString &errorDescription, qint32 &rateLimitSeconds)=0 |
|
|
| IUserStore (const qevercloud::IUserStorePtr &pQecUserStore) |
|
|
qevercloud::IUserStorePtr | m_pQecUserStore |
|
QString | m_authenticationToken |
|
QList< QNetworkCookie > | m_cookies |
|
IUserStore is the interface for UserStore used by SynchronizationManager: it provides signatures of methods required for the implementation of Evernote EDAM sync protocol.
By default SynchronizationManager within libquentier uses its own private implementation of IUSerStore interface but another implementation can be injected at SynchronizationManager construction time. For one thing, such injection is used for testing of libquentier's synchronization logic, for other things, it can be used to implement custom synchronization with some alternative backends.
◆ checkVersion()
virtual bool quentier::IUserStore::checkVersion |
( |
const QString & |
clientName, |
|
|
qint16 |
edamVersionMajor, |
|
|
qint16 |
edamVersionMinor, |
|
|
ErrorString & |
errorDescription |
|
) |
| |
|
pure virtual |
Check the version of EDAM protocol
- Parameters
-
clientName | Application name + application version + platform name string |
edamVersionMajor | The major version of EDAM protocol the application wants to use to connect to Evernote |
edamVersionMinor | The minor version of EDAM protocol the application wants to use to connect to Evernote |
errorDescription | The textual description of the error if the supplied protocol version cannot be used to connect to Evernote |
- Returns
- True if protocol check was successful i.e. the service can talk to the client using the supplied protocol version, false otherwise
◆ create()
virtual IUserStore* quentier::IUserStore::create |
( |
const QString & |
host | ) |
const |
|
pure virtual |
Factory method, create a new IUserStore subclass object
◆ getAccountLimits()
virtual qint32 quentier::IUserStore::getAccountLimits |
( |
const qevercloud::ServiceLevel |
serviceLevel, |
|
|
qevercloud::AccountLimits & |
limits, |
|
|
ErrorString & |
errorDescription, |
|
|
qint32 & |
rateLimitSeconds |
|
) |
| |
|
pure virtual |
Retrieve account limits corresponding to certain provided service level
- Parameters
-
serviceLevel | The level of Evernote service for which account limits are requested |
limits | Output account limits |
errorDescription | The textual description of the error if account limits could not be retrieved |
rateLimitSeconds | Output parameter, the number of seconds the client needs to wait before attempting to call this method or any other method calling Evernote API again; only meaningful if returned value matches qevercloud::EDAMErrorCode::RATE_LIMIT_REACHED |
- Returns
- Error code, 0 in case of successful retrieval of account limits for the given service level, other values corresponding to qevercoud::EDAMErrorCode::type enumeration instead
◆ getUser()
virtual qint32 quentier::IUserStore::getUser |
( |
User & |
user, |
|
|
ErrorString & |
errorDescription, |
|
|
qint32 & |
rateLimitSeconds |
|
) |
| |
|
pure virtual |
Retrieve full information about user (account)
- Parameters
-
user | Input and output parameter; on input needs to have user id set |
errorDescription | The textual description of the error if full user information could not be retrieved |
rateLimitSeconds | Output parameter, the number of seconds the client needs to wait before attempting to call this method or any other method calling Evernote API again; only meaningful if returned value matches qevercloud::EDAMErrorCode::RATE_LIMIT_REACHED |
- Returns
- Error code, 0 in case of successful retrieval of full user information, other values corresponding to qevercloud::EDAMErrorCode enumeration instead