1999-10-21 00:25:42 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: motif/dataform.h
|
|
|
|
// Purpose: declaration of the wxDataFormat class
|
1999-10-27 19:01:58 +00:00
|
|
|
// Author: Robert Roebling
|
1999-10-21 00:25:42 +00:00
|
|
|
// Modified by:
|
|
|
|
// Created: 19.10.99 (extracted from motif/dataobj.h)
|
|
|
|
// RCS-ID: $Id$
|
1999-10-27 19:01:58 +00:00
|
|
|
// Copyright: (c) 1999 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-10-21 00:25:42 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_MOTIF_DATAFORM_H
|
|
|
|
#define _WX_MOTIF_DATAFORM_H
|
|
|
|
|
|
|
|
class wxDataFormat
|
|
|
|
{
|
|
|
|
public:
|
1999-10-27 19:01:58 +00:00
|
|
|
// the clipboard formats under Xt are Atoms
|
|
|
|
typedef Atom NativeFormat;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
wxDataFormat();
|
|
|
|
wxDataFormat( wxDataFormatId type );
|
|
|
|
wxDataFormat( const wxString &id );
|
|
|
|
wxDataFormat( const wxChar *id );
|
1999-10-27 19:01:58 +00:00
|
|
|
wxDataFormat( NativeFormat format );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
wxDataFormat& operator=(NativeFormat format)
|
2002-02-05 16:34:33 +00:00
|
|
|
{ SetId(format); return *this; }
|
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
// comparison (must have both versions)
|
|
|
|
bool operator==(NativeFormat format) const
|
2002-02-05 16:34:33 +00:00
|
|
|
{ return m_format == (NativeFormat)format; }
|
1999-10-27 19:01:58 +00:00
|
|
|
bool operator!=(NativeFormat format) const
|
2002-02-05 16:34:33 +00:00
|
|
|
{ return m_format != (NativeFormat)format; }
|
1999-10-27 19:01:58 +00:00
|
|
|
bool operator==(wxDataFormatId format) const
|
2002-02-05 16:34:33 +00:00
|
|
|
{ return m_type == (wxDataFormatId)format; }
|
1999-10-27 19:01:58 +00:00
|
|
|
bool operator!=(wxDataFormatId format) const
|
2002-02-05 16:34:33 +00:00
|
|
|
{ return m_type != (wxDataFormatId)format; }
|
|
|
|
|
1999-10-27 19:01:58 +00: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; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
void SetId( NativeFormat format );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 19:01:58 +00: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 );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
private:
|
1999-10-27 19:01:58 +00:00
|
|
|
wxDataFormatId m_type;
|
|
|
|
NativeFormat m_format;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
void PrepareFormats();
|
|
|
|
void SetType( wxDataFormatId type );
|
1999-10-21 00:25:42 +00:00
|
|
|
};
|
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
#endif // _WX_MOTIF_DATAFORM_H
|
|
|
|
|