# shobjecthelper.h

Go to the documentation of this file.

    00001 /*
    00002  * SmartHome server: Base of the system
    00003  *
    00004  * Copyright (C) 2010 Daniel Pisi <dan.pisi@gmail.com>
    00005  *
    00006  * This program is free software; you can redistribute it and/or modify it
    00007  * under the terms of version 2 of the GNU General Public License
    00008  * as published by the Free Software Foundation.
    00009  *
    00010  */
    00011
    00018 #ifndef SHOBJECTHELPER_H
    00019 #define SHOBJECTHELPER_H
    00020
    00021 #include <QObject>
    00022 #include "shobject.h"
    00023
    00024 // -----------------------------------------------------------------------------
    00025
    00033 class ShObjectHelper : public QObject, public ShObject
    00034 {
    00035     Q_OBJECT
    00036     Q_INTERFACES(ShObject)
    00037
    00038 public:
    00039     ShObjectHelper(QObject *parent = 0);
    00040
    00041     virtual int  objectId()           { return mId; };
    00042     virtual void setObjectId(int id)  { mId = id; }
    00043
    00044     virtual bool idApi()              { return mIdApi; };
    00045     virtual void setIdApi(bool idApi) { mIdApi = idApi; };
    00046
    00047     void dispatchMessage(ShMessagePtr message);
    00048     void ackMessage(ShMessagePtr message);
    00049     void errorMessage(ShMessagePtr message, QString reason);
    00050
    00051     void outputUpdated(QString signal, QVariant value);
    00052
    00053 signals:
    00054     void newMessage(ShMessagePtr message);
    00055
    00056 private:
    00057     int  mId;
    00058     bool mIdApi;
    00059 };
    00060 // -----------------------------------------------------------------------------
    00061
    00062 #endif // SHOBJECTHELPER_H

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends