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);
52 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
53 void load(QDomElement groupElement) throw(Exception);
54 void save(QXmlStreamWriter& writer);
58 void updateMinimumSize(); // modify the minimum size
59 bool updateGeometry(ChangeType type);
61 void mousePressEvent(QGraphicsSceneMouseEvent *event);
62 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
63 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
64 void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
65 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
70 /* NOTE : parentItem attribute is never NULL except for the top GroupItem
77 InterfaceItem *isHoverInterface(QPointF point);
80 #endif // __GROUPITEM_H__