Salome HOME
Copyrights update
[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 class CAF_EXPORT CAF_Application : public STD_Application
39 {
40   Q_OBJECT
41
42 public:
43   CAF_Application();
44   CAF_Application( const Handle(TDocStd_Application)& );
45   virtual ~CAF_Application();
46
47   virtual QString             applicationName() const;
48
49   Handle(TDocStd_Application) stdApp() const;
50
51   virtual QString             getFileFilter() const;
52
53 public slots:  
54   virtual void                onHelpAbout();
55
56 protected slots:
57   virtual bool                onUndo( int );
58   virtual bool                onRedo( int );
59   
60 protected:
61   enum {  EditUndoId = STD_Application::UserID, EditRedoId, UserID };
62
63 protected:
64   virtual void                createActions();
65   virtual void                updateCommandsStatus();
66
67   virtual SUIT_Study*         createNewStudy();
68
69   bool                                          undo( CAF_Study* doc );
70   bool                                          redo( CAF_Study* doc );
71
72   virtual void                setStdApp( const Handle(TDocStd_Application)& );
73
74 private:
75   Handle(TDocStd_Application) myStdApp;
76 };
77
78 #if defined WIN32
79 #pragma warning ( default: 4251 )
80 #endif
81
82 #endif