1 #ifndef __GROUPITEM_H__
2 #define __GROUPITEM_H__
9 #include <QtXmlPatterns>
12 #include "AbstractBoxItem.h"
13 class AbstractBoxItem;
20 #include "Exception.h"
25 class GroupItem : public AbstractBoxItem {
28 /* CAUTION : the parentItem of a group block IS NOT the group item of the parent scene. It is a BlockItem that is
29 wihtin the parent scene. It is used when interfaceItem are added to the current GroupItem: they must be also added
30 to the parent BlockItem.
32 NB : this yields a problem when loading a project because scenes are created before creating group and then block.
33 thus, the parentItem must be initialized afterward when all block items have been created.
36 GroupItem(BoxItem* _parentItem, AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params) throw(Exception);
37 GroupItem(Dispatcher *_dispatcher, Parameters *_params) throw(Exception); //! uses only when loading a project file
41 BoxItem* getParentItem();
44 void setParentItem(BoxItem* _parentItem);
51 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
52 void load(QDomElement groupElement) throw(Exception);
53 void save(QXmlStreamWriter& writer);
57 void updateMinimumSize(); // modify the minimum size
58 bool updateGeometry(ChangeType type);
60 void mousePressEvent(QGraphicsSceneMouseEvent *event);
61 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
62 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
63 void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
64 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
69 /* NOTE : parentItem attribute is never NULL except for the top GroupItem
76 InterfaceItem *isHoverInterface(QPointF point);
79 #endif // __GROUPITEM_H__