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