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