123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef INTRABOCAL_H
- #define INTRABOCAL_H
-
- #include <QObject>
- #include <QNetworkAccessManager>
- #include <QNetworkRequest>
- #include <QNetworkReply>
- #include <QSslError>
- #include <QHttpMultiPart>
- #include <QNetworkCookie>
- #include <QDebug>
- #include "epimafia_global.h"
-
- typedef QPair<QString, QString> City;
-
- class EPIMAFIASHARED_EXPORT IntraBocal : public QObject
- {
- Q_OBJECT
- public:
- enum Error
- {
- BadLogin,
- SslError,
- NetworkError,
- ParseError
- };
-
- explicit IntraBocal(QObject *parent = 0);
-
- static QList<City>getCities();
-
- signals:
- void error(IntraBocal::Error);
- void logged();
- void searchFinished(QList<QList<QString> >);
-
- public slots:
- void login(QString user, QString pass);
- void searchUser(QString lastName, QString firstName, QString login, QString promo = QString(), QString school = QString(), QString city = QString());
-
- private slots:
- void loginError(QNetworkReply::NetworkError e);
- void loginFinished();
- void loginSslError(QList<QSslError>);
-
- void searchError(QNetworkReply::NetworkError);
- void searchFinished();
- void searchSslError(QList<QSslError>);
-
- private:
- QNetworkAccessManager* m_mgr;
- QNetworkCookie m_phpSessId;
- void addPart(QHttpMultiPart* data, QString name, QString body);
-
- };
-
- #endif // INTRABOCAL_H
|