// one if preferred == true
void Add(wxDataObjectSimple *dataObject, bool preferred = false);
+ // Report the format passed to the SetData method. This should be the
+ // format of the data object within the composite that recieved data from
+ // the clipboard or the DnD operation. You can use this method to find
+ // out what kind of data object was recieved.
+ wxDataFormat GetReceivedFormat() const;
+
// implement base class pure virtuals
// ----------------------------------
virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction dir = Get) const;
virtual size_t GetDataSize(const wxDataFormat& format) const;
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
virtual bool SetData(const wxDataFormat& format, size_t len, const void *buf);
-
-protected:
- // returns the pointer to the object which supports this format or NULL
- wxDataObjectSimple *GetObject(const wxDataFormat& format) const;
#if defined(__WXMSW__)
virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size,
const wxDataFormat& format );
virtual size_t GetBufferOffset( const wxDataFormat& format );
#endif
+protected:
+ // returns the pointer to the object which supports this format or NULL
+ wxDataObjectSimple *GetObject(const wxDataFormat& format) const;
+
private:
// the list of all (simple) data objects whose formats we support
wxSimpleDataObjectList m_dataObjects;
// one is the preferred)
size_t m_preferred;
+ wxDataFormat m_receivedFormat;
+
DECLARE_NO_COPY_CLASS(wxDataObjectComposite)
};
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t len, const void *buf);
-
- size_t GetDataSize(const wxDataFormat& format) const
- { return(wxDataObjectSimple::GetDataSize(format)); }
- bool GetDataHere(const wxDataFormat& format, void *pBuf) const
- { return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
- bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
- { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
+ // Must provide overloads to avoid hiding them (and warnings about it)
+ 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);
+ }
#endif
private:
// get a reference to our array
const wxArrayString& GetFilenames() const { return m_filenames; }
- // the Get() functions do nothing for us
- virtual size_t GetDataSize() const { return 0; }
- virtual bool GetDataHere(void *WXUNUSED(buf)) const { return false; }
-
protected:
wxArrayString m_filenames;
-private:
- // Virtual function hiding supression
- size_t GetDataSize(const wxDataFormat& format) const
- { return(wxDataObjectSimple::GetDataSize(format)); }
- bool GetDataHere(const wxDataFormat& format, void* pBuf) const
- { return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
-
DECLARE_NO_COPY_CLASS(wxFileDataObjectBase)
};
virtual size_t GetDataSize() const;
virtual bool GetDataHere(void *buf) const;
virtual bool SetData(size_t size, const void *buf);
+ // Must provide overloads to avoid hiding them (and warnings about it)
+ 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:
size_t m_size;
void *m_data;
- // virtual function hiding supression
- size_t GetDataSize(const wxDataFormat& format) const
- { return(wxDataObjectSimple::GetDataSize(format)); }
- bool GetDataHere(const wxDataFormat& format, void* pBuf) const
- { return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
- bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
- { return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
-
DECLARE_NO_COPY_CLASS(wxCustomDataObject)
};
class WXDLLEXPORT wxURLDataObject : public wxTextDataObject
{
public:
+ wxURLDataObject(const wxString& url = wxEmptyString)
+ : wxTextDataObject(url)
+ {
+ }
+
wxString GetURL() const { return GetText(); }
void SetURL(const wxString& url) { SetText(url); }
};