Salome HOME
37a56851d2b86eaeea9388c945043dbe86f11d0b
[modules/yacs.git] / src / genericgui / EditionScript.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 _EDITIONSCRIPT_HXX_
21 #define _EDITIONSCRIPT_HXX_
22
23 #include "yacsconfig.h"
24 #include "EditionElementaryNode.hxx"
25 #include "FormComponent.hxx"
26
27 class FormContainer;
28
29 #if HAS_QSCI4>0
30 class QsciScintilla;
31 #endif
32
33 namespace YACS
34 {
35   namespace HMI
36   {
37     class EditionScript: public EditionElementaryNode
38     {
39       Q_OBJECT
40
41     public slots:
42       virtual void onApply();
43       virtual void onCancel();
44       virtual void onScriptModified();
45       virtual void onEdit();
46       virtual void fillContainerPanel();
47       virtual void changeContainer(int);
48       virtual void update(GuiEvent event, int type, Subject* son);
49
50     public:
51       EditionScript(Subject* subject,
52                   QWidget* parent = 0,
53                   const char* name = 0);
54       virtual ~EditionScript();
55       virtual void synchronize();
56
57     protected:
58       SubjectInlineNode *_subInlineNode;
59
60 #if HAS_QSCI4>0
61       QsciScintilla* _sci;
62 #else
63       QTextEdit* _sci;
64 #endif
65       QVBoxLayout* _glayout;
66       QVBoxLayout* _portslayout;
67       QPushButton* _editor;
68       bool _checked;
69       bool _remote;
70       QFrame *fr_container;
71       ComboBox* cb_container;
72       FormContainer* formcontainer;
73     };
74   }
75 }
76 #endif