]>
Commit | Line | Data |
---|---|---|
2e1a688e | 1 | /////////////////////////////////////////////////////////////////////////////// |
6dddc146 | 2 | // Name: os2/dataform.h |
2e1a688e DW |
3 | // Purpose: declaration of the wxDataFormat class |
4 | // Author: David Webster (lifted from dnd.h) | |
5 | // Modified by: | |
6 | // Created: 10/21/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1999 David Webster | |
9 | // Licence: wxWindows licence | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_OS2_DATAFORM_H | |
13 | #define _WX_OS2_DATAFORM_H | |
14 | ||
15 | class wxDataFormat | |
16 | { | |
17 | public: | |
18 | // the clipboard formats under GDK are GdkAtoms | |
19 | typedef unsigned short NativeFormat; | |
20 | ||
21 | wxDataFormat(); | |
dcd307ee DW |
22 | wxDataFormat(wxDataFormatId vType); |
23 | wxDataFormat(const wxString& rId); | |
24 | wxDataFormat(const wxChar* pId); | |
25 | wxDataFormat(NativeFormat vFormat); | |
2e1a688e | 26 | |
dcd307ee DW |
27 | wxDataFormat& operator=(NativeFormat vFormat) |
28 | { SetId(vFormat); return *this; } | |
2e1a688e DW |
29 | |
30 | // comparison (must have both versions) | |
dcd307ee DW |
31 | bool operator==(NativeFormat vFormat) const |
32 | { return m_vFormat == (NativeFormat)vFormat; } | |
33 | bool operator!=(NativeFormat vFormat) const | |
34 | { return m_vFormat != (NativeFormat)vFormat; } | |
2e1a688e DW |
35 | |
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) | |
dcd307ee DW |
39 | NativeFormat GetFormatId() const { return m_vFormat; } |
40 | operator NativeFormat() const { return m_vFormat; } | |
2e1a688e | 41 | |
dcd307ee | 42 | void SetId(NativeFormat vFormat); |
2e1a688e DW |
43 | |
44 | // string ids are used for custom types - this SetId() must be used for | |
45 | // application-specific formats | |
46 | wxString GetId() const; | |
dcd307ee | 47 | void SetId(const wxChar* pId); |
2e1a688e DW |
48 | |
49 | // implementation | |
50 | wxDataFormatId GetType() const; | |
51 | ||
52 | private: | |
5dcec1d9 DW |
53 | wxDataFormatId m_vType; |
54 | NativeFormat m_vFormat; | |
2e1a688e DW |
55 | |
56 | void PrepareFormats(); | |
dcd307ee | 57 | void SetType(wxDataFormatId vType); |
2e1a688e DW |
58 | }; |
59 | ||
60 | #endif // _WX_GTK_DATAFORM_H |