libquentier  0.5.0
The library for rich desktop clients of Evernote service
IUserStore.h
1 /*
2  * Copyright 2018-2019 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_PRIVATE_SYNCHRONIZATION_I_USER_STORE_H
20 #define LIB_QUENTIER_PRIVATE_SYNCHRONIZATION_I_USER_STORE_H
21 
22 #include <quentier/types/ErrorString.h>
23 #include <quentier/utility/Linkage.h>
24 
25 #include <QList>
26 #include <QNetworkCookie>
27 #include <QSharedPointer>
28 
29 #include <qt5qevercloud/QEverCloud.h>
30 
31 namespace quentier {
32 
33 QT_FORWARD_DECLARE_CLASS(User)
34 
35 
47 class QUENTIER_EXPORT IUserStore
48 {
49 protected:
50  IUserStore(const qevercloud::IUserStorePtr & pQecUserStore);
51 
52 public:
53  virtual ~IUserStore() {}
54 
55  qevercloud::IUserStorePtr getQecUserStore() const;
56  void setQecUserStore(const qevercloud::IUserStorePtr & pQecUserStore);
57 
58  QString authenticationToken() const;
59  void setAuthenticationToken(const QString & authToken);
60 
61  QList<QNetworkCookie> cookies() const;
62  void setCookies(QList<QNetworkCookie> cookies);
63 
67  virtual IUserStore * create(const QString & host) const = 0;
68 
84  virtual bool checkVersion(const QString & clientName,
85  qint16 edamVersionMajor,
86  qint16 edamVersionMinor,
87  ErrorString & errorDescription) = 0;
88 
106  virtual qint32 getUser(User & user,
107  ErrorString & errorDescription,
108  qint32 & rateLimitSeconds) = 0;
109 
128  virtual qint32 getAccountLimits(const qevercloud::ServiceLevel serviceLevel,
129  qevercloud::AccountLimits & limits,
130  ErrorString & errorDescription,
131  qint32 & rateLimitSeconds) = 0;
132 
133 protected:
134  qevercloud::IUserStorePtr m_pQecUserStore;
135  QString m_authenticationToken;
136  QList<QNetworkCookie> m_cookies;
137 };
138 
139 } // namespace quentier
140 
141 #endif // LIB_QUENTIER_PRIVATE_SYNCHRONIZATION_I_USER_STORE_H
The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
Definition: User.h:33
IUserStore is the interface for UserStore used by SynchronizationManager: it provides signatures of m...
Definition: IUserStore.h:47