#pragma once

#include <QScopedPointer>
#include <DMainWindow>

#include "licensemodel.h"

class ActivatorWindowPrivate;
class ActivatorWindow : public Dtk::Widget::DMainWindow
{
    Q_OBJECT
public:
    explicit ActivatorWindow(QWidget *parent = 0);
    ~ActivatorWindow();

Q_SIGNALS:
    void requestExportInformation(const QString &filepath);
    void importSerialKey(const QString &key);
    void importLicenseFile(const QString &filepath);
    void deactive();

public Q_SLOTS:
    void onActiveStateChanged(const LicenseModel &model);
    void onLicenseImported(quint32, const LicenseModel &model);
    void onInformationExported(bool success);
    void onLogLinkActivated(const QString &link);

protected:
    virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;

    //TODO: private
Q_SIGNALS:
    void exportInformation(bool success);
    void updateView(const LicenseModel &model);

private:
    QScopedPointer<ActivatorWindowPrivate> d_ptr;
    Q_DECLARE_PRIVATE_D(qGetPtrHelper(d_ptr), ActivatorWindow)
};

