2014-09-08 15:54:52 +00:00
|
|
|
#ifndef LOGINHANDLER_H
|
|
|
|
#define LOGINHANDLER_H
|
2014-09-11 03:24:52 +00:00
|
|
|
#include <QObject>
|
2014-09-08 15:54:52 +00:00
|
|
|
#include <QString>
|
|
|
|
#include <QTextEdit>
|
2014-09-22 02:04:38 +00:00
|
|
|
#include <QLabel>
|
2014-09-08 15:54:52 +00:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QPixmap>
|
2014-09-22 02:04:38 +00:00
|
|
|
#include <QStatusBar>
|
2014-10-04 00:54:27 +00:00
|
|
|
#include <QProgressBar>
|
2014-09-22 02:04:38 +00:00
|
|
|
#include <QPushButton>
|
2014-09-08 15:54:52 +00:00
|
|
|
|
|
|
|
#include "./src/jceSettings/jcelogin.h"
|
|
|
|
#include "./src/appDatabase/savedata.h"
|
|
|
|
|
|
|
|
|
2014-09-22 02:04:38 +00:00
|
|
|
class loginHandler : public QObject
|
2014-09-08 15:54:52 +00:00
|
|
|
{
|
2014-09-22 02:04:38 +00:00
|
|
|
Q_OBJECT
|
2014-09-08 15:54:52 +00:00
|
|
|
public:
|
2014-10-04 00:54:27 +00:00
|
|
|
loginHandler(user *ptr, QStatusBar *statusBarPtr, QPushButton *loginButtonPtr, QProgressBar *progressbarPtr);
|
2014-09-22 02:04:38 +00:00
|
|
|
~loginHandler()
|
|
|
|
{
|
|
|
|
delete iconButtomStatusLabel;
|
|
|
|
delete jceLog;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool login(QString username,QString password);
|
|
|
|
void logout();
|
|
|
|
void setIconConnectionStatus(jceLogin::jceStatus statusDescription);
|
|
|
|
|
2014-09-08 15:54:52 +00:00
|
|
|
bool makeConnection();
|
2014-09-22 02:04:38 +00:00
|
|
|
|
2014-09-08 15:54:52 +00:00
|
|
|
bool isLoggedInFlag();
|
|
|
|
void setLoginFlag(bool flag);
|
|
|
|
QString getCurrentPageContect();
|
|
|
|
|
|
|
|
int makeGradeRequest(int fromYear, int toYear, int fromSemester, int toSemester);
|
|
|
|
int makeCalendarRequest(int year,int semester);
|
|
|
|
|
2014-09-22 02:04:38 +00:00
|
|
|
private slots:
|
|
|
|
void readyAfterConnectionLost();
|
2014-09-08 15:54:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void popMessage(QString message, bool addInfo = true);
|
|
|
|
|
|
|
|
bool logggedInFlag;
|
2014-09-22 02:04:38 +00:00
|
|
|
jceLogin * jceLog;
|
|
|
|
user * userPtr;
|
2014-09-08 15:54:52 +00:00
|
|
|
|
2014-09-22 02:04:38 +00:00
|
|
|
QStatusBar *statusBar;
|
|
|
|
QLabel *iconButtomStatusLabel;
|
|
|
|
QPushButton *loginButtonPtr;
|
2014-10-04 00:54:27 +00:00
|
|
|
QProgressBar *progressBar;
|
2014-09-08 15:54:52 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LOGINHANDLER_H
|