| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef GMAILACCOUNTDETAILS_H |
| 4 | #define GMAILACCOUNTDETAILS_H |
| 5 | |
| 6 | #include "ui_gmailaccountdetails.h" |
| 7 | |
| 8 | #include <QNetworkProxy> |
| 9 | #include <QWidget> |
| 10 | |
| 11 | class OAuth2Service; |
| 12 | |
| 13 | class GmailAccountDetails : public QWidget { |
| 14 | Q_OBJECT |
| 15 | |
| 16 | friend class FormEditGmailAccount; |
| 17 | |
| 18 | public: |
| 19 | explicit GmailAccountDetails(QWidget* parent = nullptr); |
| 20 | |
| 21 | public slots: |
| 22 | void testSetup(const QNetworkProxy& custom_proxy); |
| 23 | |
| 24 | private slots: |
| 25 | void registerApi(); |
| 26 | void checkOAuthValue(const QString& value); |
| 27 | void checkUsername(const QString& username); |
| 28 | void onAuthFailed(); |
| 29 | void onAuthError(const QString& error, const QString& detailed_description); |
| 30 | void onAuthGranted(); |
| 31 | |
| 32 | private: |
| 33 | void hookNetwork(); |
| 34 | |
| 35 | private: |
| 36 | Ui::GmailAccountDetails m_ui; |
| 37 | |
| 38 | // Pointer to live OAuth. |
| 39 | OAuth2Service* m_oauth; |
| 40 | QNetworkProxy m_lastProxy; |
| 41 | }; |
| 42 | |
| 43 | #endif // GMAILACCOUNTDETAILS_H |