Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/gui.git] / src / LightApp / LightApp_Operation.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : LightApp_Operation.h
23 //  Author : Sergey LITONIN
24 //  Module : LIGHT
25 //
26 #ifndef LightApp_Operation_H
27 #define LightApp_Operation_H
28
29 #include "LightApp.h"
30 #include <SUIT_Operation.h>
31
32 class LightApp_Module;
33 class LightApp_SelectionMgr;
34 class LightApp_Dialog;
35 class SUIT_Desktop;
36
37 /*!
38   \class LightApp_Operation
39   \brief Base class for all operations
40   Base class for all operations (see SUIT_Operation for more description)
41 */
42 class LIGHTAPP_EXPORT LightApp_Operation : public SUIT_Operation
43 {
44   Q_OBJECT
45
46 public:
47   LightApp_Operation();
48   virtual ~LightApp_Operation();
49
50   virtual void              setModule( LightApp_Module* );
51   LightApp_Module*          module() const;
52
53   bool                      isAutoResumed() const;
54
55   virtual LightApp_Dialog* dlg() const;
56
57 protected:
58
59   // Methods redefined from base class
60
61   virtual void              startOperation();
62   virtual void              suspendOperation();
63   virtual void              resumeOperation();
64   virtual void              abortOperation();
65   virtual void              commitOperation();
66
67   // Additional virtual methods may be redefined by derived classes
68   
69   virtual void              setDialogActive( const bool );
70   virtual void              activateSelection();
71   virtual void              selectionDone();
72
73
74   // Axiluary methods
75   
76   SUIT_Desktop*             desktop() const;
77   SUIT_Operation*           activeOperation() const;
78   LightApp_SelectionMgr*    selectionMgr() const;
79   void                      update( const int );
80   void                      setAutoResumed( const bool );
81       
82 private slots:
83
84   virtual void              onSelectionDone();
85
86 private:
87
88   LightApp_Module*          myModule;         
89   bool                      myIsAutoResumed;
90 };
91
92 #endif
93
94
95
96
97
98