1999-10-21 00:25:42 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2006-07-25 14:31:55 +00:00
|
|
|
// Name: wx/motif/dataform.h
|
1999-10-21 00:25:42 +00:00
|
|
|
// 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
|
|
|
|
|
2005-08-03 00:53:09 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxDataFormat
|
1999-10-21 00:25:42 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-10-27 19:01:58 +00:00
|
|
|
// the clipboard formats under Xt are Atoms
|
|
|
|
typedef Atom NativeFormat;
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
wxDataFormat();
|
|
|
|
wxDataFormat( wxDataFormatId type );
|
|
|
|
wxDataFormat( const wxString &id );
|
1999-10-27 19:01:58 +00:00
|
|
|
wxDataFormat( NativeFormat format );
|
2006-07-25 14:31:55 +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; }
|
2006-07-25 14:31:55 +00:00
|
|
|
|
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; }
|
2006-07-25 14:31:55 +00:00
|
|
|
|
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; }
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
void SetId( NativeFormat format );
|
2006-07-25 14:31:55 +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;
|
2007-05-30 22:02:19 +00:00
|
|
|
void SetId( const wxString& id );
|
2006-07-25 14:31:55 +00:00
|
|
|
|
1999-10-27 19:01:58 +00:00
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
2006-07-25 14:31:55 +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;
|
2006-07-25 14:31:55 +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
|