]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dataform.h
Add wxActivateEvent::GetActivationReason().
[wxWidgets.git] / include / wx / motif / dataform.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/dataform.h
3 // Purpose: declaration of the wxDataFormat class
4 // Author: Robert Roebling
5 // Modified by:
6 // Created: 19.10.99 (extracted from motif/dataobj.h)
7 // Copyright: (c) 1999 Robert Roebling
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_MOTIF_DATAFORM_H
12 #define _WX_MOTIF_DATAFORM_H
13
14 class WXDLLIMPEXP_CORE wxDataFormat
15 {
16 public:
17 // the clipboard formats under Xt are Atoms
18 typedef Atom NativeFormat;
19
20 wxDataFormat();
21 wxDataFormat( wxDataFormatId type );
22 wxDataFormat( const wxString &id );
23 wxDataFormat( NativeFormat format );
24
25 wxDataFormat& operator=(NativeFormat format)
26 { SetId(format); return *this; }
27
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; }
37
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; }
43
44 void SetId( NativeFormat format );
45
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 );
50
51 // implementation
52 wxDataFormatId GetType() const;
53
54 private:
55 wxDataFormatId m_type;
56 NativeFormat m_format;
57
58 void PrepareFormats();
59 void SetType( wxDataFormatId type );
60 };
61
62
63 #endif // _WX_MOTIF_DATAFORM_H