File indexing completed on 2025-01-26 03:44:34

0001 /*
0002     SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #ifndef KUSERFEEDBACK_CONSOLE_SURVEYEDITOR_H
0008 #define KUSERFEEDBACK_CONSOLE_SURVEYEDITOR_H
0009 
0010 #include <core/product.h>
0011 
0012 #include <QWidget>
0013 
0014 #include <memory>
0015 
0016 namespace KUserFeedback {
0017 namespace Console {
0018 
0019 class RESTClient;
0020 class SurveyModel;
0021 
0022 namespace Ui
0023 {
0024 class SurveyEditor;
0025 }
0026 
0027 class SurveyEditor : public QWidget
0028 {
0029     Q_OBJECT
0030 public:
0031     explicit SurveyEditor(QWidget *parent = nullptr);
0032     ~SurveyEditor() override;
0033 
0034     void setRESTClient(RESTClient *client);
0035     void setProduct(const Product &product);
0036 
0037 Q_SIGNALS:
0038     void logMessage(const QString &msg);
0039 
0040 private:
0041     void createSurvey();
0042     void editSurvey();
0043     void deleteSurvey();
0044     void updateActions();
0045 
0046 private:
0047     std::unique_ptr<Ui::SurveyEditor> ui;
0048     SurveyModel *m_surveyModel;
0049     RESTClient *m_restClient = nullptr;
0050     Product m_product;
0051 };
0052 
0053 }
0054 }
0055 
0056 #endif // KUSERFEEDBACK_CONSOLE_SURVEYEDITOR_H