]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dataform.h
03f04a76c7becfa07cfcc5164b930cc36a1c32d6
[wxWidgets.git] / include / wx / motif / dataform.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: motif/dataform.h
3 // Purpose: declaration of the wxDataFormat class
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 19.10.99 (extracted from motif/dataobj.h)
7 // RCS-ID: $Id$
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MOTIF_DATAFORM_H
13 #define _WX_MOTIF_DATAFORM_H
14
15 class wxDataFormat
16 {
17 public:
18 typedef unsigned long /* Atom */ NativeFormat;
19
20 wxDataFormat();
21 wxDataFormat( wxDataFormatId type );
22 wxDataFormat( const wxString &id );
23 wxDataFormat( const wxChar *id );
24 wxDataFormat( const wxDataFormat &format );
25 wxDataFormat( const Atom atom );
26
27 void SetType( wxDataFormatId type );
28 NativeFormat GetType() const { return m_type; }
29
30 /* the string Id identifies the format of clipboard or DnD data. a word
31 * processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
32 * to the clipboard - the latter with the Id "application/wxword", an
33 * image manipulation program would put a wxBitmapDataObject and a
34 * wxPrivateDataObject to the clipboard - the latter with "image/png". */
35
36 wxString GetId() const { return m_id; }
37 void SetId( const wxChar *id );
38
39 Atom GetAtom();
40 void SetAtom(Atom atom) { m_hasAtom = TRUE; m_atom = atom; }
41
42 // implicit conversion to wxDataFormatId
43 operator NativeFormat() const { return m_type; }
44
45 bool operator==(NativeFormat type) const { return m_type == type; }
46 bool operator!=(NativeFormat type) const { return m_type != type; }
47
48 private:
49 NativeFormat m_type;
50 wxString m_id;
51 bool m_hasAtom;
52 Atom m_atom;
53 };
54
55 #endif // _WX_MOTIF_DATAFORM_H
56