| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_UPLOADOPERATION_H |
| 21 |
#define KSNIP_UPLOADOPERATION_H |
| 22 |
|
| 23 |
#include <QCoreApplication> |
| 24 |
#include <QImage> |
| 25 |
#include <QSharedPointer> |
| 26 |
|
| 27 |
#include <utility> |
| 28 |
|
| 29 |
#include "src/backend/uploader/IUploader.h" |
| 30 |
#include "src/backend/config/IConfig.h" |
| 31 |
#include "src/gui/messageBoxService/IMessageBoxService.h" |
| 32 |
#include "src/common/helper/PathHelper.h" |
| 33 |
|
| 34 |
class UploadOperation : public QObject |
| 35 |
{ |
| 36 |
Q_OBJECT |
| 37 |
public: |
| 38 |
UploadOperation( |
| 39 |
QImage image, |
| 40 |
const QSharedPointer<IUploader> &uploader, |
| 41 |
const QSharedPointer<IConfig> &config, |
| 42 |
const QSharedPointer<IMessageBoxService> &messageBoxService); |
| 43 |
~UploadOperation() override = default; |
| 44 |
bool execute(); |
| 45 |
|
| 46 |
private: |
| 47 |
QImage mImage; |
| 48 |
QSharedPointer<IConfig> mConfig; |
| 49 |
QSharedPointer<IUploader> mUploader; |
| 50 |
QSharedPointer<IMessageBoxService> mMessageBoxService; |
| 51 |
|
| 52 |
bool proceedWithUpload() const; |
| 53 |
bool askIfCanProceedWithUpload() const; |
| 54 |
}; |
| 55 |
|
| 56 |
#endif |