]>
Commit | Line | Data |
---|---|---|
83df96d6 | 1 | /////////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/x11/dataform.h |
83df96d6 JS |
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 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1999 Robert Roebling | |
65571936 | 9 | // Licence: wxWindows licence |
83df96d6 JS |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
9691c806 RR |
12 | #ifndef _WX_X11_DATAFORM_H |
13 | #define _WX_X11_DATAFORM_H | |
83df96d6 | 14 | |
968eb2ef | 15 | class WXDLLIMPEXP_CORE wxDataFormat |
83df96d6 JS |
16 | { |
17 | public: | |
18 | // the clipboard formats under Xt are Atoms | |
19 | typedef Atom NativeFormat; | |
03647350 | 20 | |
83df96d6 JS |
21 | wxDataFormat(); |
22 | wxDataFormat( wxDataFormatId type ); | |
23 | wxDataFormat( const wxString &id ); | |
83df96d6 | 24 | wxDataFormat( NativeFormat format ); |
03647350 | 25 | |
83df96d6 | 26 | wxDataFormat& operator=(NativeFormat format) |
9691c806 | 27 | { SetId(format); return *this; } |
03647350 | 28 | |
83df96d6 JS |
29 | // comparison (must have both versions) |
30 | bool operator==(NativeFormat format) const | |
9691c806 | 31 | { return m_format == (NativeFormat)format; } |
83df96d6 | 32 | bool operator!=(NativeFormat format) const |
9691c806 | 33 | { return m_format != (NativeFormat)format; } |
83df96d6 | 34 | bool operator==(wxDataFormatId format) const |
9691c806 | 35 | { return m_type == (wxDataFormatId)format; } |
83df96d6 | 36 | bool operator!=(wxDataFormatId format) const |
9691c806 | 37 | { return m_type != (wxDataFormatId)format; } |
03647350 | 38 | |
83df96d6 JS |
39 | // explicit and implicit conversions to NativeFormat which is one of |
40 | // standard data types (implicit conversion is useful for preserving the | |
41 | // compatibility with old code) | |
42 | NativeFormat GetFormatId() const { return m_format; } | |
43 | operator NativeFormat() const { return m_format; } | |
03647350 | 44 | |
83df96d6 | 45 | void SetId( NativeFormat format ); |
03647350 | 46 | |
83df96d6 JS |
47 | // string ids are used for custom types - this SetId() must be used for |
48 | // application-specific formats | |
49 | wxString GetId() const; | |
a1eb65c2 | 50 | void SetId( const wxString& id ); |
03647350 | 51 | |
83df96d6 JS |
52 | // implementation |
53 | wxDataFormatId GetType() const; | |
03647350 | 54 | |
83df96d6 JS |
55 | private: |
56 | wxDataFormatId m_type; | |
57 | NativeFormat m_format; | |
03647350 | 58 | |
83df96d6 JS |
59 | void PrepareFormats(); |
60 | void SetType( wxDataFormatId type ); | |
61 | }; | |
62 | ||
63 | ||
9691c806 | 64 | #endif // _WX_X11_DATAFORM_H |
83df96d6 | 65 |