#ifndef CUSTOMATTRIBUTESTABLE_H #define CUSTOMATTRIBUTESTABLE_H #include "events.h" #include #include #include class CustomAttributesTable : public QFrame { Q_OBJECT public: explicit CustomAttributesTable(QWidget *parent = nullptr); ~CustomAttributesTable(); QMap getAttributes() const; void setAttributes(const QMap attributes); void addNewAttribute(const QString &key, QJsonValue value, bool setAsDefault); QSet keys() const; QSet defaultKeys() const; QSet restrictedKeys() const; void setDefaultKeys(const QSet keys); void setRestrictedKeys(const QSet keys); signals: void edited(); void defaultSet(QString key, QJsonValue value); void defaultRemoved(QString key); private: QTableWidget *table; QSet m_keys; // All keys currently in the table QSet m_defaultKeys; // All keys that are in this table by default (whether or not they're present) QSet m_restrictedKeys; // All keys not allowed in the table int addAttribute(const QString &key, QJsonValue value); void removeAttribute(const QString &key); bool deleteSelectedAttributes(); void setDefaultAttribute(const QString &key, QJsonValue value); void unsetDefaultAttribute(const QString &key); void resizeVertically(); }; #endif // CUSTOMATTRIBUTESTABLE_H