r427: Changes for MDI support
[ctsim.git] / src / docs.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          docs.h
5 **   Purpose:       Header file for Document routines of CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: docs.h,v 1.12 2001/01/20 08:10:33 kevin Exp $
13 **
14 **  This program is free software; you can redistribute it and/or modify
15 **  it under the terms of the GNU General Public License (version 2) as
16 **  published by the Free Software Foundation.
17 **
18 **  This program is distributed in the hope that it will be useful,
19 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 **  GNU General Public License for more details.
22 **
23 **  You should have received a copy of the GNU General Public License
24 **  along with this program; if not, write to the Free Software
25 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 ******************************************************************************/
27
28 #ifdef __GNUG__
29 // #pragma interface
30 #endif
31
32 #ifndef __DOCSH__
33 #define __DOCSH__
34
35 #include "wx/docview.h"
36
37 #include "imagefile.h"
38 #include "phantom.h"
39 #include "projections.h"
40 #include "plotfile.h"
41
42 class ImageFileDocument: public wxDocument
43 {
44     DECLARE_DYNAMIC_CLASS(ImageFileDocument)
45 private:
46     ImageFile m_imageFile;
47
48 public:
49     virtual bool OnSaveDocument (const wxString& filename);
50     virtual bool OnOpenDocument (const wxString& filename);
51     virtual bool IsModified () const;
52     virtual void Modify (bool mod);
53     
54     ImageFileDocument () {}
55     ~ImageFileDocument () {}
56
57     const ImageFile& getImageFile() const
58         { return m_imageFile; }
59
60     ImageFile& getImageFile()
61         { return m_imageFile; }
62 };
63
64
65 class ProjectionFileDocument: public wxDocument
66 {
67     DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
68 private:
69     Projections m_projectionFile;
70
71 public:
72     virtual bool OnSaveDocument (const wxString& filename);
73     virtual bool OnOpenDocument (const wxString& filename);
74     virtual bool IsModified () const;
75     virtual void Modify (bool mod);
76     
77     ProjectionFileDocument () {}
78     ~ProjectionFileDocument () {}
79
80     const Projections& getProjections () const
81         { return m_projectionFile; }
82
83     Projections& getProjections ()
84         { return m_projectionFile; }
85 };
86
87
88 class PhantomDocument: public wxDocument
89 {
90     DECLARE_DYNAMIC_CLASS(PhantomDocument)
91
92 private:
93     Phantom m_phantom;
94     int m_idPhantom;
95     wxString m_namePhantom;
96
97 public:
98     PhantomDocument () 
99         : m_idPhantom(Phantom::PHM_INVALID)
100         {}
101
102     ~PhantomDocument () 
103         {}
104
105     const int getPhantomID () const
106         { return m_idPhantom; }
107
108     const wxString& getPhantomName () const
109         { return m_namePhantom; }
110
111     const Phantom& getPhantom () const
112         { return m_phantom; }
113
114     Phantom& getPhantom ()
115         { return m_phantom; }
116
117     virtual bool OnOpenDocument (const wxString& filename);
118     virtual bool OnSaveDocument (const wxString& filename);
119     virtual bool IsModified () const;
120     virtual void Modify (bool mod);
121 };
122
123
124 class PlotFileDocument: public wxDocument
125 {
126     DECLARE_DYNAMIC_CLASS(PlotFileDocument)
127
128 private:
129     PlotFile m_plot;
130     wxString m_namePlot;
131
132 public:
133     PlotFileDocument () 
134         {}
135
136     ~PlotFileDocument () 
137         {}
138
139     const wxString& getPlotName () const
140         { return m_namePlot; }
141
142     const PlotFile& getPlotFile () const
143         { return m_plot; }
144
145     PlotFile& getPlotFile ()
146         { return m_plot; }
147
148     virtual bool OnOpenDocument (const wxString& filename);
149     virtual bool OnSaveDocument (const wxString& filename);
150     virtual bool IsModified () const;
151     virtual void Modify (bool mod);
152 };
153
154
155 #endif