/*
 * Simple standalone plugin for bianbu-control-center
 */
#ifndef ACCOUNTS_PLUGIN_H
#define ACCOUNTS_PLUGIN_H

#include <QObject>
#include <QtPlugin>
#include <QIcon>
#include <QPointer>
#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>

#include <lib-bianbu-control-center/interface/interface.h>

class AccountsPlugin : public QObject, public BianbuControlCenter::PluginInterface
{
    Q_OBJECT
    // Only embed plugin metadata when building the shared object (.so)
    // so we can also reuse this class in a standalone executable build.
#ifdef BIANBU_CONTROL_CENTER_ACCOUNTS_BUILD_PLUGIN
    Q_PLUGIN_METADATA(IID BianbuControlCenterPluginInterface_iid)
#endif
    Q_INTERFACES(BianbuControlCenter::PluginInterface)

public:
    AccountsPlugin();
    ~AccountsPlugin() override;

    // BIANBU_CONTROL_CENTERPluginInterface API
    QString pluginI18nName() const override;  // display name (translated)
    int pluginTypes() override;               // module category
    QWidget* pluginUi() override;             // main UI widget
    const QString name() const override;      // stable English name/id
    QIcon icon() const override;              // sidebar/home icon
    bool isEnabled() const override;          // whether enabled
    QStringList keywords() const override;    // search keywords
    QTranslator* translator() const override; // translation support
    void pluginLeave() override;              // called when leaving page
    
private:
    QPointer<QWidget> m_widget; // lazily created UI
};

#endif // ACCOUNTS_PLUGIN_H
