Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/gui.git] / src / SalomeApp / SalomeApp_Application.h
1 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
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 // File:      SalomeApp_Application.h
20 // Created:   10/22/2004 3:37:25 PM
21 // Author:    Sergey LITONIN
22 // Copyright (C) CEA 2004
23
24 #ifndef SALOMEAPP_APPLICATION_H
25 #define SALOMEAPP_APPLICATION_H
26
27 #if _MSC_VER > 1000
28 #pragma once
29 #endif // _MSC_VER > 1000
30
31 #include "SalomeApp.h"
32 #include <LightApp_Application.h>
33
34 #include <CORBA.h>
35
36 #include <SALOMEconfig.h>
37 //#include CORBA_CLIENT_HEADER(SALOMEDS)
38 #include <SALOME_NamingService.hxx>
39
40 #include "SALOMEDSClient.hxx"
41
42 class QAction;
43 class QComboBox;
44 class QDockWindow;
45
46 class LightApp_Preferences;
47 class SalomeApp_Module;
48 class SalomeApp_Study;
49
50 class SALOME_LifeCycleCORBA;
51
52 class QListViewItem;
53
54 #ifdef WIN32
55 #pragma warning( disable:4251 )
56 #endif
57
58 /*!
59   \class SalomeApp_Application
60   \brief Application containing SalomeApp module or LightApp module
61 */
62
63 class SALOMEAPP_EXPORT SalomeApp_Application : public LightApp_Application
64 {
65   Q_OBJECT
66
67 public:
68   enum { MenuToolsId = 5 };
69   enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
70          CatalogGenId, RegDisplayId, SaveGUIStateId, UserID };
71
72 public:
73   SalomeApp_Application();
74   virtual ~SalomeApp_Application();
75
76   virtual void                        updateObjectBrowser( const bool = true );
77
78   virtual QString                     getFileFilter() const;
79
80   virtual void                        start();
81
82   virtual void                        contextMenuPopup( const QString&, QPopupMenu*, QString& );
83
84   static CORBA::ORB_var               orb();
85   static SALOMEDSClient_StudyManager* studyMgr();
86   static SALOME_NamingService*        namingService();
87   static SALOME_LifeCycleCORBA*       lcc();
88   static QString                      defaultEngineIOR();
89
90   SUIT_ViewManager*                   newViewManager(const QString&);
91   void                                updateSavePointDataObjects( SalomeApp_Study* );
92
93 public slots:
94   virtual bool                        onOpenDoc( const QString& );
95   virtual void                        onLoadDoc();
96   virtual bool                        onLoadDoc( const QString& );
97   virtual void                        onCopy();
98   virtual void                        onPaste();
99   void                                onSaveGUIState();// called from VISU
100
101 protected slots:
102   void                                onStudySaved( SUIT_Study* );
103   void                                onStudyOpened( SUIT_Study* );
104
105 protected:
106   virtual void                        createActions();
107   virtual SUIT_Study*                 createNewStudy();
108   virtual QWidget*                    createWindow( const int );
109
110   virtual void                        updateCommandsStatus();
111   virtual void                        onSelectionChanged();
112
113   virtual void                        createPreferences( LightApp_Preferences* );
114   virtual void                        updateDesktopTitle();
115
116 private slots:
117   void                                onDeleteInvalidReferences();
118   void                                onDblClick( QListViewItem* );
119   void                                onProperties();
120   void                                onDumpStudy();
121   void                                onLoadScript(); 
122
123   void                                onDeleteGUIState(); 
124   void                                onRestoreGUIState();
125   void                                onRenameGUIState();
126
127   void                                onCatalogGen();
128   void                                onRegDisplay();
129   void                                onOpenWith();
130 };
131
132 #ifdef WIN32
133 #pragma warning( default:4251 )
134 #endif
135
136 #endif