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-06-04 22:58:29 +02:00
|
|
|
public:
|
2017-05-09 17:26:00 +02:00
|
|
|
CustomUploader(QString absFilePath);
|
|
|
|
QString name();
|
|
|
|
QString description();
|
2017-06-04 22:58:29 +02:00
|
|
|
std::tuple<QString, QString> format();
|
|
|
|
void doUpload(QByteArray imgData);
|
2017-05-09 17:26:00 +02:00
|
|
|
QString getFormatString(bool animated);
|
|
|
|
QMap<QString, QString> types;
|
2017-04-24 23:14:01 +02:00
|
|
|
|
2017-06-04 22:58:29 +02:00
|
|
|
private:
|
2017-05-21 11:16:00 +02:00
|
|
|
double limit = -1;
|
2017-05-09 17:26:00 +02:00
|
|
|
QString desc;
|
|
|
|
QString uName;
|
2017-06-04 22:58:29 +02:00
|
|
|
RequestFormat rFormat = RequestFormat::JSON;
|
2017-05-09 17:26:00 +02:00
|
|
|
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
|