2002-02-05 11:34:33 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/x11/dataform.h
|
2002-02-05 11:34:33 -05:00
|
|
|
// Purpose: declaration of the wxDataFormat class
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// Created: 19.10.99 (extracted from motif/dataobj.h)
|
|
|
|
// Copyright: (c) 1999 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2002-02-05 11:34:33 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-02-23 16:26:16 -05:00
|
|
|
#ifndef _WX_X11_DATAFORM_H
|
|
|
|
#define _WX_X11_DATAFORM_H
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2005-08-02 14:16:51 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDataFormat
|
2002-02-05 11:34:33 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// the clipboard formats under Xt are Atoms
|
|
|
|
typedef Atom NativeFormat;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
wxDataFormat();
|
|
|
|
wxDataFormat( wxDataFormatId type );
|
|
|
|
wxDataFormat( const wxString &id );
|
|
|
|
wxDataFormat( NativeFormat format );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
wxDataFormat& operator=(NativeFormat format)
|
2002-02-23 16:26:16 -05:00
|
|
|
{ SetId(format); return *this; }
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// comparison (must have both versions)
|
|
|
|
bool operator==(NativeFormat format) const
|
2002-02-23 16:26:16 -05:00
|
|
|
{ return m_format == (NativeFormat)format; }
|
2002-02-05 11:34:33 -05:00
|
|
|
bool operator!=(NativeFormat format) const
|
2002-02-23 16:26:16 -05:00
|
|
|
{ return m_format != (NativeFormat)format; }
|
2002-02-05 11:34:33 -05:00
|
|
|
bool operator==(wxDataFormatId format) const
|
2002-02-23 16:26:16 -05:00
|
|
|
{ return m_type == (wxDataFormatId)format; }
|
2002-02-05 11:34:33 -05:00
|
|
|
bool operator!=(wxDataFormatId format) const
|
2002-02-23 16:26:16 -05:00
|
|
|
{ return m_type != (wxDataFormatId)format; }
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05: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; }
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
void SetId( NativeFormat format );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// string ids are used for custom types - this SetId() must be used for
|
|
|
|
// application-specific formats
|
|
|
|
wxString GetId() const;
|
2007-05-30 18:02:19 -04:00
|
|
|
void SetId( const wxString& id );
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// implementation
|
|
|
|
wxDataFormatId GetType() const;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
private:
|
|
|
|
wxDataFormatId m_type;
|
|
|
|
NativeFormat m_format;
|
2009-08-21 06:41:26 -04:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
void PrepareFormats();
|
|
|
|
void SetType( wxDataFormatId type );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-02-23 16:26:16 -05:00
|
|
|
#endif // _WX_X11_DATAFORM_H
|
2002-02-05 11:34:33 -05:00
|
|
|
|