bbob_interfaces.h

Go to the documentation of this file.
00001 #ifndef BBOB_INTERFACES_H
00002 #define BBOB_INTERFACES_H
00003 
00004 #include <QStringList>
00005 #include <QMap>
00006 #include <QString>
00007 #include <QDockWidget>
00008 
00009 #include "bcore.h"
00010 
00011 /**
00012   * For plugins to communicate, there is the "Message Bus". A set of functions
00013   * to pass data around plugins.
00014   */
00015 /// Interface for ALL plugins to the core functions (engine)
00016 class CoreInterface
00017 {
00018 public:
00019     virtual ~CoreInterface() {}
00020 
00021     /** Initialize with pointer to core class functions */
00022     virtual void CoreInit(const BCore* core) = 0;
00023 
00024     /** Dump all settings in plugin through core settings */
00025     virtual void SaveSettings() = 0;
00026 
00027     /** Creates or updates a module with <i>name</i> and <i>params</i> */
00028     virtual void Module(const QString name, const QStringList params) = 0;
00029 
00030     /** Returns list of loaded module names */
00031     virtual QStringList ModuleList() const = 0;
00032 
00033     /** Returns a Channel Pointer for connect signals/slots */
00034     virtual BBoB_Channel* ChannelPointer(const QString mod, const QString input) const = 0;
00035 
00036     /** Returns a Module Pointer for access to params */
00037     virtual BBoB_Module* ModulePointer(const QString mod) const = 0;
00038 
00039     /** Returns a QMap of parameters and values */
00040     virtual QMap<QString, QString> ModuleParams(const QString name) const = 0;
00041 
00042     /** Returns a QMap of inputs or outputs available for each module, with mime type */
00043     virtual QMap<QString, QString> ModuleInputs(const QString name) const = 0;
00044     virtual QMap<QString, QString> ModuleOutputs(const QString name) const = 0;
00045 };
00046 
00047 
00048 
00049 /// Interface to return a QDockWidget with a QDialog.
00050 class DisplayInterface
00051 {
00052 public:
00053     virtual ~DisplayInterface() {}
00054 
00055     /* Commands list for plugin menu */
00056     virtual QStringList commands() const = 0;
00057 
00058     /* Displayable widget */
00059     virtual QDockWidget* getDock(const QString &command) = 0;
00060 
00061     /* ConfigTab widget */
00062     virtual QWidget* getConfig() = 0;
00063 
00064 };
00065 
00066 
00067 ///Interface to setup "Message Bus" widgets
00068 class MessageBusInterface
00069 {
00070 public:
00071     virtual ~MessageBusInterface() {}
00072 
00073     /* Initialize BusID */
00074     virtual bool loadBus(const int ID) = 0;
00075     virtual QString BusName() = 0;
00076 
00077     /* Busses pass data between plugins and is routed through BCore */
00078     virtual void BitBus(const int FromID, const int bit ) = 0;
00079     virtual void ByteBus(const int FromID, const int byte ) = 0;
00080     virtual void StringBus(const int FromID, const QString str ) = 0;
00081 
00082 };
00083 
00084 
00085 
00086 Q_DECLARE_INTERFACE(CoreInterface,
00087                     "net.chuktech.BBoB.CoreInterface/1.0")
00088 
00089 Q_DECLARE_INTERFACE(DisplayInterface,
00090                     "net.chuktech.BBoB.DisplayInterface/1.0")
00091 
00092 Q_DECLARE_INTERFACE(MessageBusInterface,
00093                     "net.chuktech.BBoB.MessageBusInterface/1.0")
00094 #endif
00095 

Generated on Sun Oct 28 22:51:26 2007 for BBoB by  doxygen 1.5.3