/*
 * SmartHome server: Base of the system
 *
 * Copyright (C) 2010 Daniel Pisi <dan.pisi@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License
 * as published by the Free Software Foundation.
 *
 */

/**
 * @file shobject.h
 * @brief Defines the plug-in API
 * @author Daniel Pisi
 */

#ifndef SHOBJECT_H
#define SHOBJECT_H

#include <QtCore/QCoreApplication>
#include <QList>
#include "shmessage.h"
#include "shpin.h"

// -----------------------------------------------------------------------------

/**
 * \class ShObject
 * \brief Defines the plug-in API
 */
class ShObject
{
public:
    virtual ~ShObject() {};
    virtual bool init(QString param) = 0;
    virtual void updatePins(const QList<ShPin> &pins) = 0;

    virtual void setObjectId(int id) = 0;
    virtual int  objectId() = 0;

    virtual void setIdApi(bool idApi) = 0;
    virtual bool idApi() = 0;

    virtual void processMessage(QSharedPointer<ShMessage> message) = 0;
};

QT_BEGIN_NAMESPACE
Q_DECLARE_INTERFACE(ShObject, "SmartHome.Plugin.ShObject/1.0");
QT_END_NAMESPACE

// -----------------------------------------------------------------------------

#endif // SHOBJECT_H
