#pragma once

#include <QStringList>
#include <QVariantMap>
#include <QDateTime>
#include <QSettings>

class SoftwareFilter;
class SoftwareHandle;
class Registry;

typedef Registry WinRegKey;

class Software
{
public:
    QString key() const;
    QString getInstallDate() const;
    QJsonObject toObject() const;
    void updateStatus(const SoftwareFilter &filter);

    static void registerStatusHandle(const QString &id, SoftwareHandle*);

    QString DisplayName;
    QString InstallLocation;
    QString UninstallString;
    QString Version;
    QString Category;
    QDateTime InstallDate;
    QStringList ProductKeys;
    QMap<QString, QVariant> externData;
    bool IsGenuine = false;

    Software() {}
    #ifdef Q_OS_WIN
    Software(WinRegKey *regKey);
    #endif
};


class SoftwareHandle
{
public:
    virtual void updateStatus(Software &) = 0;
};
