]>
Commit | Line | Data |
---|---|---|
e1ee679c VZ |
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: | |
12db77ca VZ |
18 | typedef unsigned long /* Atom */ NativeFormat; |
19 | ||
e1ee679c VZ |
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 ); | |
12db77ca | 28 | NativeFormat GetType() const { return m_type; } |
e1ee679c VZ |
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 | ||
12db77ca | 36 | wxString GetId() const { return m_id; } |
e1ee679c VZ |
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 | |
12db77ca | 43 | operator NativeFormat() const { return m_type; } |
e1ee679c | 44 | |
12db77ca VZ |
45 | bool operator==(NativeFormat type) const { return m_type == type; } |
46 | bool operator!=(NativeFormat type) const { return m_type != type; } | |
e1ee679c VZ |
47 | |
48 | private: | |
12db77ca | 49 | NativeFormat m_type; |
e1ee679c VZ |
50 | wxString m_id; |
51 | bool m_hasAtom; | |
52 | Atom m_atom; | |
53 | }; | |
54 | ||
55 | #endif // _WX_MOTIF_DATAFORM_H | |
56 |