Salome HOME
Has functionality from SalomeApp without dependency from CORBA
[modules/gui.git] / src / LightApp / LightApp_SwitchOp.h
1 /**
2 *  LIGHT LightApp
3 *
4 *  Copyright (C) 2005  CEA/DEN, EDF R&D
5 *
6 *
7 *
8 *  File   : LightApp_SwitchOp.h
9 *  Author : Sergey LITONIN
10 *  Module : LIGHT
11 */
12
13
14
15 #ifndef LightApp_SwitchOp_H
16 #define LightApp_SwitchOp_H
17
18 #include "LightApp.h"
19 #include <qobject.h>
20
21 class LightApp_Module;
22 class LightApp_Operation;
23 class QEvent;
24 class SUIT_Study;
25
26 /*!
27  * \brief This class is intended for controling switching between operation
28  *
29  * Several operation may be launched simultaneously. This class is intended for
30  * controlling switching between such operations. This class works with operations having
31  * dialogs (activation of other operations is performed by SUIT_Study). When several
32  * operations is launched simultaneously corresponding dialogs are shown on the screen.
33  * Only one operation from the launched ones can be active (active operation). Other
34  * operations are suspended. As result only one dialog from shown ones can be active too.
35  * Other dialogs are disabled. This class installs event filter on application. When mouse
36  * cursor is moved above disabled dialog corresponding event is catched by this class.
37  * It finds corresponding operation and verify whether operation can be resumed (see
38  * SUIT_Study::isDenied( SUIT_Operation* ) method). If yes then current active
39  * operation is suspended and new operation activated. Module contains this class as a
40  * field. Then module is created instance of this class created too.
41  */
42 class LIGHTAPP_EXPORT LightApp_SwitchOp : public QObject
43 {
44   Q_OBJECT
45
46 public:
47
48   LightApp_SwitchOp( LightApp_Module* );
49   virtual ~LightApp_SwitchOp();
50
51   // Redefined from base class
52   bool                     eventFilter( QObject*, QEvent* );
53
54 private:
55
56   LightApp_Module*         module() const;
57   LightApp_Operation*      operation( QWidget* ) const;
58   SUIT_Study*              study() const;
59   
60 private:
61   
62   LightApp_Module*         myModule;  
63
64 };
65
66 #endif
67
68
69
70
71
72