Salome HOME
ced55c5b1ff7066392a5f77e3376efc4a10b8c20
[modules/kernel.git] / src / SALOMEGUI / SALOMEGUI_Application.h
1 //  File      : SALOMEGUI_Application.h
2 //  Created   : Thu Jun 14 12:01:23 2001
3 //  Author    : Nicolas REJNERI
4 //  Project   : SALOME
5 //  Module    : SALOMEGUI
6 //  Copyright : Open CASCADE
7 //  $Header$
8
9 #ifndef SALOMEGUI_APPLICATION_H
10 #define SALOMEGUI_APPLICATION_H
11
12 #include "QAD_Application.h"
13 #include "QAD_ViewFrame.h"
14
15 // IDL headers
16 #include <SALOMEconfig.h>
17 #include CORBA_SERVER_HEADER(SALOMEDS)
18 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
19
20 // QT Includes
21 #include <qlist.h>
22 #include <qaction.h>
23 #include <qstring.h>
24 #include <qtoolbar.h>
25 #include <qpopupmenu.h>
26
27 class SALOMEGUI_Application : public QAD_Application
28 {
29   Q_OBJECT
30     enum { ViewToolBarId = 100 };
31   
32     enum { ViewDumpId, ViewTrihedronId, ViewFitAllId, ViewFitAreaId,
33            ViewZoomId, ViewPanId, ViewRotateId, ViewGlobalPanId,
34            ViewFrontId, ViewBackId, ViewTopId, ViewBottomId, ViewLeftId,
35            ViewRightId, ViewResetId };
36 public:
37         SALOMEGUI_Application ( const QString& format,
38                                 const QString& description,
39                                 const QString& filters);
40         ~SALOMEGUI_Application();
41 public slots:
42   // Common display services
43   void    onDisplay(int);
44   void    onErase();
45
46 protected:
47     /* application management */
48     bool    initApp( SALOME_NamingService* name_service );
49     bool    createDesktop( SALOME_NamingService* name_service );
50
51     /* popup */
52     void    onCreatePopup();
53
54     /* document management */
55     void    onStudyCreated( QAD_Study* );
56     void    onStudyOpened( QAD_Study* );
57     void    onActiveStudyChanged( QAD_Study* oldActiveStudy,
58                                   QAD_Study* newActiveStudy );
59     void    onStudyShown( QAD_Study* );
60
61     /* menu management */
62     int     onUpdateViewActions ( QPopupMenu*, bool add, int index );
63
64 private slots:
65     void    onDesktopCreated();
66
67 private:
68     void    connectToViewer( QAD_ViewFrame* );
69     void    disconnectFromViewer( QAD_ViewFrame* );
70     void    createActions();
71     void    updateActions();
72
73 private:
74     QList<QAction>          myViewActions;
75     QAD_Operation*          myCurOperation;
76 };
77
78 #endif
79