Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
login.hpp
1 //This program is free software: you can redistribute it and/or modify
2 //it under the terms of the GNU General Public License as published by
3 //the Free Software Foundation, either version 3 of the License, or
4 //(at your option) any later version.
5 
6 //This program is distributed in the hope that it will be useful,
7 //but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 //GNU General Public License for more details.
10 
11 #ifndef LOGIN_H
12 #define LOGIN_H
13 
14 #include <QDialog>
15 #include <QMessageBox>
16 #include <QThread>
17 #include <QUrl>
18 #include <QtXml>
19 #include <QTimer>
20 #include "collectable.hpp"
21 #include "core.hpp"
22 #include "oauthloginquery.hpp"
23 #include "wlquery.hpp"
24 #include "apiquery.hpp"
25 #include "configuration.hpp"
26 
27 namespace Ui
28 {
29  class Login;
30 }
31 
32 namespace Huggle
33 {
34  enum Status
35  {
36  RetrievingGlobalConfig,
37  RetrievingUserConfig,
38  RetrievingLocalConfig,
39  LoggingIn,
40  WaitingForLoginQuery,
41  Refreshing,
42  WaitingForToken,
43  LoggedIn,
44  Nothing,
45  Cancelling,
46  LoginFailed,
47  RetrievingUser,
48  LoginDone,
49  RetrievingWhitelist
50  };
51 
52  class WLQuery;
53  class ApiQuery;
54 
55  //! Window that is displayed as first when huggle is started
56  class Login : public QDialog
57  {
58  Q_OBJECT
59 
60  public:
61  explicit Login(QWidget *parent = 0);
62  ~Login();
63  /// \todo DOCUMENT ME
64  Status _Status;
65  /// \todo DOCUMENT ME
66  void Progress(const int progress);
67  /// \todo DOCUMENT ME
68  void Localize();
69 
70  private slots:
71  void on_ButtonOK_clicked();
72  void on_ButtonExit_clicked();
73  void on_Time();
74  void on_pushButton_clicked();
75  void on_Language_currentIndexChanged(const QString &arg1);
76 
77  private:
78  Ui::Login *ui;
79  QTimer *timer;
80  /// \todo DOCUMENT ME
82  ApiQuery *LoginQuery;
83  //! The token obtained from login
84  QString Token;
85  /// \todo DOCUMENT ME
86  static QString Test;
87  //! Reset the interface to default
88  void Reset();
89  //! Enable parts of interface
90  void Enable();
91  void Reload();
92  void DB();
93  //! Cancel currently running login attempt
94  void CancelLogin();
95  void Disable();
96  void PressOK();
97  void PerformLogin();
98  void FinishLogin();
99  void FinishToken();
100  void RetrieveWhitelist();
101  void RetrieveLocalConfig();
102  void RetrieveGlobalConfig();
103  void RetrievePrivateConfig();
104  void RetrieveUserInfo();
105  void DeveloperMode();
106  void DisplayError(QString message);
107  void Finish();
108  void reject();
109  //! This function make sure that login result is done
110  bool ProcessOutput();
111  QString GetToken();
112  };
113 }
114 
115 #endif // LOGIN_H
WLQuery * wq
Definition: login.hpp:81
void Progress(const int progress)
Definition: login.cpp:56
Status _Status
Definition: login.hpp:64
Whitelist query :o.
Definition: wlquery.hpp:23
QString GetToken()
Definition: login.cpp:656
void Localize()
Definition: login.cpp:61
Window that is displayed as first when huggle is started.
Definition: login.hpp:56
void RetrieveGlobalConfig()
Definition: login.cpp:239
void CancelLogin()
Cancel currently running login attempt.
Definition: login.cpp:79
void Reset()
Reset the interface to default.
Definition: login.cpp:74
void Enable()
Enable parts of interface.
Definition: login.cpp:89
void RetrieveLocalConfig()
Definition: login.cpp:372
void PressOK()
Definition: login.cpp:160
void RetrievePrivateConfig()
Definition: login.cpp:439
bool ProcessOutput()
This function make sure that login result is done.
Definition: login.cpp:604
static QString Test
Definition: login.hpp:86
QString Token
The token obtained from login.
Definition: login.hpp:84
This class can be used to execute any kind of api query on any wiki.
Definition: apiquery.hpp:55
void RetrieveUserInfo()
Definition: login.cpp:509