00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef BOB_H
00021 #define BOB_H
00022
00023 #define __GEDDEI_BUILD
00024
00025 #include "properties.h"
00026 #include "processor.h"
00027 using namespace Geddei;
00028
00029 #include <qptrlist.h>
00030 #include <qstring.h>
00031 #include <qrect.h>
00032 #include <qcanvas.h>
00033
00034 #include "refresher.h"
00035
00036 class QDomDocument;
00037 class QDomElement;
00038 class QPainter;
00039 class QPoint;
00040 class QTimer;
00041
00042 class BobPort;
00043 class GeddeiNite;
00044
00048 class Bob: public QObject, public QCanvasRectangle, public Refresher
00049 {
00050 Q_OBJECT
00051 friend class GeddeiNite;
00052
00053 QPtrList<BobPort> theInputs, theOutputs;
00054 QTimer *theProfileTimer, *theRedrawTimer;
00055
00056 virtual void drawShape(QPainter &p);
00057
00058 private slots:
00059 virtual void slotRedraw();
00060
00061 protected:
00062 QString theName;
00063 Processor *theProcessor;
00064 QCanvas *theCanvas;
00065
00066 public:
00067 static int RTTI;
00068 virtual int rtti() const { return 1000; }
00069
00070 void setPos(QPoint p);
00071
00072 QRect rope();
00073 const QString name();
00074 GeddeiNite *geddeiNite();
00075 Processor *processor() { return theProcessor; }
00076 BobPort *inputPort(int index) { return theInputs.at(index); }
00077
00078 bool connectYourself();
00079 void disconnectYourself();
00080 const bool connected() const { return theProfileTimer != 0; }
00081 virtual void saveYourself(QDomElement &element, QDomDocument &doc);
00082 virtual void loadYourselfPre(QDomElement &element);
00083 virtual void loadYourselfPost(QDomElement &element);
00084
00085 void updatePorts();
00086 void redoPorts();
00087 bool portCollision(BobPort *p);
00088
00089 void refresh() { updatePorts(); }
00090
00091 void init(const int x, const int y);
00092
00093 Bob(const QString &name, QCanvas *c);
00094 virtual ~Bob();
00095 };
00096
00097 #endif