X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e1a688e3e9c6c265620e4f05d579077367e9fdb..9869c26285dc51d13607cddaa04f65ce983653a5:/include/wx/os2/dataform.h?ds=sidebyside diff --git a/include/wx/os2/dataform.h b/include/wx/os2/dataform.h index 2bcddb8680..1d6896c247 100644 --- a/include/wx/os2/dataform.h +++ b/include/wx/os2/dataform.h @@ -1,11 +1,10 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: gtk/dataform.h +// Name: wx/os2/dataform.h // Purpose: declaration of the wxDataFormat class -// Author: David Webster (lifted from dnd.h) +// Author: Stefan Csomor // Modified by: // Created: 10/21/99 -// RCS-ID: $Id$ -// Copyright: (c) 1999 David Webster +// Copyright: (c) 1999 Stefan Csomor // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -15,46 +14,37 @@ class wxDataFormat { public: - // the clipboard formats under GDK are GdkAtoms - typedef unsigned short NativeFormat; + wxDataFormat(unsigned int uFormat = wxDF_INVALID) { m_uFormat = uFormat; } + wxDataFormat(const wxString& zFormat) { SetId(zFormat); } - wxDataFormat(); - wxDataFormat( wxDataFormatId type ); - wxDataFormat( const wxString &id ); - wxDataFormat( const wxChar *id ); - wxDataFormat( NativeFormat format ); + wxDataFormat& operator=(unsigned int uFormat) { m_uFormat = uFormat; return(*this); } + wxDataFormat& operator=(const wxDataFormat& rFormat) {m_uFormat = rFormat.m_uFormat; return(*this); } - wxDataFormat& operator=(NativeFormat format) - { SetId(format); return *this; } + // + // Comparison (must have both versions) + // + bool operator==(wxDataFormatId eFormat) const { return (m_uFormat == (unsigned int)eFormat); } + bool operator!=(wxDataFormatId eFormat) const { return (m_uFormat != (unsigned int)eFormat); } + bool operator==(const wxDataFormat& rFormat) const { return (m_uFormat == rFormat.m_uFormat); } + bool operator!=(const wxDataFormat& rFormat) const { return (m_uFormat != rFormat.m_uFormat); } + operator unsigned int(void) const { return m_uFormat; } - // comparison (must have both versions) - bool operator==(NativeFormat format) const - { return m_format == (NativeFormat)format; } - bool operator!=(NativeFormat format) const - { return m_format != (NativeFormat)format; } + unsigned int GetFormatId(void) const { return (unsigned int)m_uFormat; } + unsigned int GetType(void) const { return (unsigned int)m_uFormat; } - // explicit and implicit conversions to NativeFormat which is one of - // standard data types (implicit conversion is useful for preserving the - // compatibility with old code) - NativeFormat GetFormatId() const { return m_format; } - operator NativeFormat() const { return m_format; } + bool IsStandard(void) const; - void SetId( NativeFormat format ); + void SetType(unsigned int uType){ m_uFormat = uType; } - // string ids are used for custom types - this SetId() must be used for + // + // String ids are used for custom types - this SetId() must be used for // application-specific formats - wxString GetId() const; - void SetId( const wxChar *id ); - - // implementation - wxDataFormatId GetType() const; + // + wxString GetId(void) const; + void SetId(const wxString& pId); private: - wxDataFormatId m_type; - NativeFormat m_format; - - void PrepareFormats(); - void SetType( wxDataFormatId type ); -}; + unsigned int m_uFormat; +}; // end of CLASS wxDataFormat #endif // _WX_GTK_DATAFORM_H