]>
Commit | Line | Data |
---|---|---|
e1ee679c | 1 | /////////////////////////////////////////////////////////////////////////////// |
925f7740 | 2 | // Name: wx/motif/dataform.h |
e1ee679c | 3 | // Purpose: declaration of the wxDataFormat class |
76db86e7 | 4 | // Author: Robert Roebling |
e1ee679c VZ |
5 | // Modified by: |
6 | // Created: 19.10.99 (extracted from motif/dataobj.h) | |
76db86e7 | 7 | // Copyright: (c) 1999 Robert Roebling |
65571936 | 8 | // Licence: wxWindows licence |
e1ee679c VZ |
9 | /////////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_MOTIF_DATAFORM_H | |
12 | #define _WX_MOTIF_DATAFORM_H | |
13 | ||
94c7b088 | 14 | class WXDLLIMPEXP_CORE wxDataFormat |
e1ee679c VZ |
15 | { |
16 | public: | |
76db86e7 RR |
17 | // the clipboard formats under Xt are Atoms |
18 | typedef Atom NativeFormat; | |
925f7740 | 19 | |
e1ee679c VZ |
20 | wxDataFormat(); |
21 | wxDataFormat( wxDataFormatId type ); | |
22 | wxDataFormat( const wxString &id ); | |
76db86e7 | 23 | wxDataFormat( NativeFormat format ); |
925f7740 | 24 | |
76db86e7 | 25 | wxDataFormat& operator=(NativeFormat format) |
83df96d6 | 26 | { SetId(format); return *this; } |
925f7740 | 27 | |
76db86e7 RR |
28 | // comparison (must have both versions) |
29 | bool operator==(NativeFormat format) const | |
83df96d6 | 30 | { return m_format == (NativeFormat)format; } |
76db86e7 | 31 | bool operator!=(NativeFormat format) const |
83df96d6 | 32 | { return m_format != (NativeFormat)format; } |
76db86e7 | 33 | bool operator==(wxDataFormatId format) const |
83df96d6 | 34 | { return m_type == (wxDataFormatId)format; } |
76db86e7 | 35 | bool operator!=(wxDataFormatId format) const |
83df96d6 | 36 | { return m_type != (wxDataFormatId)format; } |
925f7740 | 37 | |
76db86e7 RR |
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; } | |
925f7740 | 43 | |
76db86e7 | 44 | void SetId( NativeFormat format ); |
925f7740 | 45 | |
76db86e7 RR |
46 | // string ids are used for custom types - this SetId() must be used for |
47 | // application-specific formats | |
48 | wxString GetId() const; | |
a1eb65c2 | 49 | void SetId( const wxString& id ); |
925f7740 | 50 | |
76db86e7 RR |
51 | // implementation |
52 | wxDataFormatId GetType() const; | |
925f7740 | 53 | |
e1ee679c | 54 | private: |
76db86e7 RR |
55 | wxDataFormatId m_type; |
56 | NativeFormat m_format; | |
925f7740 | 57 | |
76db86e7 RR |
58 | void PrepareFormats(); |
59 | void SetType( wxDataFormatId type ); | |
e1ee679c VZ |
60 | }; |
61 | ||
76db86e7 | 62 | |
e1ee679c | 63 | #endif // _WX_MOTIF_DATAFORM_H |