1999-12-03 09:40:17 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2000-08-09 07:02:59 -04:00
|
|
|
// Name: mac/dataform.h
|
1999-12-03 09:40:17 -05:00
|
|
|
// Purpose: declaration of the wxDataFormat class
|
2000-08-09 07:02:59 -04:00
|
|
|
// Author: Stefan Csomor (lifted from dnd.h)
|
1999-12-03 09:40:17 -05:00
|
|
|
// Modified by:
|
|
|
|
// Created: 10/21/99
|
|
|
|
// RCS-ID: $Id$
|
2000-08-09 07:02:59 -04:00
|
|
|
// Copyright: (c) 1999 Stefan Csomor
|
1999-12-03 09:40:17 -05:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-08-09 07:02:59 -04:00
|
|
|
#ifndef _WX_MAC_DATAFORM_H
|
|
|
|
#define _WX_MAC_DATAFORM_H
|
1999-12-03 09:40:17 -05:00
|
|
|
|
|
|
|
class wxDataFormat
|
|
|
|
{
|
|
|
|
public:
|
2000-08-09 07:02:59 -04:00
|
|
|
typedef OSType NativeFormat;
|
1999-12-03 09:40:17 -05:00
|
|
|
|
|
|
|
wxDataFormat();
|
|
|
|
wxDataFormat(wxDataFormatId vType);
|
|
|
|
wxDataFormat(const wxString& rId);
|
|
|
|
wxDataFormat(const wxChar* pId);
|
|
|
|
wxDataFormat(NativeFormat vFormat);
|
|
|
|
|
|
|
|
wxDataFormat& operator=(NativeFormat vFormat)
|
|
|
|
{ SetId(vFormat); return *this; }
|
|
|
|
|
|
|
|
// comparison (must have both versions)
|
2000-08-09 07:02:59 -04:00
|
|
|
bool operator==(NativeFormat format) const
|
|
|
|
{ return m_format == (NativeFormat)format; }
|
|
|
|
bool operator!=(NativeFormat format) const
|
|
|
|
{ return m_format != (NativeFormat)format; }
|
|
|
|
bool operator==(wxDataFormatId format) const
|
|
|
|
{ return m_type == (wxDataFormatId)format; }
|
|
|
|
bool operator!=(wxDataFormatId format) const
|
|
|
|
{ return m_type != (wxDataFormatId)format; }
|
1999-12-03 09:40:17 -05:00
|
|
|
|
|
|
|
// explicit and implicit conversions to NativeFormat which is one of
|
|
|
|
// standard data types (implicit conversion is useful for preserving the
|
|
|
|
// compatibility with old code)
|
2000-08-09 07:02:59 -04:00
|
|
|
NativeFormat GetFormatId() const { return m_format; }
|
|
|
|
operator NativeFormat() const { return m_format; }
|
1999-12-03 09:40:17 -05:00
|
|
|
|
2000-08-09 07:02:59 -04:00
|
|
|
void SetId(NativeFormat format);
|
1999-12-03 09:40:17 -05:00
|
|
|
|
|
|
|
// string ids are used for custom types - this SetId() must be used for
|
|
|
|
// application-specific formats
|
|
|
|
wxString GetId() const;
|
|
|
|
void SetId(const wxChar* pId);
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
2000-08-09 07:02:59 -04:00
|
|
|
void SetType( wxDataFormatId type );
|
1999-12-03 09:40:17 -05:00
|
|
|
|
|
|
|
private:
|
2000-08-09 07:02:59 -04:00
|
|
|
wxDataFormatId m_type;
|
|
|
|
NativeFormat m_format;
|
1999-12-03 09:40:17 -05:00
|
|
|
};
|
|
|
|
|
2000-08-09 07:02:59 -04:00
|
|
|
#endif // _WX_MAC_DATAFORM_H
|