+#if wxUSE_DATAOBJ
+
+/*!
+ * The data object for a wxRichTextBuffer
+ */
+
+class WXDLLIMPEXP_RICHTEXT wxRichTextBufferDataObject: public wxDataObjectSimple
+{
+public:
+ // ctor doesn't copy the pointer, so it shouldn't go away while this object
+ // is alive
+ wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = (wxRichTextBuffer*) NULL);
+ virtual ~wxRichTextBufferDataObject();
+
+ // after a call to this function, the buffer is owned by the caller and it
+ // is responsible for deleting it
+ wxRichTextBuffer* GetRichTextBuffer();
+
+ // Returns the id for the new data format
+ static const wxChar* GetRichTextBufferFormatId() { return ms_richTextBufferFormatId; }
+
+ // base class pure virtuals
+
+ virtual wxDataFormat GetPreferredFormat(Direction dir) const;
+ virtual size_t GetDataSize() const;
+ virtual bool GetDataHere(void *pBuf) const;
+ virtual bool SetData(size_t len, const void *buf);
+
+ // prevent warnings
+
+ virtual size_t GetDataSize(const wxDataFormat&) const { return GetDataSize(); }
+ virtual bool GetDataHere(const wxDataFormat&, void *buf) const { return GetDataHere(buf); }
+ virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) { return SetData(len, buf); }
+
+private:
+ wxDataFormat m_formatRichTextBuffer; // our custom format
+ wxRichTextBuffer* m_richTextBuffer; // our data
+ static const wxChar* ms_richTextBufferFormatId; // our format id
+};
+
+#endif
+
+/*!
+ * wxRichTextRenderer isolates common drawing functionality
+ */
+
+class WXDLLIMPEXP_RICHTEXT wxRichTextRenderer: public wxObject
+{
+public:
+ wxRichTextRenderer() {}
+ virtual ~wxRichTextRenderer() {}
+
+ /// Draw a standard bullet, as specified by the value of GetBulletName
+ virtual bool DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect) = 0;
+
+ /// Draw a bullet that can be described by text, such as numbered or symbol bullets
+ virtual bool DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect, const wxString& text) = 0;
+
+ /// Draw a bitmap bullet, where the bullet bitmap is specified by the value of GetBulletName
+ virtual bool DrawBitmapBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect) = 0;
+
+ /// Enumerate the standard bullet names currently supported
+ virtual bool EnumerateStandardBulletNames(wxArrayString& bulletNames) = 0;
+};
+
+/*!
+ * wxRichTextStdRenderer: standard renderer
+ */
+
+class WXDLLIMPEXP_RICHTEXT wxRichTextStdRenderer: public wxRichTextRenderer
+{
+public:
+ wxRichTextStdRenderer() {}
+
+ /// Draw a standard bullet, as specified by the value of GetBulletName
+ virtual bool DrawStandardBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect);
+
+ /// Draw a bullet that can be described by text, such as numbered or symbol bullets
+ virtual bool DrawTextBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect, const wxString& text);
+
+ /// Draw a bitmap bullet, where the bullet bitmap is specified by the value of GetBulletName
+ virtual bool DrawBitmapBullet(wxRichTextParagraph* paragraph, wxDC& dc, const wxTextAttrEx& attr, const wxRect& rect);
+
+ /// Enumerate the standard bullet names currently supported
+ virtual bool EnumerateStandardBulletNames(wxArrayString& bulletNames);
+};
+