1999-10-20 20:25:42 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: motif/dataform.h
|
|
|
|
// Purpose: declaration of the wxDataFormat class
|
1999-10-27 15:01:58 -04:00
|
|
|
// Author: Robert Roebling
|
1999-10-20 20:25:42 -04:00
|
|
|
// Modified by:
|
|
|
|
// Created: 19.10.99 (extracted from motif/dataobj.h)
|
|
|
|
// RCS-ID: $Id$
|
1999-10-27 15:01:58 -04:00
|
|
|
// Copyright: (c) 1999 Robert Roebling
|
1999-10-20 20:25:42 -04:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_MOTIF_DATAFORM_H
|
|
|
|
#define _WX_MOTIF_DATAFORM_H
|
|
|
|
|
|
|
|
class wxDataFormat
|
|
|
|
{
|
|
|
|
public:
|
1999-10-27 15:01:58 -04:00
|
|
|
// the clipboard formats under Xt are Atoms
|
|
|
|
typedef Atom NativeFormat;
|
1999-10-21 16:16:53 -04:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
wxDataFormat();
|
|
|
|
wxDataFormat( wxDataFormatId type );
|
|
|
|
wxDataFormat( const wxString &id );
|
|
|
|
wxDataFormat( const wxChar *id );
|
1999-10-27 15:01:58 -04:00
|
|
|
wxDataFormat( NativeFormat format );
|
1999-10-20 20:25:42 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
wxDataFormat& operator=(NativeFormat format)
|
|
|
|
{ SetId(format); return *this; }
|
1999-10-20 20:25:42 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
// 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; }
|
|
|
|
bool operator==(wxDataFormatId format) const
|
|
|
|
{ return m_type == (wxDataFormatId)format; }
|
|
|
|
bool operator!=(wxDataFormatId format) const
|
|
|
|
{ return m_type != (wxDataFormatId)format; }
|
1999-10-20 20:25:42 -04:00
|
|
|
|
1999-10-27 15:01:58 -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)
|
|
|
|
NativeFormat GetFormatId() const { return m_format; }
|
|
|
|
operator NativeFormat() const { return m_format; }
|
1999-10-20 20:25:42 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
void SetId( NativeFormat format );
|
1999-10-20 20:25:42 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
// string ids are used for custom types - this SetId() must be used for
|
|
|
|
// application-specific formats
|
|
|
|
wxString GetId() const;
|
|
|
|
void SetId( const wxChar *id );
|
1999-10-20 20:25:42 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
1999-10-20 20:25:42 -04:00
|
|
|
|
|
|
|
private:
|
1999-10-27 15:01:58 -04:00
|
|
|
wxDataFormatId m_type;
|
|
|
|
NativeFormat m_format;
|
|
|
|
|
|
|
|
void PrepareFormats();
|
|
|
|
void SetType( wxDataFormatId type );
|
1999-10-20 20:25:42 -04:00
|
|
|
};
|
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
#endif // _WX_MOTIF_DATAFORM_H
|
|
|
|
|