X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLightApp%2FLightApp_Application.h;h=763eede7bab23cd5e08aa8d813b8a8385ccb0c32;hb=e92e0d5063cefa8bcd7a1f09cfc07f03d9742e06;hp=392fc791fa7699e3c3c62924895d77d2254f4722;hpb=57812a608a7a7e30ee5911ca2f5845d87ea8721d;p=modules%2Fgui.git diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 392fc791f..763eede7b 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -36,10 +36,12 @@ #include #include +#include #include #include class LogWindow; +class QtxInfoPanel; #ifndef DISABLE_PYCONSOLE class PyConsole_Console; class PyConsole_Interp; @@ -49,6 +51,7 @@ class LightApp_Preferences; class LightApp_SelectionMgr; class LightApp_FullScreenHelper; class LightApp_DataObject; +class LightApp_ModuleAction; class SUIT_DataBrowser; class SUIT_Study; class SUIT_Accel; @@ -75,6 +78,7 @@ class LIGHTAPP_EXPORT LightApp_Application : public CAM_Application, public SUIT public: typedef enum { WT_ObjectBrowser, + WT_InfoPanel, #ifndef DISABLE_PYCONSOLE WT_PyConsole, #endif @@ -88,7 +92,8 @@ public: CloseId, CloseAllId, GroupAllId, PreferencesId, MRUId, ModulesListId, NewGLViewId, NewPlot2dId, NewOCCViewId, NewVTKViewId, - NewQxSceneViewId, NewGraphicsViewId, NewPVViewId, StyleId, FullScreenId, + NewQxSceneViewId, NewGraphicsViewId, NewPVViewId, NewPyViewerId, NewPV3DViewId, StyleId, FullScreenId, + WebSiteId, ForumId, VideosId, TutorialsId, UserID }; protected: @@ -110,6 +115,7 @@ public: LogWindow* logWindow(); SUIT_DataBrowser* objectBrowser(); + QtxInfoPanel* infoPanel(); #ifndef DISABLE_PYCONSOLE PyConsole_Console* pythonConsole(const bool force = false); #endif @@ -118,7 +124,7 @@ public: LightApp_Preferences* preferences() const; - virtual QString getFileFilter() const; + virtual QString getFileFilter( bool ) const; virtual QString getFileName( bool open, const QString& initial, const QString& filters, const QString& caption, QWidget* parent ); @@ -131,11 +137,11 @@ public: SUIT_ViewManager* getViewManager( const QString&, const bool ); virtual void addViewManager( SUIT_ViewManager* ); virtual void removeViewManager( SUIT_ViewManager* ); - virtual SUIT_ViewManager* createViewManager( const QString& vmType ); + virtual SUIT_ViewManager* createViewManager( const QString& vmType, bool detached = false ); virtual SUIT_ViewManager* createViewManager( const QString& vmType, QWidget* w ); virtual SUIT_ViewManager* createViewManager( SUIT_ViewModel* ); - QWidget* getWindow( const int, const int = -1 ); + QWidget* getWindow( const int ); QWidget* dockWindow( const int ) const; void removeDockWindow( const int ); void insertDockWindow( const int, QWidget* ); @@ -154,8 +160,6 @@ public: void setDefaultStudyName( const QString& theName ); - static int studyId(); - virtual bool event( QEvent* ); virtual bool checkDataObject( LightApp_DataObject* theObj ); @@ -180,15 +184,19 @@ public: void emitOperationFinished( const QString&, const QString&, const QStringList& ); void updateVisibilityState( DataObjectList& theList, - SUIT_ViewModel* theViewModel ); + SUIT_ViewModel* theViewModel ); + + void updatePresentations( const QString& theComponent, + const QStringList& theViewManagerTypes ); - virtual bool checkExistingDoc(); + virtual bool checkExistingDoc( bool = true ); #ifndef DISABLE_PYCONSOLE PyConsole_Interp* getPyInterp(); #endif signals: + void moduleActivated( const QString& ); void studyOpened(); void studySaved(); void studyClosed(); @@ -207,9 +215,13 @@ public slots: virtual void onCopy(); virtual void onPaste(); virtual void onSelectionChanged(); + virtual void onDockWindowVisibilityChanged( bool ); protected: + void showHelp( const QString& ); virtual void createActions(); + virtual void addExtensionsActions(LightApp_ModuleAction* moduleAction); + virtual void customize(); virtual void createActionForViewer( const int id, const int parentId, const QString& suffix, @@ -222,9 +234,12 @@ protected: virtual void setActiveStudy( SUIT_Study* ); virtual void updateCommandsStatus(); + virtual bool canOpenDoc( const QString& ); + virtual void beforeCloseDoc( SUIT_Study* ); virtual void afterCloseDoc(); virtual void moduleAdded( CAM_Module* ); + virtual void moduleDeactivated( CAM_Module* ); virtual bool activateModule( CAM_Module* = 0 ); LightApp_Preferences* preferences( const bool ) const; @@ -241,13 +256,18 @@ protected: virtual PyConsole_Interp* createPyInterp(); #endif + virtual void addCatalogue( const QString&, const QString& ) {} + protected slots: virtual void onDesktopActivated(); virtual void onViewManagerRemoved( SUIT_ViewManager* ); virtual void onWindowActivated( SUIT_ViewWindow* theViewWindow ); void onNewWindow(); - void onModuleActivation( const QString& ); + virtual void onModuleActivation( const QString& ); + void onExtAdding(); + void onExtRemoving( const QString& ); + void onShowExtInfo(); void onCloseView( SUIT_ViewManager* ); virtual void onStudyCreated( SUIT_Study* ); @@ -264,6 +284,8 @@ protected slots: virtual void onDesktopMessage( const QString& ); + virtual void onInfoPanelShown(); + private slots: void onSelection(); void onRefresh(); @@ -275,12 +297,14 @@ private slots: void onCloseAllWindow(); void onGroupAllWindow(); void onRenamed(); + //void onMoved(); protected: void updateWindows(); void updateViewManagers(); void updateModuleActions(); - void removeModuleAction( const QString& ); + + bool checkModule( const QString& ); void loadDockWindowsState(); void saveDockWindowsState(); @@ -294,9 +318,7 @@ protected: QString defaultModule() const; virtual void currentWindows( QMap& ) const; void currentViewManagers( QStringList& ) const; - void moduleIconNames( QMap& ) const; - - bool isLibExists( const QString& ) const; + QPixmap moduleIcon( const QString&, const int = -1 ) const; QDockWidget* windowDock( QWidget* ) const; QByteArray dockWindowsState( const QMap&, const QMap& ) const; @@ -306,22 +328,29 @@ protected: virtual bool openAction( const int, const QString& ); void showPreferences( const QString& = QString() ); + void showPreferences( const QStringList& ); private: + bool addUserModule( const QString&, const QString&, bool = false ); + void removeUserModule(const QString& moduleInnerName, LightApp_ModuleAction* moduleAction); void emptyPreferences( const QString& ); QList findToolBars( const QStringList& names = QStringList() ); - - QByteArray processState(QByteArray& input, - const bool processWin, - const bool processTb, - const bool isRestoring, - QByteArray defaultState = QByteArray()); + void createHelpItems( const QString& ); + void removeHelpItems( const QString& ); + + QByteArray processState(QByteArray& input, + const bool processWin, + const bool processTb, + const bool isRestoring, + QByteArray defaultState = QByteArray()); protected: - typedef QPointer WinPtr; - typedef QMap WinMap; - typedef QMap WinVis; - typedef QMap WinGeom; + typedef QPointer WinPtr; + typedef QMap WinMap; + typedef QMap WinVis; + typedef QMap WinGeom; + typedef QList IdList; + typedef QMap IdMap; enum { OpenReload = CAM_Application::OpenExist + 1 }; @@ -333,14 +362,16 @@ protected: WinMap myWin; WinVis myWinVis; + IdMap myHelpItems; SUIT_Accel* myAccel; QTimer* myAutoSaveTimer; static LightApp_Preferences* _prefs_; - static int lastStudyId; QStringList myUserWmTypes; + + friend void LightAppCleanUpAppResources(); }; #ifdef WIN32