File indexing completed on 2024-12-15 03:45:05

0001 /*
0002     SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #ifndef KUSERFEEDBACK_NOTIFICATIONPOPUP_H
0008 #define KUSERFEEDBACK_NOTIFICATIONPOPUP_H
0009 
0010 #include "kuserfeedbackwidgets_export.h"
0011 
0012 #include <QWidget>
0013 
0014 #include <memory>
0015 
0016 namespace KUserFeedback {
0017 
0018 class NotificationPopupPrivate;
0019 class Provider;
0020 
0021 /*!
0022  * Notification popup that overlays a small part of the application for
0023  * encouraging contributions or inform about surveys.
0024  */
0025 class KUSERFEEDBACKWIDGETS_EXPORT NotificationPopup : public QWidget
0026 {
0027     Q_OBJECT
0028 public:
0029     /*!
0030      * Create a new notification popup.
0031      * Do not put this widget into a layout.
0032      * @param parent The parent widget. This must not be @c nullptr.
0033      */
0034     explicit NotificationPopup(QWidget *parent);
0035     ~NotificationPopup() override;
0036 
0037     /*!
0038      * Set the feedback provider that is going to drive this notification popup.
0039      */
0040     void setFeedbackProvider(Provider *provider);
0041 
0042 protected:
0043     ///@cond internal
0044     void keyReleaseEvent(QKeyEvent *event) override;
0045     bool eventFilter(QObject *receiver, QEvent *event) override;
0046     ///@endcond
0047 
0048 private:
0049     std::unique_ptr<NotificationPopupPrivate> d;
0050 };
0051 
0052 }
0053 
0054 #endif // KUSERFEEDBACK_NOTIFICATIONPOPUP_H