Salome HOME
Merge from OCC_development_generic_2006
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasNode.h
index f33d6cee9300df4333b4123599d6297ceaf5b77d..d34a65490f0a2ef961fb90fdc89cc1cc5143a3f3 100644 (file)
@@ -9,19 +9,22 @@
 #ifndef SUPERVGUI_CanvasNode_H
 #define SUPERVGUI_CanvasNode_H
 
-using namespace std;
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
 #include <qstringlist.h>
 
 class SUPERVGUI_Main;
 class SUPERVGUI_CanvasNodePrs;
+class SUIT_ResourceMgr;
 
 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( SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*, SUPERV_CNode theNode, bool theIsCell=false);
     virtual ~SUPERVGUI_CanvasNode();
 
     // done to ignore port update when node is removed
@@ -39,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();
@@ -55,10 +58,10 @@ 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();
@@ -68,15 +71,22 @@ class SUPERVGUI_CanvasNode : public QObject {
 
     QString getLabelText() const { return myLabelText; }
 
+    virtual QString getToolTipText() const;
+
+  signals:
+    void objectCreatedDeleted(); // mkr : PAL8237
+
   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();
 
@@ -88,14 +98,21 @@ class SUPERVGUI_CanvasNode : public QObject {
     void setTrace(bool b);
     void setVerbose(bool b);
 
-    virtual void addInputPort();
-    virtual void addOutputPort();
+    // mkr : IPAL9815 : commented the following code
+    /*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;
+    SUIT_ResourceMgr* resMgr() const { return myMgr; }
+    
+    void createPort(SUPERV::Port_ptr thePort);
+    void createStreamPort(SUPERV::StreamPort_ptr thePort);
     
     virtual bool eventFilter(QObject* o, QEvent* e);
     SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
@@ -111,6 +128,7 @@ class SUPERVGUI_CanvasNode : public QObject {
 
     QString          myLabelText;
     SUPERVGUI_CanvasNodePrs* myPrs;
+    SUIT_ResourceMgr* myMgr;
 
     bool myDestroyed;