-
- void addInterface(InterfaceItem* i, bool resetPosition = false);
- void removeInterface(InterfaceItem* i);
- void resetInterfacesPosition();
- void deplaceInterface(QPointF pos);
- void updateInterfacesAndConnections();
-
- InterfaceItem *searchInterfaceByName(QString name);
- InterfaceItem *searchInterfaceByRef(ConnectedInterface* ref);
- InterfaceItem* getInterfaceFromCursor(qreal x, qreal y);
+ QRectF boundingRectInScene();
+ virtual void nameChanged() = 0; // called when an interface or box name have changed
+ void addInterfaceItem(InterfaceItem* i, bool resetPosition = false);
+ void removeInterfaceItem(InterfaceItem* i);
+ void resetInterfaceItemsPosition();
+ /*!
+ * \brief moveInterfaceTo
+ * \param pos the new position (in scene) of the interface
+ *
+ * This method is called when user moves an InterfaceItem.
+ * see BoxItem::mouseMoveEvent() and GroupItem::mouseMoveEvent()
+ */
+ void moveInterfaceItemTo(QPointF pos);
+ /*!
+ * \brief updateInterfacesAndConnections
+ *
+ * This method allows to recompute the absolute position of the interfaces of this box
+ * taking into account their relative position (see positionRatio atribute) in the width/height
+ * of the box border they are located on. It allows update the shape of all ConnectionItem
+ * connected to this box.
+ *
+ * CAUTION: this method supposes that before its call, a call to prepareGeometryChange() hase been
+ * done for the BoxItem that owns this InterfaceItem, so that the scene will readraw automatically
+ * the BoxItem. For the connections, the call to prepareGeometryChange() is done within setPath()
+ * that is called in this method. Thus, there is no need to call update() after the termination of
+ * this method.
+ */
+ void updateInterfaceAndConnectionItems();
+
+ InterfaceItem *searchInterfaceItemByName(QString name);
+ InterfaceItem *searchInterfaceItemByRef(ConnectedInterface* ref);
+ InterfaceItem* getInterfaceItemFromCursor(qreal x, qreal y);