X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..07a20cc501e4061a82e7795d9243a4ff2512136a:/Dispatcher.h?ds=sidebyside diff --git a/Dispatcher.h b/Dispatcher.h index 4475518..fd61087 100644 --- a/Dispatcher.h +++ b/Dispatcher.h @@ -37,12 +37,14 @@ public: void unselectAllItems(int direction=0); void setCurrentGroupWidget(GroupWidget *win); void changeConnectionMode(int mode = -1); - void rename(AbstractBoxItem* item); - void rename(InterfaceItem* item); + + GroupWidget* createTopScene(); GroupWidget* createChildScene(GroupWidget* parentWidget, BoxItem* upperItemOfGroupItem = NULL); - void showRaiseWindow(AbstractBoxItem *item); + void destroyScene(GroupScene* scene); + void showRaiseWindow(BoxItem *item); void showRstClkInter(AbstractBoxItem *item); + void addNewEmptyGroup(GroupScene *scene); void addNewFullGroup(); inline GroupWidget* getCurrentGroup() { return currentGroup; } @@ -50,27 +52,71 @@ public: bool isCurrentProject; public slots: - + QMap getAllGroupNames(); GroupScene* searchSceneById(int id); + GroupScene* searchSceneByName(QString name); BoxItem* searchBlockItemById(int id); GroupItem* searchGroupItemById(int id); InterfaceItem* searchInterfaceItemById(int id); - void removeBlock(AbstractBoxItem* item); + // block ops + void addBlock(int idCategory, int idBlock, int idScene); + void removeBlock(BoxItem* item); void duplicateBlock(BoxItem* item); + void renameBlockOrGroup(AbstractBoxItem* item); + + // interface ops + /*! + * \brief connectInterToGroup + * \param item item is always owned by a BoxItem + * + * This method is called only when the user right clicks on an InterfaceItem (that belongs + * to a BoxItem and if it is NOT connected to an InterfaceItem of the GroupItem) and chooses + * connect to group in the contextual menu. + * Thus, parameter item is always owned by a BoxItem + */ + void connectInterToGroup(InterfaceItem* item); + /*! + * \brief disconnectInterFromGroup + * \param item item is always owned by a BoxItem + * + * This method is called only when the user right clicks on an InterfaceItem (that belongs + * to a BoxItem and if it IS connected to an InterfaceItem of the GroupItem) and chooses + * disconnect from group in the contextual menu. + * Thus, parameter item is always owned by a BoxItem + */ + void disconnectInterFromGroup(InterfaceItem* item); + /*! + * \brief removeBlockInterface + * \param item item is always owned by a BoxItem + * + * This method is called only when the user right clicks on an InterfaceItem (that belongs + * to a BoxItem and has a multiplicity > 1) and chooses remove in the contextual menu. + * Thus, parameter item is always owned by a BoxItem + */ + void removeBlockInterface(InterfaceItem* item); + /*! + * \brief removeGroupInterface + * \param item item is always owned by a GroupItem + * + * This method is called only when the user right clicks on an InterfaceItem (that belongs + * to a GroupItem and if it is connected only to an inner interface) and chooses remove in the contextual menu. + * Thus, parameter item is always owned by a GroupItem + */ + void removeGroupInterface(InterfaceItem* item); void duplicateInterface(InterfaceItem* item); - void addBlock(int idCategory, int idBlock); + void showProperties(InterfaceItem *inter); + void renameInterface(InterfaceItem* item); + + // connection ops ConnectionItem *addConnection(InterfaceItem *input, InterfaceItem *output); - void removeAllBlockConnections(AbstractBoxItem *block); + void removeAllBlockConnections(BoxItem *item); void removeConnection(ConnectionItem *conn); - void removeUselessGroupInterfaces(); + + + // others void showBlocksLibrary(); - void showProperties(InterfaceItem *inter); - void connectInterToGroup(InterfaceItem* item); - void disconnectInterFromGroup(InterfaceItem* item); - void removeGroupInterface(InterfaceItem* item); - void addConnection(); void closeCurrentProject(); @@ -84,6 +130,8 @@ private: QList groupList; GroupWidget* currentGroup; GroupWidget *topGroup; + + static int sceneCounter; }; #endif // __DISPATCHER_H__