dataform.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/dataform.h
  3. // Purpose: declaration of the wxDataFormat class
  4. // Author: David Elliott <dfe@cox.net>
  5. // Modified by:
  6. // Created: 2003/07/23
  7. // Copyright: (c) 2003 David Elliott
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_DATAFORM_H__
  11. #define __WX_COCOA_DATAFORM_H__
  12. class wxDataFormat
  13. {
  14. public:
  15. wxDataFormat(unsigned int uFormat = wxDF_INVALID) { m_uFormat = uFormat; }
  16. wxDataFormat(const wxString& zFormat) { SetId(zFormat); }
  17. wxDataFormat& operator=(unsigned int uFormat) { m_uFormat = uFormat; return(*this); }
  18. wxDataFormat& operator=(const wxDataFormat& rFormat) {m_uFormat = rFormat.m_uFormat; return(*this); }
  19. //
  20. // Comparison (must have both versions)
  21. //
  22. bool operator==(wxDataFormatId eFormat) const { return (m_uFormat == (unsigned int)eFormat); }
  23. bool operator!=(wxDataFormatId eFormat) const { return (m_uFormat != (unsigned int)eFormat); }
  24. bool operator==(const wxDataFormat& rFormat) const { return (m_uFormat == rFormat.m_uFormat); }
  25. bool operator!=(const wxDataFormat& rFormat) const { return (m_uFormat != rFormat.m_uFormat); }
  26. operator unsigned int(void) const { return m_uFormat; }
  27. unsigned int GetFormatId(void) const { return (unsigned int)m_uFormat; }
  28. unsigned int GetType(void) const { return (unsigned int)m_uFormat; }
  29. bool IsStandard(void) const;
  30. void SetType(unsigned int uType){ m_uFormat = uType; }
  31. //
  32. // String ids are used for custom types - this SetId() must be used for
  33. // application-specific formats
  34. //
  35. wxString GetId(void) const;
  36. void SetId(const wxString& WXUNUSED(pId)) { /* TODO */ }
  37. private:
  38. unsigned int m_uFormat;
  39. }; // end of CLASS wxDataFormat
  40. #endif // __WX_COCOA_DATAFORM_H__