From d24f813f3f2a05c112e803e4256b53535895fc98 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 14 Jul 2021 11:49:10 +1200 Subject: Initial mirror commit --- src/dictionary/DicRecord.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/dictionary/DicRecord.h (limited to 'src/dictionary/DicRecord.h') diff --git a/src/dictionary/DicRecord.h b/src/dictionary/DicRecord.h new file mode 100644 index 0000000..913da08 --- /dev/null +++ b/src/dictionary/DicRecord.h @@ -0,0 +1,40 @@ +#ifndef DICENTRY_H +#define DICENTRY_H + +#include + +class Field; +class ICardPack; + +class DicRecord: public QObject +{ +Q_OBJECT + +public: + DicRecord(); + DicRecord( const DicRecord& aOther ); + + const QHash getFields() const {return fields;} + QString getFieldValue(const QString& name) const { return fields.value(name); } + QStringList getFieldElements(const QString& fieldName) const; + QString getPreviewQuestionForPack(ICardPack* pack) const; + QString id04() const { return m_id04; } + void setField( QString aField, QString aValue ); + void setId04( const QString& aId ) { m_id04 = aId; } + void renameField( const QString aOldFieldName, const QString aNewFieldName ); + bool isValid(const QString& qstFieldName) const; + +private: + bool hasNonEmptyAnswerField(const QString& qstFieldName) const; + +signals: + void valueChanged( QString aField ); + +private: + QHash fields; // Field name -> field value + QString m_id04; // For v. 0.4 +}; + +Q_DECLARE_METATYPE( DicRecord ) + +#endif -- cgit