libquentier  0.5.0
The library for rich desktop clients of Evernote service
IUserStore.h
1 /*
2  * Copyright 2018-2020 Dmitry Ivanov
3  *
4  * This file is part of libquentier
5  *
6  * libquentier is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, version 3 of the License.
9  *
10  * libquentier is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef LIB_QUENTIER_SYNCHRONIZATION_I_USER_STORE_H
20 #define LIB_QUENTIER_SYNCHRONIZATION_I_USER_STORE_H
21 
22 #include <quentier/synchronization/ForwardDeclarations.h>
23 #include <quentier/types/ErrorString.h>
24 #include <quentier/utility/Linkage.h>
25 
26 #include <QList>
27 #include <QNetworkCookie>
28 
29 #include <qt5qevercloud/QEverCloud.h>
30 
31 #include <memory>
32 
33 namespace quentier {
34 
35 QT_FORWARD_DECLARE_CLASS(User)
36 
37 
42 class QUENTIER_EXPORT IUserStore
43 {
44 public:
45  virtual ~IUserStore() = default;
46 
50  virtual void setAuthData(
51  QString authenticationToken, QList<QNetworkCookie> cookies) = 0;
52 
71  virtual bool checkVersion(
72  const QString & clientName, qint16 edamVersionMajor,
73  qint16 edamVersionMinor, ErrorString & errorDescription) = 0;
74 
93  virtual qint32 getUser(
94  User & user, ErrorString & errorDescription,
95  qint32 & rateLimitSeconds) = 0;
96 
117  virtual qint32 getAccountLimits(
118  const qevercloud::ServiceLevel serviceLevel,
119  qevercloud::AccountLimits & limits, ErrorString & errorDescription,
120  qint32 & rateLimitSeconds) = 0;
121 };
122 
123 QUENTIER_EXPORT IUserStorePtr newUserStore(QString evernoteHost);
124 
125 } // namespace quentier
126 
127 #endif // LIB_QUENTIER_SYNCHRONIZATION_I_USER_STORE_H
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:44
IUserStore is the interface which provides methods required for the implementation of UserStore part ...
Definition: IUserStore.h:43
virtual bool checkVersion(const QString &clientName, qint16 edamVersionMajor, qint16 edamVersionMinor, ErrorString &errorDescription)=0
virtual qint32 getAccountLimits(const qevercloud::ServiceLevel serviceLevel, qevercloud::AccountLimits &limits, ErrorString &errorDescription, qint32 &rateLimitSeconds)=0
virtual qint32 getUser(User &user, ErrorString &errorDescription, qint32 &rateLimitSeconds)=0
virtual void setAuthData(QString authenticationToken, QList< QNetworkCookie > cookies)=0
Definition: User.h:34