Salome HOME
Merge 'master' branch into 'V9_dev' branch
[modules/kernel.git] / src / KernelHelpers / SALOME_StudyEditor.hxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
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 // Author: Guillaume Boulant (EDF/R&D)
20
21 #ifndef __STUDY_EDITOR_HXX__
22 #define __STUDY_EDITOR_HXX__
23
24 #include "KernelHelpers.hxx"
25
26 #include <SALOMEconfig.h>
27 #include CORBA_CLIENT_HEADER(SALOMEDS)
28 #include CORBA_SERVER_HEADER(SALOME_Component)
29
30 #include <vector>
31
32 class KERNELHELPERS_EXPORT SALOME_StudyEditor {
33
34 public:
35   SALOME_StudyEditor();
36
37   typedef std::vector<SALOMEDS::SObject_ptr> SObjectList;
38
39   SALOMEDS::SComponent_ptr newRoot(const char * moduleName);  
40   SALOMEDS::SComponent_ptr findRoot(const char * moduleName);
41   bool bindEngine(SALOMEDS::SComponent_var studyRoot,Engines::EngineComponent_var engine);
42
43   SALOMEDS::SObject_ptr newObject(SALOMEDS::SObject_ptr parent);
44   SALOMEDS::SObject_ptr findObject(const char * entry);
45   void setName(SALOMEDS::SObject_var sobject, const char * value);
46   const char * getName(SALOMEDS::SObject_var sobject);
47
48   void setIcon(SALOMEDS::SObject_var sobject, const char * resourcename);
49
50   void setParameterInt(SALOMEDS::SObject_var sobject, const char * name, int value);
51   int  getParameterInt(SALOMEDS::SObject_var sobject, const char * name);
52   void setParameterBool(SALOMEDS::SObject_var sobject, const char * name, bool value);
53   bool getParameterBool(SALOMEDS::SObject_var sobject, const char * name);
54
55   static const int UNDEFINED = -1;
56
57 private:
58   SALOMEDS::StudyBuilder_var _sbuilder;
59 };
60
61 #endif // __STUDY_EDITOR_HXX__