Salome HOME
Color for background and title are taken from resource manager
[modules/superv.git] / src / SUPERVGUI / SUPERVGUI_CanvasNode.h
index f33d6cee9300df4333b4123599d6297ceaf5b77d..0be086ddd806ba398cf1cf975615d046ce000ca5 100644 (file)
@@ -16,12 +16,16 @@ using namespace std;
 
 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 +43,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 +59,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();
@@ -71,12 +75,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();
 
@@ -88,14 +94,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 +124,7 @@ class SUPERVGUI_CanvasNode : public QObject {
 
     QString          myLabelText;
     SUPERVGUI_CanvasNodePrs* myPrs;
+    SUIT_ResourceMgr* myMgr;
 
     bool myDestroyed;