| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_COPYASDATAURIOPERATION_H |
| 21 |
#define KSNIP_COPYASDATAURIOPERATION_H |
| 22 |
|
| 23 |
#include <QBuffer> |
| 24 |
#include <QImage> |
| 25 |
|
| 26 |
#include "src/gui/clipboard/IClipboard.h" |
| 27 |
#include "src/gui/INotificationService.h" |
| 28 |
#include "src/gui/operations/NotifyOperation.h" |
| 29 |
#include "src/backend/config/Config.h" |
| 30 |
|
| 31 |
class CopyAsDataUriOperation : public QObject |
| 32 |
{ |
| 33 |
Q_OBJECT |
| 34 |
public: |
| 35 |
CopyAsDataUriOperation( |
| 36 |
QImage image, |
| 37 |
const QSharedPointer<IClipboard> &clipboardService, |
| 38 |
const QSharedPointer<INotificationService> ¬ificationService, |
| 39 |
const QSharedPointer<IConfig> &config); |
| 40 |
~CopyAsDataUriOperation() override = default; |
| 41 |
bool execute(); |
| 42 |
|
| 43 |
private: |
| 44 |
QImage mImage; |
| 45 |
QSharedPointer<IClipboard> mClipboardService; |
| 46 |
QSharedPointer<INotificationService> mNotificationService; |
| 47 |
QSharedPointer<IConfig> mConfig; |
| 48 |
|
| 49 |
void notifySuccess() const; |
| 50 |
void notifyFailure() const; |
| 51 |
void notify(const QString &title, const QString &message, NotificationTypes type) const; |
| 52 |
}; |
| 53 |
|
| 54 |
#endif |