| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_NOTIFYOPERATION_H |
| 21 |
#define KSNIP_NOTIFYOPERATION_H |
| 22 |
|
| 23 |
#include "src/gui/TrayIcon.h" |
| 24 |
#include "src/backend/config/IConfig.h" |
| 25 |
#include "src/common/enum/NotificationTypes.h" |
| 26 |
|
| 27 |
class NotifyOperation |
| 28 |
{ |
| 29 |
public: |
| 30 |
NotifyOperation( |
| 31 |
const QString &title, |
| 32 |
const QString &message, |
| 33 |
const QString &contentUrl, |
| 34 |
NotificationTypes notificationType, |
| 35 |
const QSharedPointer<INotificationService> ¬ificationService, |
| 36 |
const QSharedPointer<IConfig> &config); |
| 37 |
NotifyOperation( |
| 38 |
const QString &title, |
| 39 |
const QString &message, |
| 40 |
NotificationTypes notificationType, |
| 41 |
const QSharedPointer<INotificationService> ¬ificationService, |
| 42 |
const QSharedPointer<IConfig> &config); |
| 43 |
~NotifyOperation() = default; |
| 44 |
bool execute(); |
| 45 |
|
| 46 |
private: |
| 47 |
QSharedPointer<INotificationService> mNotificationService; |
| 48 |
QString mTitle; |
| 49 |
QString mMessage; |
| 50 |
QString mContentUrl; |
| 51 |
NotificationTypes mNotificationType; |
| 52 |
QSharedPointer<IConfig> mConfig; |
| 53 |
|
| 54 |
void notifyViaToastMessage() const; |
| 55 |
void notifyViaConsoleMessage() const; |
| 56 |
}; |
| 57 |
|
| 58 |
#endif |