File indexing completed on 2024-07-21 04:35:05

0001 // SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003 
0004 #pragma once
0005 
0006 #include "post.h"
0007 
0008 class ReportEditorBackend : public QObject
0009 {
0010     Q_OBJECT
0011     QML_ELEMENT
0012 
0013     Q_PROPERTY(QString accountId MEMBER m_accountId NOTIFY accountIdChanged)
0014     Q_PROPERTY(QString postId MEMBER m_postId NOTIFY postIdChanged)
0015     Q_PROPERTY(QString comment MEMBER m_comment NOTIFY commentChanged)
0016     Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged)
0017 
0018 public:
0019     explicit ReportEditorBackend(QObject *parent = nullptr);
0020 
0021     bool loading() const;
0022 
0023 public Q_SLOTS:
0024     void submit();
0025 
0026 Q_SIGNALS:
0027     void accountIdChanged();
0028     void postIdChanged();
0029     void commentChanged();
0030     void reported();
0031     void loadingChanged();
0032 
0033 private:
0034     QString m_accountId;
0035     QString m_postId;
0036     QString m_comment;
0037     bool m_loading = false;
0038 };