Salome HOME
a2dca72d77aff4ffcd810934cc2369f0fd49cd26
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Operation.h
1 // SMESH SMDS : implementaion of Salome mesh data structure
2 //
3 // Copyright (C) 2003  OPEN CASCADE
4 //
5 // This library is free software; you can redistribute it and/or 
6 // modify it under the terms of the GNU Lesser General Public 
7 // License as published by the Free Software Foundation; either 
8 // version 2.1 of the License. 
9 //
10 // This library is distributed in the hope that it will be useful, 
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 // Lesser General Public License for more details. 
14 //
15 // You should have received a copy of the GNU Lesser General Public 
16 // License along with this library; if not, write to the Free Software 
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 //
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //
21 // File   : SMESHGUI_Operation.h
22 // Author : Sergey LITONIN, Open CASCADE S.A.S.
23 //
24
25 #ifndef SMESHGUI_OPERATION_H
26 #define SMESHGUI_OPERATION_H
27
28 // SMESH includes
29 #include "SMESH_SMESHGUI.hxx"
30
31 // SALOME GUI includes
32 #include <LightApp_Operation.h>
33
34 // SALOME KERNEL includes
35 #include <SALOMEDSClient.hxx>
36
37 class SMESHGUI;
38
39 /*
40   Class       : SMESHGUI_Operation
41   Description : Base class for all SMESH operations
42 */
43
44 class SMESHGUI_EXPORT SMESHGUI_Operation : public LightApp_Operation
45 {
46   Q_OBJECT
47
48 public:
49   SMESHGUI_Operation();
50   virtual ~SMESHGUI_Operation();
51
52 protected:
53   //! sets the dialog widgets to state just after operation start
54   virtual void      initDialog();
55
56   virtual void      startOperation();
57   virtual bool      isReadyToStart() const;
58   
59   //! Set according dialog active or inactive
60   virtual void      setDialogActive( const bool );
61
62   SMESHGUI*         getSMESHGUI() const;
63   bool              isStudyLocked( const bool = true ) const;
64
65   _PTR(Study)       studyDS() const;
66   
67   virtual bool      isValid( SUIT_Operation* ) const;
68
69   QString           myHelpFileName;
70
71 protected slots:
72   virtual void      onOk();
73   virtual bool      onApply();
74   virtual void      onCancel();
75   void              onHelp();
76 };
77
78 #endif // SMESHGUI_OPERATION_H