]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/dataform.h
wxRTC: fixed guidelines overwriting adjacent cell borders; corrected capitalisation...
[wxWidgets.git] / include / wx / x11 / dataform.h
CommitLineData
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)
83df96d6 7// Copyright: (c) 1999 Robert Roebling
65571936 8// Licence: wxWindows licence
83df96d6
JS
9///////////////////////////////////////////////////////////////////////////////
10
9691c806
RR
11#ifndef _WX_X11_DATAFORM_H
12#define _WX_X11_DATAFORM_H
83df96d6 13
968eb2ef 14class WXDLLIMPEXP_CORE wxDataFormat
83df96d6
JS
15{
16public:
17 // the clipboard formats under Xt are Atoms
18 typedef Atom NativeFormat;
03647350 19
83df96d6
JS
20 wxDataFormat();
21 wxDataFormat( wxDataFormatId type );
22 wxDataFormat( const wxString &id );
83df96d6 23 wxDataFormat( NativeFormat format );
03647350 24
83df96d6 25 wxDataFormat& operator=(NativeFormat format)
9691c806 26 { SetId(format); return *this; }
03647350 27
83df96d6
JS
28 // comparison (must have both versions)
29 bool operator==(NativeFormat format) const
9691c806 30 { return m_format == (NativeFormat)format; }
83df96d6 31 bool operator!=(NativeFormat format) const
9691c806 32 { return m_format != (NativeFormat)format; }
83df96d6 33 bool operator==(wxDataFormatId format) const
9691c806 34 { return m_type == (wxDataFormatId)format; }
83df96d6 35 bool operator!=(wxDataFormatId format) const
9691c806 36 { return m_type != (wxDataFormatId)format; }
03647350 37
83df96d6
JS
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; }
03647350 43
83df96d6 44 void SetId( NativeFormat format );
03647350 45
83df96d6
JS
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 );
03647350 50
83df96d6
JS
51 // implementation
52 wxDataFormatId GetType() const;
03647350 53
83df96d6
JS
54private:
55 wxDataFormatId m_type;
56 NativeFormat m_format;
03647350 57
83df96d6
JS
58 void PrepareFormats();
59 void SetType( wxDataFormatId type );
60};
61
62
9691c806 63#endif // _WX_X11_DATAFORM_H
83df96d6 64