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

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