1999-10-21 18:37:14 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
1999-11-09 10:24:52 -05:00
|
|
|
// Name: mac/dataform.h
|
1999-10-21 18:37:14 -04:00
|
|
|
// Purpose: declaration of the wxDataFormat class
|
1999-11-09 10:24:52 -05:00
|
|
|
// Author: Stefan Csomor
|
1999-10-21 18:37:14 -04:00
|
|
|
// Modified by:
|
|
|
|
// Created: 10/21/99
|
|
|
|
// RCS-ID: $Id$
|
1999-11-09 10:24:52 -05:00
|
|
|
// Copyright: (c) 1999 Stefan Csomor
|
1999-10-21 18:37:14 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_OS2_DATAFORM_H
|
|
|
|
#define _WX_OS2_DATAFORM_H
|
|
|
|
|
|
|
|
class wxDataFormat
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// the clipboard formats under GDK are GdkAtoms
|
|
|
|
typedef unsigned short NativeFormat;
|
|
|
|
|
|
|
|
wxDataFormat();
|
1999-10-22 18:00:20 -04:00
|
|
|
wxDataFormat(wxDataFormatId vType);
|
|
|
|
wxDataFormat(const wxString& rId);
|
|
|
|
wxDataFormat(const wxChar* pId);
|
|
|
|
wxDataFormat(NativeFormat vFormat);
|
1999-10-21 18:37:14 -04:00
|
|
|
|
1999-10-22 18:00:20 -04:00
|
|
|
wxDataFormat& operator=(NativeFormat vFormat)
|
|
|
|
{ SetId(vFormat); return *this; }
|
1999-10-21 18:37:14 -04:00
|
|
|
|
|
|
|
// comparison (must have both versions)
|
1999-10-22 18:00:20 -04:00
|
|
|
bool operator==(NativeFormat vFormat) const
|
|
|
|
{ return m_vFormat == (NativeFormat)vFormat; }
|
|
|
|
bool operator!=(NativeFormat vFormat) const
|
|
|
|
{ return m_vFormat != (NativeFormat)vFormat; }
|
1999-10-21 18:37:14 -04: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)
|
1999-10-22 18:00:20 -04:00
|
|
|
NativeFormat GetFormatId() const { return m_vFormat; }
|
|
|
|
operator NativeFormat() const { return m_vFormat; }
|
1999-10-21 18:37:14 -04:00
|
|
|
|
1999-10-22 18:00:20 -04:00
|
|
|
void SetId(NativeFormat vFormat);
|
1999-10-21 18:37:14 -04:00
|
|
|
|
|
|
|
// string ids are used for custom types - this SetId() must be used for
|
|
|
|
// application-specific formats
|
|
|
|
wxString GetId() const;
|
1999-10-22 18:00:20 -04:00
|
|
|
void SetId(const wxChar* pId);
|
1999-10-21 18:37:14 -04:00
|
|
|
|
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
|
|
|
|
|
|
|
private:
|
1999-10-22 00:40:12 -04:00
|
|
|
wxDataFormatId m_vType;
|
|
|
|
NativeFormat m_vFormat;
|
1999-10-21 18:37:14 -04:00
|
|
|
|
|
|
|
void PrepareFormats();
|
1999-10-22 18:00:20 -04:00
|
|
|
void SetType(wxDataFormatId vType);
|
1999-10-21 18:37:14 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GTK_DATAFORM_H
|