Kgapi

account.h
1 /*
2  SPDX-FileCopyrightText: 2012-2018 Daniel Vrátil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #ifndef LIBKGAPI2_ACCOUNT_H
8 #define LIBKGAPI2_ACCOUNT_H
9 
10 #include <QString>
11 #include <QUrl>
12 #include <QMetaType>
13 #include <QSharedPointer>
14 
15 #include "kgapicore_export.h"
16 #include "types.h"
17 
18 namespace KGAPI2
19 {
20 
40 class KGAPICORE_EXPORT Account
41 {
42 
43  public:
47  Account();
48 
57  explicit Account(const QString &account, const QString &accessToken = QString(),
58  const QString &refreshToken = QString(),
59  const QList< QUrl > &scopes = QList< QUrl >());
60 
64  Account(const Account &other);
65 
69  virtual ~Account();
70 
71 
72  bool operator==(const Account &other) const;
73 
77  QString accountName() const;
78 
84  void setAccountName(const QString &accountName);
85 
89  QString accessToken() const;
90 
96  void setAccessToken(const QString &accessToken);
97 
101  QString refreshToken() const;
102 
108  void setRefreshToken(const QString &refreshToken);
109 
113  QList< QUrl > scopes() const;
114 
125  void setScopes(const QList< QUrl > &scopes);
126 
133  void addScope(const QUrl &scope);
134 
141  void removeScope(const QUrl &scope);
142 
147  QDateTime expireDateTime() const;
148 
153  void setExpireDateTime(const QDateTime &expire);
154 
158  static QUrl accountInfoScopeUrl();
159 
163  static QUrl accountInfoEmailScopeUrl();
164 
168  static QUrl calendarScopeUrl();
169 
173  static QUrl tasksScopeUrl();
174 
178  static QUrl contactsScopeUrl();
179 
183  static QUrl latitudeScopeUrl();
184 
188  static QUrl bloggerScopeUrl();
189 
193  static QUrl mailScopeUrl();
194 
198  static QUrl driveScopeUrl();
199 private:
200  class Private;
201  Private * const d;
202 
215  bool m_scopesChanged; //krazy:exclude=dpointer
216 
217  friend class AuthJob;
218 
219 };
220 
221 } // namespace KGAPI2
222 
223 Q_DECLARE_METATYPE(KGAPI2::AccountPtr)
224 
225 #endif // LIBKGAPI2_ACCOUNT_H
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:16
A Google account.
Definition: account.h:40
A job to authenticate against Google and fetch tokens.
Definition: authjob.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 23:10:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.