diff options
Diffstat (limited to 'logic/net/ScreenshotUploader.h')
-rw-r--r-- | logic/net/ScreenshotUploader.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/logic/net/ScreenshotUploader.h b/logic/net/ScreenshotUploader.h new file mode 100644 index 00000000..09e58677 --- /dev/null +++ b/logic/net/ScreenshotUploader.h @@ -0,0 +1,52 @@ +#pragma once +#include "NetAction.h" + +class ScreenShot; +typedef std::shared_ptr<class ScreenShotUpload> ScreenShotUploadPtr; +typedef std::shared_ptr<class ScreenShotGet> ScreenShotGetPtr; +class ScreenShotUpload : public NetAction +{ +public: + explicit ScreenShotUpload(ScreenShot *shot); + static ScreenShotUploadPtr make(ScreenShot *shot) + { + return ScreenShotUploadPtr(new ScreenShotUpload(shot)); + } + +protected +slots: + virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); + virtual void downloadError(QNetworkReply::NetworkError error); + virtual void downloadFinished(); + virtual void downloadReadyRead(); + +public +slots: + virtual void start(); + +private: + ScreenShot *m_shot; +}; +class ScreenShotGet : public NetAction +{ +public: + explicit ScreenShotGet(ScreenShot *shot); + static ScreenShotGetPtr make(ScreenShot *shot) + { + return ScreenShotGetPtr(new ScreenShotGet(shot)); + } + +protected +slots: + virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); + virtual void downloadError(QNetworkReply::NetworkError error); + virtual void downloadFinished(); + virtual void downloadReadyRead(); + +public +slots: + virtual void start(); + +private: + ScreenShot *m_shot; +}; |