1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/dataform.h
3 // Purpose: declaration of the wxDataFormat class
4 // Author: Robert Roebling
6 // Created: 19.10.99 (extracted from motif/dataobj.h)
7 // Copyright: (c) 1999 Robert Roebling
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MOTIF_DATAFORM_H
12 #define _WX_MOTIF_DATAFORM_H
14 class WXDLLIMPEXP_CORE wxDataFormat
17 // the clipboard formats under Xt are Atoms
18 typedef Atom NativeFormat
;
21 wxDataFormat( wxDataFormatId type
);
22 wxDataFormat( const wxString
&id
);
23 wxDataFormat( NativeFormat format
);
25 wxDataFormat
& operator=(NativeFormat format
)
26 { SetId(format
); return *this; }
28 // comparison (must have both versions)
29 bool operator==(NativeFormat format
) const
30 { return m_format
== (NativeFormat
)format
; }
31 bool operator!=(NativeFormat format
) const
32 { return m_format
!= (NativeFormat
)format
; }
33 bool operator==(wxDataFormatId format
) const
34 { return m_type
== (wxDataFormatId
)format
; }
35 bool operator!=(wxDataFormatId format
) const
36 { return m_type
!= (wxDataFormatId
)format
; }
38 // explicit and implicit conversions to NativeFormat which is one of
39 // standard data types (implicit conversion is useful for preserving the
40 // compatibility with old code)
41 NativeFormat
GetFormatId() const { return m_format
; }
42 operator NativeFormat() const { return m_format
; }
44 void SetId( NativeFormat format
);
46 // string ids are used for custom types - this SetId() must be used for
47 // application-specific formats
48 wxString
GetId() const;
49 void SetId( const wxString
& id
);
52 wxDataFormatId
GetType() const;
55 wxDataFormatId m_type
;
56 NativeFormat m_format
;
58 void PrepareFormats();
59 void SetType( wxDataFormatId type
);
63 #endif // _WX_MOTIF_DATAFORM_H