]>
git.saurik.com Git - wxWidgets.git/blob - samples/docview/doc.h
66132371c3dc63ede888e6296fb1198cab922fbf
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Document classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/docview.h"
16 #include "wx/cmdproc.h"
18 // Plots a line from one point to the other
19 class DoodleLine
: public wxObject
28 // Contains a list of lines: represents a mouse-down doodle
29 class DoodleSegment
: public wxObject
34 DoodleSegment() : wxObject() {}
35 DoodleSegment(const DoodleSegment
& seg
);
36 virtual ~DoodleSegment();
39 #if wxUSE_STD_IOSTREAM
40 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
41 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
43 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
44 wxInputStream
& LoadObject(wxInputStream
& stream
);
49 class DrawingDocument
: public wxDocument
51 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
54 wxList m_doodleSegments
;
56 DrawingDocument() : wxDocument() {}
57 virtual ~DrawingDocument();
59 #if wxUSE_STD_IOSTREAM
60 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
61 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
63 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
64 wxInputStream
& LoadObject(wxInputStream
& stream
);
67 inline wxList
& GetDoodleSegments() const { return (wxList
&) m_doodleSegments
; };
73 class DrawingCommand
: public wxCommand
76 DoodleSegment
* m_segment
;
77 DrawingDocument
* m_doc
;
80 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*, DoodleSegment
*);
81 virtual ~DrawingCommand();
88 class TextEditDocument
: public wxDocument
90 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
92 TextEditDocument() : wxDocument() {}
93 virtual ~TextEditDocument() {}
95 wxSTD ostream& SaveObject(wxSTD ostream&);
96 wxSTD istream& LoadObject(wxSTD istream&);
98 TextEditView
* GetFirstView() const;
100 virtual bool DoSaveDocument(const wxString
& filename
);
101 virtual bool DoOpenDocument(const wxString
& filename
);
102 virtual bool IsModified(void) const;
103 virtual void Modify(bool mod
);