- wxPrivateDataObject();
-
- ~wxPrivateDataObject();
-
- virtual wxDataFormat GetFormat() const
- { return wxDF_PRIVATE; }
-
- // the string ID identifies the format of clipboard or DnD data. a word
- // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
- // to the clipboard - the latter with the Id "WXWORD_FORMAT".
-
- void SetId( const wxString& id )
- { m_id = id; }
-
- wxString GetId() const
- { return m_id; }
-
- // will make internal copy
- void SetData( const char *data, size_t size );
-
- size_t GetDataSize() const
- { return m_size; }
-
- char* GetData() const
- { return m_data; }
-
-private:
- size_t m_size;
- char* m_data;
- wxString m_id;
+ /* default constructor. call SetText() later or override
+ WriteData() and GetSize() for working on-demand */
+ wxTextDataObject();
+
+ /* constructor */
+ wxTextDataObject( const wxString& data );
+
+ /* set current text data */
+ void SetText( const wxString& data );
+
+ /* get current text data */
+ wxString GetText() const;
+
+ /* by default calls WriteString() with string set by constructor or
+ by SetText(). can be overridden for working on-demand */
+ virtual void WriteData( void *dest ) const;
+
+ /* by default, returns length of string as set by constructor or
+ by SetText(). can be overridden for working on-demand */
+ virtual size_t GetSize() const;
+
+ /* write string to dest */
+ void WriteString( const wxString &str, void *dest ) const;
+
+ /* implementation */
+
+ wxString m_data;