Salome HOME
b3e22cf0ebca3a291c4ffcdd2044161fc8f1f4fc
[modules/yacs.git] / src / salomegui / Yacsgui.hxx
1 // Copyright (C) 2006-2016  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 _YACSGUI_HXX_
21 #define _YACSGUI_HXX_
22
23 #include "SalomeWrap_Module.hxx"
24 #include "Yacsgui_Resource.hxx"
25 #include <SALOMEconfig.h>
26
27 #include <QModelIndex>
28 #include <map>
29
30 namespace YACS
31 {
32   namespace HMI
33   {
34     class GenericGui;
35     class SuitWrapper;
36     class QtGuiContext;
37   }
38 }
39
40 class SalomeApp_Application;
41 class SUIT_ViewWindow;
42
43 class Yacsgui: public SalomeWrap_Module
44 {
45   Q_OBJECT
46
47   friend class Yacsgui_Resource;
48
49 public:
50   Yacsgui();
51   virtual ~Yacsgui();
52
53   void initialize( CAM_Application* app);
54   void windows( QMap<int, int>& theMap) const;
55   virtual QString  engineIOR() const;
56
57   virtual void viewManagers( QStringList& list) const;
58   virtual void setResource(SUIT_ResourceMgr* r);
59   virtual void createPreferences();
60   virtual void preferencesChanged( const QString& sect, const QString& name );
61   virtual void loadSchema(const std::string& filename,bool edit=true, bool arrangeLocalNodes=false);
62   
63 public slots:
64   bool deactivateModule( SUIT_Study* theStudy);
65   bool activateModule( SUIT_Study* theStudy);
66   void onDblClick(SUIT_DataObject* object);
67   void onCleanOnExit();
68   
69 protected slots:
70   void onWindowActivated( SUIT_ViewWindow* svw);
71   void onWindowClosed( SUIT_ViewWindow* svw);
72   void onTryClose(bool &isClosed, QxScene_ViewWindow* window);
73
74 protected:
75   virtual  CAM_DataModel* createDataModel();
76   bool createSComponent(); 
77
78   YACS::HMI::SuitWrapper* _wrapper;
79   YACS::HMI::GenericGui* _genericGui;
80   bool _selectFromTree;
81   Yacsgui_Resource* _myresource;
82   SUIT_ViewWindow* _currentSVW;
83   YACS::HMI::QtGuiContext* _studyContextMap;
84 };
85
86 #endif