#ifndef METADATA_H #define METADATA_H #include #include #include class Section { Q_DECLARE_TR_FUNCTIONS(Section) public: Section(); ~Section(); Section & operator=(const Section& other); // TODO: maybe use QString instead of a enum? different section won't share a same // enum value in any way... enum PropertyType : int { NameProp, FileSizeProp, LastModifiedProp, ImageSizeProp, }; int count() const; void setSectionName(const QString & displayName); void setValue(PropertyType type, const QString & value); QString value(PropertyType type) const; QString valueAt(int index) const; QString propertyName(PropertyType type) const; private: QString m_displayName; QList m_propertyIndexes; QMap m_propertiesValueMap; QMap m_propertiesOverrideDisplayNameMap; const QMap m_builtinPropDisplayNameMap { {NameProp, tr("Name")}, {FileSizeProp, tr("File Size")}, {LastModifiedProp, tr("Last Modified")}, {ImageSizeProp, tr("Image Size")}, }; }; class Metadata { public: enum SectionType : int { GeneralSection, ExifSection, }; Metadata(); ~Metadata(); private: QList m_sectionIndexes; QMap m_sections; void setSectionName(SectionType type, const QString & displayName); void setPropertyValue(SectionType type, Section::PropertyType propType, QString value); }; #endif // METADATA_H