]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/dataform.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: gtk/dataform.h
3 // Purpose: declaration of the wxDataFormat class
4 // Author: Vadim Zeitlin
6 // Created: 19.10.99 (extracted from gtk/dataobj.h)
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GTK_DATAFORM_H
13 #define _WX_GTK_DATAFORM_H
18 // the clipboard formats under GDK are GdkAtoms
19 typedef GdkAtom NativeFormat
;
22 wxDataFormat( wxDataFormatId type
);
23 wxDataFormat( const wxString
&id
);
24 wxDataFormat( const wxChar
*id
);
25 wxDataFormat( NativeFormat format
);
27 wxDataFormat
& operator=(NativeFormat format
)
28 { SetId(format
); return *this; }
30 // comparison (must have both versions)
31 bool operator==(NativeFormat format
) const
32 { return m_format
== (NativeFormat
)format
; }
33 bool operator!=(NativeFormat format
) const
34 { return m_format
!= (NativeFormat
)format
; }
36 // explicit and implicit conversions to NativeFormat which is one of
37 // standard data types (implicit conversion is useful for preserving the
38 // compatibility with old code)
39 NativeFormat
GetFormatId() const { return m_format
; }
40 operator NativeFormat() const { return m_format
; }
42 void SetId( NativeFormat format
);
44 // string ids are used for custom types - this SetId() must be used for
45 // application-specific formats
46 wxString
GetId() const;
47 void SetId( const wxChar
*id
);
50 wxDataFormatId
GetType() const;
53 wxDataFormatId m_type
;
54 NativeFormat m_format
;
56 void PrepareFormats();
57 void SetType( wxDataFormatId type
);
60 #endif // _WX_GTK_DATAFORM_H