| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_HANDLEUPLOADRESULTOPERATION_H |
| 21 |
#define KSNIP_HANDLEUPLOADRESULTOPERATION_H |
| 22 |
|
| 23 |
#include <QUrl> |
| 24 |
|
| 25 |
#include "src/backend/config/IConfig.h" |
| 26 |
#include "src/backend/uploader/UploadResult.h" |
| 27 |
#include "src/gui/operations/NotifyOperation.h" |
| 28 |
#include "src/gui/clipboard/IClipboard.h" |
| 29 |
#include "src/gui/desktopService/IDesktopService.h" |
| 30 |
|
| 31 |
class HandleUploadResultOperation : public QObject |
| 32 |
{ |
| 33 |
Q_OBJECT |
| 34 |
public: |
| 35 |
explicit HandleUploadResultOperation( |
| 36 |
const UploadResult &result, |
| 37 |
const QSharedPointer<INotificationService> ¬ificationService, |
| 38 |
const QSharedPointer<IClipboard> &clipboard, |
| 39 |
const QSharedPointer<IDesktopService> &desktopService, |
| 40 |
const QSharedPointer<IConfig> &config); |
| 41 |
~HandleUploadResultOperation() override = default; |
| 42 |
bool execute(); |
| 43 |
|
| 44 |
private: |
| 45 |
UploadResult mUploadResult; |
| 46 |
QSharedPointer<INotificationService> mNotificationService; |
| 47 |
QSharedPointer<IConfig> mConfig; |
| 48 |
QSharedPointer<IClipboard> mClipboardService; |
| 49 |
QSharedPointer<IDesktopService> mDesktopService; |
| 50 |
|
| 51 |
void notifyImgurSuccessfulUpload(const QString &url) const; |
| 52 |
void handleImgurResult(); |
| 53 |
void handleScriptResult(); |
| 54 |
void handleFtpResult(); |
| 55 |
void copyToClipboard(const QString &url) const; |
| 56 |
void OpenUrl(const QString &url) const; |
| 57 |
void handleUploadError(); |
| 58 |
void notifyFtpSuccessfulUpload() const; |
| 59 |
void notifyScriptSuccessfulUpload() const; |
| 60 |
void notifyFailedUpload(const QString &message) const; |
| 61 |
}; |
| 62 |
|
| 63 |
#endif |