]>
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 #if wxUSE_STD_IOSTREAM
43 ostream
& SaveObject(ostream
& stream
);
44 istream
& LoadObject(istream
& stream
);
46 bool SaveObject(wxOutputStream
& stream
);
47 bool LoadObject(wxInputStream
& stream
);
52 class DrawingDocument
: public wxDocument
54 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
57 wxList doodleSegments
;
59 DrawingDocument(void);
60 ~DrawingDocument(void);
62 #if wxUSE_STD_IOSTREAM
63 ostream
& SaveObject(ostream
& stream
);
64 istream
& LoadObject(istream
& stream
);
66 bool SaveObject(wxOutputStream
& stream
);
67 bool LoadObject(wxInputStream
& stream
);
70 inline wxList
& GetDoodleSegments(void) const { return (wxList
&) doodleSegments
; };
76 class DrawingCommand
: public wxCommand
79 DoodleSegment
*segment
;
83 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*ddoc
, DoodleSegment
*seg
);
84 ~DrawingCommand(void);
90 class TextEditDocument
: public wxDocument
92 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
96 ostream& SaveObject(ostream& stream);
97 istream& LoadObject(istream& stream);
99 virtual bool OnSaveDocument(const wxString
& filename
);
100 virtual bool OnOpenDocument(const wxString
& filename
);
101 virtual bool IsModified(void) const;
102 virtual void Modify(bool mod
);
104 TextEditDocument(void) {}
105 ~TextEditDocument(void) {}