Index: branches/2.0-beta1/include/Pacpus/kernel/inputOutputBase.h
===================================================================
--- branches/2.0-beta1/include/Pacpus/kernel/inputOutputBase.h	(revision 95)
+++ branches/2.0-beta1/include/Pacpus/kernel/inputOutputBase.h	(revision 96)
@@ -4,7 +4,8 @@
 #include <Pacpus/kernel/pacpus.h>
 #include <Pacpus/kernel/ConnectionBase.h>
+#include <Pacpus/kernel/PacpusEvent.h>
 
+#include <QApplication>
 #include <typeinfo>
-#include <QEvent>
 #include <QList>
 #include <QStringList>
@@ -24,9 +25,13 @@
     QString getName() {return _name;}
     virtual QString getDataType() = 0;
-    //ComponentBase * getComponent() {return _component;}
+    ComponentBase * getComponent() {return _component;}
+
+    void addConnection(ConnectionBase connection) { _connection.append(connection);}
+    bool removeConnection(ConnectionBase connection) { return _connection.removeOne(connection);}
 
 protected:
     QString _name;
     ComponentBase * _component;
+    QList<ConnectionBase> _connection;
 };
 
@@ -34,9 +39,24 @@
 {
     Q_OBJECT
+protected:
+    InputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0):AbstractInterface(name,component,parent) {}
+
 public:
-    InputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0):AbstractInterface(name,component,parent) {}
+    //InputInterfaceBase(QString name, ComponentBase * component,int a, QObject * parent = 0):AbstractInterface(name,component,parent) {} // TODO add ctor with function pointer
+
     virtual ~InputInterfaceBase(){}
 
-    virtual void customEvent(QEvent* e) = 0;
+    virtual void customEvent(QEvent* e) {
+
+        //if(event->type())
+            //TODO get event Type anf call callback function
+
+    QByteArray buf;
+    QDataStream out(&buf,QIODevice::WriteOnly);
+    out << e;
+    // Callback QByteArray
+    }
+
+    virtual PacpusEvent getEventTemplate() {return PacpusEvent(GENERIC_EVENT);} // TODO check ??
 
 };
@@ -45,22 +65,46 @@
 {
     Q_OBJECT
+
 public:
     OutputInterfaceBase(QString name, ComponentBase * component, QObject * parent = 0):AbstractInterface(name,component,parent) {}
+
     virtual ~OutputInterfaceBase(){}
-
-    void addConnection(ConnectionBase connection) { _connection.append(connection);}
-    bool removeConnection(ConnectionBase connection) { return _connection.removeOne(connection);}
 
     QStringList getInputConnectedList() {
         QStringList list;
         for(QList<ConnectionBase>::iterator it = _connection.begin(); it!=_connection.end(); ++it)
-            list.append(it->getInputInterface()->getName());
+            list.append(it->getInterface()->getName());
         return list;
     }
 
-protected:
-    QList<ConnectionBase> _connection;
+    void send(/*const*/ QByteArray & data) {
+
+        // TODo getEvent
+        //PacpusEvent& event = _connection.at(0).getInterface()->
+        QDataStream in(&data,QIODevice::ReadOnly);
+        //in >> event;
+
+        //for(QList<ConnectionBase>::iterator it = _connection.begin(); it!=_connection.end(); ++it)
+        //        QApplication::postEvent(it->getInterface(),&event,it->getPriority());
+
+
+    }
 
 };
+
+static bool connectInterface(OutputInterfaceBase* out, InputInterfaceBase * in, int priority)
+{
+    if(out->getDataType() == in->getDataType() || out->getDataType() == QString(typeid(QByteArray).name()) || in->getDataType() == QString(typeid(QByteArray).name())) {
+
+        // Add connection
+        out->addConnection(ConnectionBase(in,priority));  // TODO make connect function
+        in->addConnection(ConnectionBase(out,priority));
+        //LOG_INFO("connection : Output " << out->getSignature() << " => Input " << in->getSignature());
+        return true;
+    } else {
+   //LOG_WARN("connecting " << out->getSignature() << ":" << out->getDataType() << " to " << in->getSignature() << ":" << in->getDataType() << " failled : DataType incompatible " <<  QString(typeid(QByteArray).name()));
+   return false;
+    }
+}
 
 } // namespace pacpus
