2018-07-07 13:08:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/NetworkCommon.hpp"
|
|
|
|
|
|
|
|
#include <QNetworkRequest>
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
class QNetworkReply;
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class NetworkResult;
|
|
|
|
|
|
|
|
struct NetworkData {
|
2018-07-16 17:23:41 +02:00
|
|
|
NetworkData();
|
|
|
|
~NetworkData();
|
|
|
|
|
2018-07-07 13:08:57 +02:00
|
|
|
QNetworkRequest request_;
|
|
|
|
const QObject *caller_ = nullptr;
|
|
|
|
bool useQuickLoadCache_{};
|
|
|
|
|
|
|
|
NetworkReplyCreatedCallback onReplyCreated_;
|
|
|
|
NetworkErrorCallback onError_;
|
|
|
|
NetworkSuccessCallback onSuccess_;
|
|
|
|
|
|
|
|
NetworkRequestType requestType_ = NetworkRequestType::Get;
|
|
|
|
|
|
|
|
QByteArray payload_;
|
|
|
|
|
|
|
|
QString getHash();
|
|
|
|
|
|
|
|
void writeToCache(const QByteArray &bytes);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString hash_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|