jce-manager/src/jce/jcelogin.h

60 lines
1.1 KiB
C
Raw Normal View History

2014-06-18 23:44:46 +00:00
#ifndef JCELOGIN_H
#define JCELOGIN_H
#include <string>
#include <fstream>
2014-06-26 15:15:04 +00:00
#include "../connection/jcesslclient.h"
2014-06-18 23:44:46 +00:00
#include "../user.h"
#include "jceLoginHtmlScripts.h"
class jceLogin
{
public:
enum jceStatus {
JCE_NOT_CONNECTED,
ERROR_ON_VALIDATION,
ERROR_ON_VALIDATION_USER_BLOCKED,
ERROR_ON_OPEN_SOCKET,
ERROR_ON_SEND_REQUEST,
2014-06-18 23:44:46 +00:00
ERROR_ON_GETTING_INFO,
ERROR_ON_GETTING_GRADES,
2014-06-18 23:44:46 +00:00
JCE_START_VALIDATING_PROGRESS,
JCE_VALIDATION_PASSED,
2014-06-18 23:44:46 +00:00
JCE_YOU_ARE_IN,
JCE_GRADE_PAGE_PASSED
};
jceLogin(user* username);
~jceLogin();
void makeConnection() throw (jceStatus);
bool checkConnection();
void reConnect() throw (jceStatus);
void closeAll();
int getGrades();
bool isLoginFlag() const;
std::string getPage();
2014-06-20 17:13:21 +00:00
2014-06-18 23:44:46 +00:00
private:
int makeFirstVisit();
bool checkValidation();
int makeSecondVisit();
void setLoginFlag(bool x);
bool loginFlag;
std::string * recieverPage;
user * jceA;
2014-06-26 15:15:04 +00:00
jceSSLClient * JceConnector;
2014-06-18 23:44:46 +00:00
};
#endif // JCELOGIN_H