2017-04-24 23:14:01 +02:00
|
|
|
#ifndef CUSTOMUPLOADER_HPP
|
|
|
|
#define CUSTOMUPLOADER_HPP
|
|
|
|
|
|
|
|
#include "uploader.hpp"
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QUrl>
|
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
enum class HttpMethod { POST };
|
2017-04-24 23:14:01 +02:00
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
enum class RequestFormat { X_WWW_FORM_URLENCODED, JSON, PLAIN };
|
2017-04-24 23:14:01 +02:00
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
class CustomUploader : public Uploader {
|
2017-05-09 17:26:00 +02:00
|
|
|
public:
|
|
|
|
CustomUploader(QString absFilePath);
|
|
|
|
QString name();
|
|
|
|
QString description();
|
|
|
|
void doUpload(QPixmap *pixmap);
|
|
|
|
QString getFormatString(bool animated);
|
|
|
|
QMap<QString, QString> types;
|
2017-04-24 23:14:01 +02:00
|
|
|
|
2017-05-09 17:26:00 +02:00
|
|
|
private:
|
|
|
|
QString desc;
|
|
|
|
QString uName;
|
|
|
|
RequestFormat format = RequestFormat::JSON;
|
|
|
|
HttpMethod method = HttpMethod::POST;
|
|
|
|
QUrl target;
|
|
|
|
QJsonValue body;
|
|
|
|
QJsonObject headers;
|
|
|
|
QString returnPathspec;
|
|
|
|
QString iFormat;
|
2017-04-24 23:14:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CUSTOMUPLOADER_HPP
|