2013-08-18 20:11:29 +00:00
|
|
|
#ifndef ESMFILE_HPP
|
|
|
|
#define ESMFILE_HPP
|
|
|
|
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include "modelitem.hpp"
|
|
|
|
|
2013-09-18 07:36:23 +00:00
|
|
|
class QMimeData;
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
class EsmFile : public ModelItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString filename READ fileName)
|
|
|
|
|
|
|
|
public:
|
2013-09-07 20:57:40 +00:00
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
EsmFile(QString fileName = QString(), ModelItem *parent = 0);
|
2013-09-07 20:57:40 +00:00
|
|
|
// EsmFile(const EsmFile &);
|
2013-08-18 20:11:29 +00:00
|
|
|
|
|
|
|
~EsmFile()
|
|
|
|
{}
|
|
|
|
|
2013-09-18 07:36:23 +00:00
|
|
|
void setProperty (const EsmFileProperty prop, const QString &value);
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
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);
|
2013-08-18 20:11:29 +00:00
|
|
|
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;
|
2013-08-18 20:11:29 +00:00
|
|
|
|
|
|
|
private:
|
2013-09-18 07:36:23 +00:00
|
|
|
|
2013-08-18 20:11:29 +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 *)
|
|
|
|
|
2013-08-18 20:11:29 +00:00
|
|
|
#endif
|