| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_LOADIMAGEFROMFILEOPERATION_H |
| 21 |
#define KSNIP_LOADIMAGEFROMFILEOPERATION_H |
| 22 |
|
| 23 |
#include <QObject> |
| 24 |
|
| 25 |
#include "src/gui/INotificationService.h" |
| 26 |
#include "src/gui/IImageProcessor.h" |
| 27 |
#include "src/gui/operations/NotifyOperation.h" |
| 28 |
#include "src/gui/fileService/IFileService.h" |
| 29 |
#include "src/backend/recentImages/IRecentImageService.h" |
| 30 |
#include "src/common/dtos/CaptureFromFileDto.h" |
| 31 |
|
| 32 |
class LoadImageFromFileOperation : public QObject |
| 33 |
{ |
| 34 |
Q_OBJECT |
| 35 |
public: |
| 36 |
LoadImageFromFileOperation( |
| 37 |
const QString &path, |
| 38 |
IImageProcessor *imageProcessor, |
| 39 |
const QSharedPointer<INotificationService> ¬ificationService, |
| 40 |
const QSharedPointer<IRecentImageService> &recentImageService, |
| 41 |
const QSharedPointer<IFileService> &fileService, |
| 42 |
const QSharedPointer<IConfig> &config); |
| 43 |
~LoadImageFromFileOperation() override = default; |
| 44 |
bool execute(); |
| 45 |
|
| 46 |
private: |
| 47 |
QString mPath; |
| 48 |
IImageProcessor *mImageProcessor; |
| 49 |
QSharedPointer<INotificationService> mNotificationService; |
| 50 |
QSharedPointer<IRecentImageService> mRecentImageService; |
| 51 |
QSharedPointer<IFileService> mFileService; |
| 52 |
QSharedPointer<IConfig> mConfig; |
| 53 |
|
| 54 |
void notifyAboutInvalidPath() const; |
| 55 |
}; |
| 56 |
|
| 57 |
#endif |