Salome HOME
Memory Leaks
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasNode.h
index 9cf391c4bbdf662b56165edeff2a96730b20014c..445c9a2fda06bf1314c75eda8829cf15aa2293e9 100644 (file)
 using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
+#include <qstringlist.h>
 
 class SUPERVGUI_Main;
 class SUPERVGUI_CanvasNodePrs;
 
 class SUPERVGUI_CanvasNode : public QObject {
+  friend class SUPERVGUI_ManagePortsDlg;
+  friend class SUPERVGUI_Clipboard;
+
   Q_OBJECT
 
   public:
-    SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+    SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell=false);
     virtual ~SUPERVGUI_CanvasNode();
 
     // done to ignore port update when node is removed
@@ -38,9 +42,9 @@ class SUPERVGUI_CanvasNode : public QObject {
     virtual void showAll();
     virtual bool setNodeName(QString aName);
 
-    SUPERV_CNode getEngine() const { return myNode; }
-    SUPERVGUI_Main* getMain() const { return myMain; }
-    SUPERVGUI_CanvasNodePrs* getPrs() const;
+    SUPERV_CNode             getEngine() const { return myNode; }
+    SUPERVGUI_Main*          getMain()   const { return myMain; }
+    SUPERVGUI_CanvasNodePrs* getPrs();
 
     bool isWarning();
     bool isStep();
@@ -54,13 +58,14 @@ class SUPERVGUI_CanvasNode : public QObject {
     SUPERV_INode  getInlineNode()    const { return SUPERV::INode::_narrow(myNode); }
     SUPERV_GNode  getGotoNode()      const { return SUPERV::GNode::_narrow(myNode); }
     SUPERV_LNode  getLoopNode()      const { return SUPERV::LNode::_narrow(myNode); }
-    SUPERV_ELNode getEndLoopNode()   const { return SUPERV::ELNode::_narrow(myNode); }
+    SUPERV_ELNode getEndLoopNode()   const { return SUPERV::ELNode::_narrow(myNode);}
     SUPERV_SNode  getSwitchNode()    const { return SUPERV::SNode::_narrow(myNode); }
-    SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode); }
-    SUPERV_Graph  getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
+    SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode);}
+    SUPERV_Graph  getMacroNode()     const { return SUPERV::Graph::_narrow(myNode); }
 
     SUPERV_Port createInPort();
     SUPERV_Port createOutPort();
+    QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
 
     virtual QPopupMenu* getPopupMenu(QWidget* theParent);
 
@@ -69,12 +74,14 @@ class SUPERVGUI_CanvasNode : public QObject {
   public slots:
     void suspendResume();
     void kill();
-    void stopRestart();
-    void configure();
-    void showPython();
+    //void stopRestart();
+
+    //asv: 13.12.04: ??? --> void configure();
+    //asv: 13.12.04: ??? --> void showPython();
 
     virtual void rename();
     virtual void remove();
+    void copy();
     void changeInformation();
     void browse();
 
@@ -89,11 +96,16 @@ class SUPERVGUI_CanvasNode : public QObject {
     virtual void addInputPort();
     virtual void addOutputPort();
     virtual void editFunction();
+    virtual void pastePort();
+    void managePorts();
+    void exportToLib();
 
   protected:
+    // redefined by most of CanvasNode successors
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
-    virtual void createPort(SUPERV::Port_ptr thePort) const;
-    virtual void createStreamPort(SUPERV::StreamPort_ptr thePort) const;
+    
+    void createPort(SUPERV::Port_ptr thePort);
+    void createStreamPort(SUPERV::StreamPort_ptr thePort);
     
     virtual bool eventFilter(QObject* o, QEvent* e);
     SUPERVGUI_BrowseNodeDlg* myBrowseDlg;