#ifndef QGSCOPEOBJECT_H
#define QGSCOPEOBJECT_H

#include <QObject>

class QgScopeWorkbench;
class QgLogger;

class QgScopeObject: public QObject
{
    Q_OBJECT

    Q_PROPERTY(QgScopeWorkbench* workBench READ  workBench)
    Q_PROPERTY(QgLogger* logger READ  logger)

    Q_PROPERTY(QString name MEMBER m_name)
    Q_PROPERTY(QString scriptableName READ scriptableName WRITE setScriptableName)

    Q_PROPERTY(QString description READ description WRITE setDescription)

    Q_PROPERTY(QString statusString READ statusString WRITE setStatusString NOTIFY statusStringChanged)
    Q_PROPERTY(QString tooltipString READ tooltipString WRITE setTooltipString NOTIFY tooltipChanged)

public:
    explicit QgScopeObject(const QString& name, QObject* parent=0);
    virtual ~QgScopeObject();

    inline QgScopeWorkbench* workBench() const
    {
        return m_wb;
    }

    inline QgLogger* logger() const
    {
        return m_log;
    }

    QString scriptableName() const;

    void setScriptableName(const QString& name);

    QString description() const;
    void setDescription(const QString& descr);

    QString statusString() const;
    void setStatusString(const QString& msg);

    QString tooltipString() const;
    void setTooltipString(const QString& msg);

signals:
    void deviceActivated(bool active);
    void statusStringChanged(const QString&);

    void tooltipChanged(const QString&);

protected:
    QString m_name;
    QString m_scriptableName;
    QString m_description;
    QString m_statusString;
    QString m_tooltipString;

    QgScopeWorkbench* m_wb;
    QgLogger* m_log;
};

#endif // QGSCOPEOBJECT_H
