Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/gui.git] / src / LightApp / LightApp_SwitchOp.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
20 #ifndef LightApp_SwitchOp_H
21 #define LightApp_SwitchOp_H
22
23 #include "LightApp.h"
24 #include <qobject.h>
25
26 class LightApp_Module;
27 class LightApp_Operation;
28 class QEvent;
29 class SUIT_Study;
30
31 /*!
32  * \brief This class is intended for controling switching between operation
33  *
34  * Several operation may be launched simultaneously. This class is intended for
35  * controlling switching between such operations. This class works with operations having
36  * dialogs (activation of other operations is performed by SUIT_Study). When several
37  * operations is launched simultaneously corresponding dialogs are shown on the screen.
38  * Only one operation from the launched ones can be active (active operation). Other
39  * operations are suspended. As result only one dialog from shown ones can be active too.
40  * Other dialogs are disabled. This class installs event filter on application. When mouse
41  * cursor is moved above disabled dialog corresponding event is catched by this class.
42  * It finds corresponding operation and verify whether operation can be resumed (see
43  * SUIT_Study::isDenied( SUIT_Operation* ) method). If yes then current active
44  * operation is suspended and new operation activated. Module contains this class as a
45  * field. Then module is created instance of this class created too.
46  */
47 class LIGHTAPP_EXPORT LightApp_SwitchOp : public QObject
48 {
49   Q_OBJECT
50
51 public:
52
53   LightApp_SwitchOp( LightApp_Module* );
54   virtual ~LightApp_SwitchOp();
55
56   // Redefined from base class
57   bool                     eventFilter( QObject*, QEvent* );
58
59 private:
60
61   LightApp_Module*         module() const;
62   LightApp_Operation*      operation( QWidget* ) const;
63   SUIT_Study*              study() const;
64   
65 private:
66   
67   LightApp_Module*         myModule;  
68
69 };
70
71 #endif
72
73
74
75
76
77