]>
git.saurik.com Git - wxWidgets.git/blob - samples/docview/doc.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Document classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #ifndef __DOCSAMPLEH__
17 #define __DOCSAMPLEH__
19 #include "wx/docview.h"
21 // Plots a line from one point to the other
22 class DoodleLine
: public wxObject
31 // Contains a list of lines: represents a mouse-down doodle
32 class DoodleSegment
: public wxObject
38 DoodleSegment(DoodleSegment
& seg
);
42 ostream
& SaveObject(ostream
& stream
);
43 istream
& LoadObject(istream
& stream
);
46 class DrawingDocument
: public wxDocument
48 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
51 wxList doodleSegments
;
53 DrawingDocument(void);
54 ~DrawingDocument(void);
56 ostream
& SaveObject(ostream
& stream
);
57 istream
& LoadObject(istream
& stream
);
59 inline wxList
& GetDoodleSegments(void) const { return (wxList
&) doodleSegments
; };
65 class DrawingCommand
: public wxCommand
68 DoodleSegment
*segment
;
72 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*ddoc
, DoodleSegment
*seg
);
73 ~DrawingCommand(void);
79 class TextEditDocument
: public wxDocument
81 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
85 ostream& SaveObject(ostream& stream);
86 istream& LoadObject(istream& stream);
88 virtual bool OnSaveDocument(const wxString
& filename
);
89 virtual bool OnOpenDocument(const wxString
& filename
);
90 virtual bool IsModified(void) const;
91 virtual void Modify(bool mod
);
93 TextEditDocument(void) {}
94 ~TextEditDocument(void) {}