00001 #ifndef SXUICOMPONENT_H_INCLUDED
00002 #define SXUICOMPONENT_H_INCLUDED
00003
00004 #include <QGraphicsItem>
00005 #include "sxComponent.h"
00006 #include "sxUiAbstractComponent.h"
00007
00008 class sxUiTextItem;
00012 class SX_GUISDKEXPORT sxUiComponent : public QGraphicsItem, public sxUiAbstractComponent
00013 {
00014 protected:
00015 sxUiTextItem * xText;
00016 sxComponent * xComp;
00017 qreal xTextHeight;
00018 qreal xMargin;
00019 QString xPixmapName;
00020 QPixmap * xPixmap;
00021 mutable QRectF xBoundingRect;
00022
00023
00024 bool SaveGui(QDomElement & guiNode);
00025 bool LoadGui(const QDomElement & guiNode);
00026
00027 virtual bool SaveCustomGui(QDomElement & guiNode);
00028 virtual bool LoadCustomGui(const QDomElement & guiNode);
00029
00030 sxInPort * CreateInputPort() const;
00031 sxOutPort * CreateOutputPort() const;
00032
00033 sxUiComponent(sxComponent * comp, const QString& pixmapName = QString());
00034 public:
00035 virtual ~sxUiComponent();
00036
00037 virtual void Adjust();
00038 void ReparentPorts(sxUiComponent * prnt);
00039 sxComponent * Component() const;
00040 QFont Font() const;
00041 void SetFont(const QFont& f);
00042
00043
00044 QRectF boundingRect() const;
00045 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00046 virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
00047
00048 enum { TYPE = UserType + 1 };
00049 int type() const;
00050
00051
00052 virtual int ShowPropertyDialog(QWidget * parent = 0);
00053 virtual QWidget * UiWidget() const;
00054 };
00055
00056 #endif // SXUICOMPONENT_H_INCLUDED