#pragma once

#include <QObject>
#include <QScopedPointer>

#include "licensemodel.h"

#define ACTIVATOR_SERVICE_NAME  "com.deepin.license.activator"
#define ACTIVATOR_SERVICE_PATH  "/com/deepin/license/activator"
#define ACTIVATOR_SERVICE_IFC   "com.deepin.license.activator"

class ActivatorControlPrivate;
class ActivatorControl : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", ACTIVATOR_SERVICE_IFC)

public:
    explicit ActivatorControl(QObject *parent = 0);
    ~ActivatorControl();

public slots:
    Q_SCRIPTABLE void Show();
    Q_SCRIPTABLE void Notify();
    Q_SCRIPTABLE QByteArray GetIndicatorData(double);

public slots:
    void exportInformation(const QString &file);
    void importSerialKey(const QString &key);
    void importLicenseFile(const QString &filepath);
    void deactive();

    void notifyActivator();
    void notifyCallbackAction(uint, QString);

Q_SIGNALS:
    void showActiveWindow();
    void informationExported(bool);
    void licenseImported(quint32, const LicenseModel &);
    void activeStateChanged(const LicenseModel &);

private:
    QScopedPointer<ActivatorControlPrivate> d_ptr;
    Q_DECLARE_PRIVATE_D(qGetPtrHelper(d_ptr), ActivatorControl)
};

