1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File: SalomeApp_Application.h
23 // Created: 10/22/2004 3:37:25 PM
24 // Author: Sergey LITONIN
26 #ifndef SALOMEAPP_APPLICATION_H
27 #define SALOMEAPP_APPLICATION_H
31 #endif // _MSC_VER > 1000
33 #include "SalomeApp.h"
34 #include <LightApp_Application.h>
38 //#include <SALOMEconfig.h>
39 //#include CORBA_CLIENT_HEADER(SALOMEDS)
40 #include <SALOME_NamingService.hxx>
42 #include "SALOMEDSClient.hxx"
44 class LightApp_Preferences;
45 class SalomeApp_Study;
46 class SalomeApp_NoteBookDlg;
47 class SUIT_DataObject;
49 class SALOME_LifeCycleCORBA;
53 #pragma warning( disable:4251 )
57 \class SalomeApp_Application
58 \brief Application containing SalomeApp module or LightApp module
61 class SALOMEAPP_EXPORT SalomeApp_Application : public LightApp_Application
66 enum { MenuToolsId = 5 };
67 enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
68 CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, NoteBookId, UserID };
71 enum { OpenRefresh = LightApp_Application::OpenReload + 1 };
72 enum { CloseUnload = LightApp_Application::CloseDiscard + 1 };
73 enum { LoadStudyId = LightApp_Application::OpenStudyId + 1 };
76 SalomeApp_Application();
77 virtual ~SalomeApp_Application();
79 virtual void updateObjectBrowser( const bool = true );
81 virtual QString getFileFilter() const;
85 virtual void contextMenuPopup( const QString&, QMenu*, QString& );
87 virtual bool checkDataObject(LightApp_DataObject* theObj);
89 static CORBA::ORB_var orb();
90 static SALOMEDSClient_StudyManager* studyMgr();
91 static SALOME_NamingService* namingService();
92 static SALOME_LifeCycleCORBA* lcc();
93 static QString defaultEngineIOR();
95 SUIT_ViewManager* newViewManager(const QString&);
96 void updateSavePointDataObjects( SalomeApp_Study* );
98 virtual bool isPossibleToClose( bool& );
100 virtual bool useStudy( const QString& );
101 virtual void updateDesktopTitle();
103 virtual void setNoteBook(SalomeApp_NoteBookDlg* theNoteBook);
104 virtual SalomeApp_NoteBookDlg* getNoteBook() const;
107 virtual void onLoadDoc();
108 virtual bool onLoadDoc( const QString& );
109 virtual void onCloseDoc( bool ask = true);
111 virtual void onExit();
112 virtual void onCopy();
113 virtual void onPaste();
114 void onSaveGUIState();// called from VISU
117 void onStudyCreated( SUIT_Study* );
118 void onStudySaved( SUIT_Study* );
119 void onStudyOpened( SUIT_Study* );
120 void onDesktopMessage( const QString& );
123 virtual void createActions();
124 virtual SUIT_Study* createNewStudy();
125 virtual QWidget* createWindow( const int );
127 virtual void updateCommandsStatus();
128 virtual void onSelectionChanged();
130 virtual void createPreferences( LightApp_Preferences* );
132 virtual bool closeAction( const int, bool& );
133 virtual int closeChoice( const QString& );
135 virtual int openChoice( const QString& );
136 virtual bool openAction( const int, const QString& );
138 virtual QMap<int, QString> activateModuleActions() const;
139 virtual void moduleActionSelected( const int );
141 void objectBrowserColumnsVisibility();
144 void onDeleteInvalidReferences();
145 void onDblClick( SUIT_DataObject* );
151 void onDeleteGUIState();
152 void onRestoreGUIState();
153 void onRenameGUIState();
160 SalomeApp_NoteBookDlg* myNoteBook;
164 #pragma warning( default:4251 )