2014-05-09 20:46:25 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
2014-05-10 05:23:32 +05:30
|
|
|
#include <QList>
|
2015-05-18 03:08:28 +05:30
|
|
|
#include <QJsonDocument>
|
2016-03-19 07:36:32 +05:30
|
|
|
#include <QDateTime>
|
2017-03-27 07:04:39 +05:30
|
|
|
#include "ProblemProvider.h"
|
2014-05-09 20:46:25 +05:30
|
|
|
|
2017-10-12 02:34:24 +05:30
|
|
|
class ComponentList;
|
2017-03-27 07:04:39 +05:30
|
|
|
namespace Meta
|
2016-02-21 06:14:27 +05:30
|
|
|
{
|
2017-03-27 07:04:39 +05:30
|
|
|
class Version;
|
2017-03-30 04:35:58 +05:30
|
|
|
class VersionList;
|
2017-03-27 07:04:39 +05:30
|
|
|
}
|
|
|
|
class VersionFile;
|
2016-02-21 06:14:27 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
class ProfilePatch : public ProblemProvider
|
2016-02-21 06:14:27 +05:30
|
|
|
{
|
|
|
|
public:
|
2017-03-27 07:04:39 +05:30
|
|
|
ProfilePatch(std::shared_ptr<Meta::Version> version);
|
|
|
|
ProfilePatch(std::shared_ptr<VersionFile> file, const QString &filename = QString());
|
2016-02-21 06:14:27 +05:30
|
|
|
|
2015-01-28 03:01:07 +05:30
|
|
|
virtual ~ProfilePatch(){};
|
2017-10-12 02:34:24 +05:30
|
|
|
virtual void applyTo(ComponentList *profile);
|
2015-01-28 03:01:07 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
virtual bool isMoveable();
|
|
|
|
virtual bool isCustomizable();
|
|
|
|
virtual bool isRevertible();
|
|
|
|
virtual bool isRemovable();
|
|
|
|
virtual bool isCustom();
|
|
|
|
virtual bool isVersionChangeable();
|
2015-05-18 03:08:28 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
virtual void setOrder(int order);
|
|
|
|
virtual int getOrder();
|
2015-01-28 03:01:07 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
virtual QString getID();
|
|
|
|
virtual QString getName();
|
|
|
|
virtual QString getVersion();
|
2017-04-24 05:00:51 +05:30
|
|
|
virtual std::shared_ptr<Meta::Version> getMeta();
|
2017-03-27 07:04:39 +05:30
|
|
|
virtual QDateTime getReleaseDateTime();
|
2016-03-13 04:53:45 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
virtual QString getFilename();
|
2016-03-13 04:53:45 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
virtual std::shared_ptr<class VersionFile> getVersionFile();
|
2017-03-30 04:35:58 +05:30
|
|
|
virtual std::shared_ptr<class Meta::VersionList> getVersionList();
|
2016-03-19 07:36:32 +05:30
|
|
|
|
2017-03-27 07:04:39 +05:30
|
|
|
void setVanilla (bool state);
|
|
|
|
void setRemovable (bool state);
|
|
|
|
void setRevertible (bool state);
|
|
|
|
void setMovable (bool state);
|
2016-02-21 06:14:27 +05:30
|
|
|
|
2017-03-30 04:35:58 +05:30
|
|
|
const QList<PatchProblem> getProblems() override;
|
|
|
|
ProblemSeverity getProblemSeverity() override;
|
|
|
|
|
2016-02-21 06:14:27 +05:30
|
|
|
protected:
|
2017-03-27 07:04:39 +05:30
|
|
|
// Properties for UI and version manipulation from UI in general
|
|
|
|
bool m_isMovable = false;
|
|
|
|
bool m_isRevertible = false;
|
|
|
|
bool m_isRemovable = false;
|
|
|
|
bool m_isVanilla = false;
|
|
|
|
|
|
|
|
bool m_orderOverride = false;
|
|
|
|
int m_order = 0;
|
|
|
|
|
|
|
|
std::shared_ptr<Meta::Version> m_metaVersion;
|
|
|
|
std::shared_ptr<VersionFile> m_file;
|
|
|
|
QString m_filename;
|
2014-05-09 20:46:25 +05:30
|
|
|
};
|
|
|
|
|
2015-01-28 03:01:07 +05:30
|
|
|
typedef std::shared_ptr<ProfilePatch> ProfilePatchPtr;
|