Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / CAF / CAF_Application.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/
18 //
19 #ifndef CAF_APPLICATION_H
20 #define CAF_APPLICATION_H
21
22 #include "CAF.h"
23
24 #include "STD_Application.h"
25
26 #include <qmap.h>
27 #include <qptrlist.h>
28
29 #include <TDocStd_Application.hxx>
30
31 class QtxAction;
32 class CAF_Study;
33
34 #if defined WIN32
35 #pragma warning ( disable: 4251 )
36 #endif
37
38 /*!
39   \class CAF_Application
40   Defines application configuration and behaviour for application with 
41   link to standard OCC OCAF data model. Allows to use OCC OCAF serives
42   (for example, undo/redo)
43 */
44 class CAF_EXPORT CAF_Application : public STD_Application
45 {
46   Q_OBJECT
47
48 public:
49   CAF_Application();
50   CAF_Application( const Handle(TDocStd_Application)& );
51   virtual ~CAF_Application();
52
53   virtual QString             applicationName() const;
54
55   Handle(TDocStd_Application) stdApp() const;
56
57   virtual QString             getFileFilter() const;
58
59 public slots:  
60   virtual void                onHelpAbout();
61
62 protected slots:
63   virtual bool                onUndo( int );
64   virtual bool                onRedo( int );
65   
66 protected:
67   enum {  EditUndoId = STD_Application::UserID, EditRedoId, UserID };
68
69 protected:
70   virtual void                createActions();
71   virtual void                updateCommandsStatus();
72
73   virtual SUIT_Study*         createNewStudy();
74
75   bool                                          undo( CAF_Study* doc );
76   bool                                          redo( CAF_Study* doc );
77
78   virtual void                setStdApp( const Handle(TDocStd_Application)& );
79
80 private:
81   Handle(TDocStd_Application) myStdApp;
82 };
83
84 #if defined WIN32
85 #pragma warning ( default: 4251 )
86 #endif
87
88 #endif