Salome HOME
Revert "Synchronize adm files"
[modules/yacs.git] / src / genericgui / GuiEditor.hxx
1 // Copyright (C) 2006-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _GUIEDITOR_HXX_
21 #define _GUIEDITOR_HXX_
22
23
24 #include <QWidget>
25 #include <QString>
26 #include <string>
27
28 namespace YACS
29 {
30   namespace ENGINE
31   {
32     class Catalog;
33   };
34
35   namespace HMI
36   {
37     class Subject;
38     class SubjectNode;
39     class SubjectElementaryNode;
40     class SubjectComposedNode;
41     class SubjectDataPort;
42     class ItemMimeData;
43
44     class GuiEditor
45     {
46     public:
47       GuiEditor();
48       virtual ~GuiEditor();
49
50       void CreateNodeFromCatalog(const ItemMimeData* myData,
51                                  SubjectComposedNode *cnode,
52                                  bool createNewComponentInstance);
53       void AddTypeFromCatalog(const ItemMimeData* myData);
54       SubjectNode* CreateNode(std::string typeNode);
55       void CreateBloc();
56       void CreateForLoop();
57       void CreateForEachLoop(std::string type );
58       void CreateWhileLoop();
59       void CreateSwitch();
60       void CreateOptimizerLoop();
61       void CreateContainer();
62       void CreateComponentInstance();
63
64       SubjectDataPort* CreateInputPort(SubjectElementaryNode* seNode,
65                                        std::string name,
66                                        YACS::ENGINE::Catalog *catalog,
67                                        std::string type = "double",
68                                        SubjectDataPort* before = 0);
69
70       SubjectDataPort* CreateOutputPort(SubjectElementaryNode* seNode, 
71                                         std::string name,
72                                         YACS::ENGINE::Catalog *catalog,
73                                         std::string type = "double",
74                                         SubjectDataPort* before = 0);
75       void DeleteSubject();
76       void DeleteSubject(Subject* parent,
77                          Subject* toRemove);
78
79       void CutSubject();
80       void CopySubject();
81       void PasteSubject();
82       void PutSubjectInBloc();
83       std::string PutGraphInBloc();
84       void PutGraphInNode(std::string typeNode);
85       void shrinkExpand();
86       void rebuildLinks();
87       void arrangeNodes(bool isRecursive);
88       void arrangeProc();
89       void showUndo(QWidget *parent = 0);
90       void showRedo(QWidget *parent = 0);
91       QString asciiFilter(const QString & name);
92
93     protected:
94       SubjectNode* _createNode(YACS::ENGINE::Catalog* catalog,
95                        SubjectComposedNode *cnode,
96                        std::string service,
97                        std::string compoName,
98                        bool createNewComponentInstance);
99       std::string _table;
100     };
101   }
102 }
103
104 #endif