File indexing completed on 2024-04-28 15:29:09
0001 /* 0002 This file is part of the KDE Frameworks 0003 SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef KNOTIFICATIONJOBUIDELEGATE_H 0009 #define KNOTIFICATIONJOBUIDELEGATE_H 0010 0011 #include <KJobUiDelegate> 0012 0013 #include <QScopedPointer> 0014 0015 #include <knotifications_export.h> 0016 0017 class KNotificationJobUiDelegatePrivate; 0018 0019 /** 0020 * @class KNotificationJobUiDelegate knotificationjobuidelegate.h KNotificationJobUiDelegate 0021 * 0022 * A UI delegate using KNotification for interaction (showing errors and warnings). 0023 * 0024 * @since 5.69 0025 */ 0026 class KNOTIFICATIONS_EXPORT KNotificationJobUiDelegate : public KJobUiDelegate 0027 { 0028 Q_OBJECT 0029 0030 public: 0031 /** 0032 * Constructs a new KNotificationJobUiDelegate. 0033 */ 0034 KNotificationJobUiDelegate(); 0035 0036 /** 0037 * Constructs a new KNotificationJobUiDelegate. 0038 * @param flags allows to enable automatic error/warning handling 0039 * @since 5.70 0040 */ 0041 explicit KNotificationJobUiDelegate(KJobUiDelegate::Flags flags); // KF6 TODO merge with default constructor, using AutoHandlingDisabled as default value 0042 0043 /** 0044 * Destroys the KNotificationJobUiDelegate. 0045 */ 0046 ~KNotificationJobUiDelegate() override; 0047 0048 public: 0049 /** 0050 * Display a notification to inform the user of the error given by 0051 * this job. 0052 */ 0053 void showErrorMessage() override; 0054 0055 protected Q_SLOTS: 0056 bool setJob(KJob *job) override; 0057 void slotWarning(KJob *job, const QString &plain, const QString &rich) override; 0058 0059 private: 0060 QScopedPointer<KNotificationJobUiDelegatePrivate> d; 0061 }; 0062 0063 #endif // KNOTIFICATIONJOBUIDELEGATE_H