r428: no message
[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.13 2001/01/20 17:43:41 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
43 class ImageFileDocument: public wxDocument
44 {
45     DECLARE_DYNAMIC_CLASS(ImageFileDocument)
46 private:
47     ImageFile m_imageFile;
48
49 public:
50     virtual bool OnSaveDocument (const wxString& filename);
51     virtual bool OnOpenDocument (const wxString& filename);
52     virtual bool IsModified () const;
53     virtual void Modify (bool mod);
54     
55     ImageFileDocument () {}
56     ~ImageFileDocument () {}
57
58     const ImageFile& getImageFile() const
59         { return m_imageFile; }
60
61     ImageFile& getImageFile()
62         { return m_imageFile; }
63 };
64
65
66 class ProjectionFileDocument: public wxDocument
67 {
68     DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
69 private:
70     Projections m_projectionFile;
71
72 public:
73     virtual bool OnSaveDocument (const wxString& filename);
74     virtual bool OnOpenDocument (const wxString& filename);
75     virtual bool IsModified () const;
76     virtual void Modify (bool mod);
77     
78     ProjectionFileDocument () {}
79     ~ProjectionFileDocument () {}
80
81     const Projections& getProjections () const
82         { return m_projectionFile; }
83
84     Projections& getProjections ()
85         { return m_projectionFile; }
86 };
87
88
89 class PhantomDocument: public wxDocument
90 {
91     DECLARE_DYNAMIC_CLASS(PhantomDocument)
92
93 private:
94     Phantom m_phantom;
95     int m_idPhantom;
96     wxString m_namePhantom;
97
98 public:
99     PhantomDocument () 
100         : m_idPhantom(Phantom::PHM_INVALID)
101         {}
102
103     ~PhantomDocument () 
104         {}
105
106     const int getPhantomID () const
107         { return m_idPhantom; }
108
109     const wxString& getPhantomName () const
110         { return m_namePhantom; }
111
112     const Phantom& getPhantom () const
113         { return m_phantom; }
114
115     Phantom& getPhantom ()
116         { return m_phantom; }
117
118     virtual bool OnOpenDocument (const wxString& filename);
119     virtual bool OnSaveDocument (const wxString& filename);
120     virtual bool IsModified () const;
121     virtual void Modify (bool mod);
122 };
123
124
125 class PlotFileDocument: public wxDocument
126 {
127     DECLARE_DYNAMIC_CLASS(PlotFileDocument)
128
129 private:
130     PlotFile m_plot;
131     wxString m_namePlot;
132
133 public:
134     PlotFileDocument () 
135         {}
136
137     ~PlotFileDocument () 
138         {}
139
140     const wxString& getPlotName () const
141         { return m_namePlot; }
142
143     const PlotFile& getPlotFile () const
144         { return m_plot; }
145
146     PlotFile& getPlotFile ()
147         { return m_plot; }
148
149     virtual bool OnOpenDocument (const wxString& filename);
150     virtual bool OnSaveDocument (const wxString& filename);
151     virtual bool IsModified () const;
152     virtual void Modify (bool mod);
153 };
154
155 #include "views.h"
156
157 class TextEditDocument: public wxDocument
158 {
159  private:
160   DECLARE_DYNAMIC_CLASS(TextEditDocument)
161
162  public:
163   TextEditDocument(void) {}
164   ~TextEditDocument(void) {}
165
166   virtual bool OnSaveDocument(const wxString& filename);
167   virtual bool OnOpenDocument(const wxString& filename);
168   virtual bool IsModified(void) const;
169
170   wxTextCtrl* getTextCtrl()
171   { return dynamic_cast<TextEditView*>(GetFirstView())->getTextCtrl(); }
172 };
173
174
175 #endif