libquentier  0.5.0
The library for rich desktop clients of Evernote service
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
quentier::IUserStore Class Referenceabstract

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>

Public Member Functions

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 IUserStorecreate (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
 

Protected Member Functions

 IUserStore (const qevercloud::IUserStorePtr &pQecUserStore)
 

Protected Attributes

qevercloud::IUserStorePtr m_pQecUserStore
 
QString m_authenticationToken
 
QList< QNetworkCookie > m_cookies
 

Detailed Description

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.

Member Function Documentation

◆ checkVersion()

virtual bool quentier::IUserStore::checkVersion ( const QString &  clientName,
qint16  edamVersionMajor,
qint16  edamVersionMinor,
ErrorString errorDescription 
)
pure virtual

Check the version of EDAM protocol

Parameters
clientNameApplication name + application version + platform name string
edamVersionMajorThe major version of EDAM protocol the application wants to use to connect to Evernote
edamVersionMinorThe minor version of EDAM protocol the application wants to use to connect to Evernote
errorDescriptionThe 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
serviceLevelThe level of Evernote service for which account limits are requested
limitsOutput account limits
errorDescriptionThe textual description of the error if account limits could not be retrieved
rateLimitSecondsOutput 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
userInput and output parameter; on input needs to have user id set
errorDescriptionThe textual description of the error if full user information could not be retrieved
rateLimitSecondsOutput 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