1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 19:49:54 +00:00
openmw-tes3mp/components/esxselector/model/esmfile.hpp

78 lines
2 KiB
C++
Raw Normal View History

#ifndef ESMFILE_HPP
#define ESMFILE_HPP
#include <QDateTime>
#include <QStringList>
#include "modelitem.hpp"
2013-09-18 07:36:23 +00:00
class QMimeData;
namespace EsxModel
{
2013-09-18 07:36:23 +00:00
enum EsmFileProperty
{
Property_FileName = 0,
Property_Author = 1,
Property_Version = 2,
Property_DateModified = 3,
Property_Path = 4,
Property_Description = 5,
Property_Master = 6
};
class EsmFile : public ModelItem
{
Q_OBJECT
Q_PROPERTY(QString filename READ fileName)
public:
2013-09-07 20:57:40 +00:00
EsmFile(QString fileName = QString(), ModelItem *parent = 0);
2013-09-07 20:57:40 +00:00
// EsmFile(const EsmFile &);
~EsmFile()
{}
2013-09-18 07:36:23 +00:00
void setProperty (const EsmFileProperty prop, const QString &value);
void setFileName(const QString &fileName);
void setAuthor(const QString &author);
void setSize(const int size);
2013-09-18 07:36:23 +00:00
void setDate(const QDateTime &modified);
void setVersion(const float version);
void setPath(const QString &path);
void setMasters(const QStringList &masters);
void setDescription(const QString &description);
inline QString fileName() const { return mFileName; }
inline QString author() const { return mAuthor; }
inline QDateTime modified() const { return mModified; }
inline float version() const { return mVersion; }
inline QString path() const { return mPath; }
inline QStringList masters() const { return mMasters; }
inline QString description() const { return mDescription; }
2013-09-18 07:36:23 +00:00
inline bool isMaster() const { return (mMasters.size() == 0); }
QByteArray encodedData() const;
public:
static int sPropertyCount;
private:
2013-09-18 07:36:23 +00:00
QString mFileName;
QString mAuthor;
QDateTime mModified;
float mVersion;
QString mPath;
QStringList mMasters;
QString mDescription;
};
}
2013-09-07 20:57:40 +00:00
Q_DECLARE_METATYPE (EsxModel::EsmFile *)
#endif