1999-10-20 20:25:42 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2006-07-25 10:31:55 -04:00
|
|
|
// Name: wx/motif/dataform.h
|
1999-10-20 20:25:42 -04:00
|
|
|
// 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
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-10-20 20:25:42 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_MOTIF_DATAFORM_H
|
|
|
|
#define _WX_MOTIF_DATAFORM_H
|
|
|
|
|
2005-08-02 20:53:09 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDataFormat
|
1999-10-20 20:25:42 -04:00
|
|
|
{
|
|
|
|
public:
|
1999-10-27 15:01:58 -04:00
|
|
|
// the clipboard formats under Xt are Atoms
|
|
|
|
typedef Atom NativeFormat;
|
2006-07-25 10:31:55 -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 );
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
wxDataFormat& operator=(NativeFormat format)
|
2002-02-05 11:34:33 -05:00
|
|
|
{ SetId(format); return *this; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
// comparison (must have both versions)
|
|
|
|
bool operator==(NativeFormat format) const
|
2002-02-05 11:34:33 -05:00
|
|
|
{ return m_format == (NativeFormat)format; }
|
1999-10-27 15:01:58 -04:00
|
|
|
bool operator!=(NativeFormat format) const
|
2002-02-05 11:34:33 -05:00
|
|
|
{ return m_format != (NativeFormat)format; }
|
1999-10-27 15:01:58 -04:00
|
|
|
bool operator==(wxDataFormatId format) const
|
2002-02-05 11:34:33 -05:00
|
|
|
{ return m_type == (wxDataFormatId)format; }
|
1999-10-27 15:01:58 -04:00
|
|
|
bool operator!=(wxDataFormatId format) const
|
2002-02-05 11:34:33 -05:00
|
|
|
{ return m_type != (wxDataFormatId)format; }
|
2006-07-25 10:31:55 -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; }
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
void SetId( NativeFormat format );
|
2006-07-25 10:31:55 -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 );
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
private:
|
1999-10-27 15:01:58 -04:00
|
|
|
wxDataFormatId m_type;
|
|
|
|
NativeFormat m_format;
|
2006-07-25 10:31:55 -04:00
|
|
|
|
1999-10-27 15:01:58 -04:00
|
|
|
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
|