You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

intrabocal.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef INTRABOCAL_H
  2. #define INTRABOCAL_H
  3. #include <QObject>
  4. #include <QNetworkAccessManager>
  5. #include <QNetworkRequest>
  6. #include <QNetworkReply>
  7. #include <QSslError>
  8. #include <QHttpMultiPart>
  9. #include <QNetworkCookie>
  10. #include <QDebug>
  11. #include "epimafia_global.h"
  12. typedef QPair<QString, QString> City;
  13. class EPIMAFIASHARED_EXPORT IntraBocal : public QObject
  14. {
  15. Q_OBJECT
  16. public:
  17. enum Error
  18. {
  19. BadLogin,
  20. SslError,
  21. NetworkError,
  22. ParseError
  23. };
  24. explicit IntraBocal(QObject *parent = 0);
  25. static QList<City>getCities();
  26. signals:
  27. void error(IntraBocal::Error);
  28. void logged();
  29. void searchFinished(QList<QList<QString> >);
  30. public slots:
  31. void login(QString user, QString pass);
  32. void searchUser(QString lastName, QString firstName, QString login, QString promo = QString(), QString school = QString(), QString city = QString());
  33. private slots:
  34. void loginError(QNetworkReply::NetworkError);
  35. void loginFinished();
  36. void loginSslError(QList<QSslError>);
  37. void searchError(QNetworkReply::NetworkError);
  38. void searchFinished();
  39. void searchSslError(QList<QSslError>);
  40. private:
  41. QNetworkAccessManager* m_mgr;
  42. QNetworkCookie m_phpSessId;
  43. void addPart(QHttpMultiPart* data, QString name, QString body);
  44. };
  45. #endif // INTRABOCAL_H