1 /*****************************************************************************
5 ** Purpose: Header file for Document routines of CTSim program
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: July 2000
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: docs.h,v 1.13 2001/01/20 17:43:41 kevin Exp $
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.
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.
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 ******************************************************************************/
35 #include "wx/docview.h"
37 #include "imagefile.h"
39 #include "projections.h"
43 class ImageFileDocument: public wxDocument
45 DECLARE_DYNAMIC_CLASS(ImageFileDocument)
47 ImageFile m_imageFile;
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);
55 ImageFileDocument () {}
56 ~ImageFileDocument () {}
58 const ImageFile& getImageFile() const
59 { return m_imageFile; }
61 ImageFile& getImageFile()
62 { return m_imageFile; }
66 class ProjectionFileDocument: public wxDocument
68 DECLARE_DYNAMIC_CLASS(ProjectionFileDocument)
70 Projections m_projectionFile;
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);
78 ProjectionFileDocument () {}
79 ~ProjectionFileDocument () {}
81 const Projections& getProjections () const
82 { return m_projectionFile; }
84 Projections& getProjections ()
85 { return m_projectionFile; }
89 class PhantomDocument: public wxDocument
91 DECLARE_DYNAMIC_CLASS(PhantomDocument)
96 wxString m_namePhantom;
100 : m_idPhantom(Phantom::PHM_INVALID)
106 const int getPhantomID () const
107 { return m_idPhantom; }
109 const wxString& getPhantomName () const
110 { return m_namePhantom; }
112 const Phantom& getPhantom () const
113 { return m_phantom; }
115 Phantom& getPhantom ()
116 { return m_phantom; }
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);
125 class PlotFileDocument: public wxDocument
127 DECLARE_DYNAMIC_CLASS(PlotFileDocument)
140 const wxString& getPlotName () const
141 { return m_namePlot; }
143 const PlotFile& getPlotFile () const
146 PlotFile& getPlotFile ()
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);
157 class TextEditDocument: public wxDocument
160 DECLARE_DYNAMIC_CLASS(TextEditDocument)
163 TextEditDocument(void) {}
164 ~TextEditDocument(void) {}
166 virtual bool OnSaveDocument(const wxString& filename);
167 virtual bool OnOpenDocument(const wxString& filename);
168 virtual bool IsModified(void) const;
170 wxTextCtrl* getTextCtrl()
171 { return dynamic_cast<TextEditView*>(GetFirstView())->getTextCtrl(); }