typedef <integral type> NativeFormat;
wxDataFormat(NativeFormat format = wxDF_INVALID);
- wxDataFormat(const wxChar *format);
+ wxDataFormat(const wxString& format);
wxDataFormat& operator=(NativeFormat format);
wxDataFormat& operator=(const wxDataFormat& format);
NativeFormat GetType() const;
wxString GetId() const;
- void SetId(const wxChar *format);
+ void SetId(const wxString& format);
};
*/
#include "wx/msw/ole/dataform.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dataform.h"
-#elif defined(__WXGTK__)
+#elif defined(__WXGTK20__)
#include "wx/gtk/dataform.h"
+#elif defined(__WXGTK__)
+ #include "wx/gtk1/dataform.h"
#elif defined(__WXX11__)
#include "wx/x11/dataform.h"
#elif defined(__WXMAC__)
#include "wx/motif/dataobj.h"
#elif defined(__WXX11__)
#include "wx/x11/dataobj.h"
-#elif defined(__WXGTK__)
+#elif defined(__WXGTK20__)
#include "wx/gtk/dataobj.h"
+#elif defined(__WXGTK__)
+ #include "wx/gtk1/dataobj.h"
#elif defined(__WXMAC__)
#include "wx/mac/dataobj.h"
#elif defined(__WXCOCOA__)
// 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)
};
#if defined(__WXMSW__)
#include "wx/msw/ole/dataobj2.h"
-
// wxURLDataObject defined in msw/ole/dataobj2.h
-#else // !__WXMSW__
+#elif defined(__WXGTK20__)
+ #include "wx/gtk/dataobj2.h"
+ // wxURLDataObject defined in msw/ole/dataobj2.h
+
+#else
#if defined(__WXGTK__)
- #include "wx/gtk/dataobj2.h"
+ #include "wx/gtk1/dataobj2.h"
#elif defined(__WXX11__)
#include "wx/x11/dataobj2.h"
#elif defined(__WXMOTIF__)
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); }
};
-#endif // __WXMSW__/!__WXMSW__
+#endif
#endif // wxUSE_DATAOBJ