]>
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: | |
18 | wxDataFormat(); | |
19 | wxDataFormat( wxDataFormatId type ); | |
20 | wxDataFormat( const wxString &id ); | |
21 | wxDataFormat( const wxChar *id ); | |
22 | wxDataFormat( const wxDataFormat &format ); | |
23 | wxDataFormat( const Atom atom ); | |
24 | ||
25 | void SetType( wxDataFormatId type ); | |
26 | wxDataFormatId GetType() const; | |
27 | ||
28 | /* the string Id identifies the format of clipboard or DnD data. a word | |
29 | * processor would e.g. add a wxTextDataObject and a wxPrivateDataObject | |
30 | * to the clipboard - the latter with the Id "application/wxword", an | |
31 | * image manipulation program would put a wxBitmapDataObject and a | |
32 | * wxPrivateDataObject to the clipboard - the latter with "image/png". */ | |
33 | ||
34 | wxString GetId() const; | |
35 | void SetId( const wxChar *id ); | |
36 | ||
37 | Atom GetAtom(); | |
38 | void SetAtom(Atom atom) { m_hasAtom = TRUE; m_atom = atom; } | |
39 | ||
40 | // implicit conversion to wxDataFormatId | |
41 | operator wxDataFormatId() const { return m_type; } | |
42 | ||
43 | bool operator==(wxDataFormatId type) const { return m_type == type; } | |
44 | bool operator!=(wxDataFormatId type) const { return m_type != type; } | |
45 | ||
46 | private: | |
47 | wxDataFormatId m_type; | |
48 | wxString m_id; | |
49 | bool m_hasAtom; | |
50 | Atom m_atom; | |
51 | }; | |
52 | ||
53 | #endif // _WX_MOTIF_DATAFORM_H | |
54 |