X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/526954c5968baa29218c994ec48e476ae2bd4b9f..e0dec8753abaf97e006ea1185bfb6775b28df0a8:/samples/docview/doc.h?ds=sidebyside diff --git a/samples/docview/doc.h b/samples/docview/doc.h index 5c9de7378c..c654398222 100644 --- a/samples/docview/doc.h +++ b/samples/docview/doc.h @@ -166,7 +166,7 @@ class wxTextDocument : public wxDocument public: wxTextDocument() : wxDocument() { } - virtual bool OnCreate(const wxString& path, long flags); + virtual bool OnCreate(const wxString& path, long flags); virtual wxTextCtrl* GetTextCtrl() const = 0; @@ -198,14 +198,19 @@ public: }; // ---------------------------------------------------------------------------- -// A document class representing an image +// Image and image details document classes (both are read-only for simplicity) // ---------------------------------------------------------------------------- +// This is a normal document containing an image, just like TextEditDocument +// above contains some text. It can be created from an image file on disk as +// usual. class ImageDocument : public wxDocument { public: ImageDocument() : wxDocument() { } + virtual bool OnOpenDocument(const wxString& file); + wxImage GetImage() const { return m_image; } protected: @@ -218,4 +223,28 @@ private: DECLARE_DYNAMIC_CLASS(ImageDocument) }; +// This is a child document of ImageDocument: this document doesn't +// correspond to any file on disk, it's part of ImageDocument and can't be +// instantiated independently of it. +class ImageDetailsDocument : public wxDocument +{ +public: + ImageDetailsDocument(ImageDocument *parent); + + // accessors for ImageDetailsView + wxSize GetSize() const { return m_size; } + unsigned long GetNumColours() const { return m_numColours; } + wxBitmapType GetType() const { return m_type; } + bool HasAlpha() const { return m_hasAlpha; } + +private: + // some information about the image we choose to show to the user + wxSize m_size; + unsigned long m_numColours; + wxBitmapType m_type; + bool m_hasAlpha; + + wxDECLARE_NO_COPY_CLASS(ImageDetailsDocument); +}; + #endif // _WX_SAMPLES_DOCVIEW_DOC_H_