Salome HOME
Initial version
[modules/gui.git] / src / CAF / CAF_Study.h
1 #ifndef CAF_STUDY_H
2 #define CAF_STUDY_H
3
4 #include "CAF.h"
5
6 #include "SUIT_Study.h"
7
8 #include <qobject.h>
9 #include <qptrstack.h>
10
11 #include <TDocStd_Document.hxx>
12
13 #if defined WNT
14 #pragma warning ( disable: 4251 )
15 #endif
16
17 class CAF_EXPORT CAF_Study : public SUIT_Study
18 {
19   Q_OBJECT
20
21 public:
22         CAF_Study( SUIT_Application* theApp );
23         CAF_Study( SUIT_Application* theApp, Handle (TDocStd_Document)& aStdDoc );
24         virtual ~CAF_Study();
25
26         virtual bool startOperation();
27         virtual void abortOperation();
28         virtual void commitOperation();
29
30         bool         isSaved() const;
31         bool         isModified() const;
32         void         doModified( bool undoable = true);
33         void         undoModified();
34         void         clearModified();
35
36   bool         undo();
37         bool         redo();
38         bool         canUndo() const;
39         bool         canRedo() const;
40         QStringList  undoNames() const;
41         QStringList  redoNames() const;
42
43   void         setStdDocument( Handle(TDocStd_Document)& aStdDoc ) { myStdDoc = aStdDoc; }
44   Handle(TDocStd_Document) getStdDocument() { return myStdDoc; }
45
46 protected:
47         Handle(TDocStd_Document) myStdDoc;
48         int                      myModifiedCnt;
49
50   friend class CAF_Operation;
51 };
52
53 #if defined WNT
54 #pragma warning ( default: 4251 )
55 #endif
56
57 #endif