]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/dataform.h
Platform define for wxWinCE
[wxWidgets.git] / include / wx / mac / dataform.h
CommitLineData
ef6bd27b 1///////////////////////////////////////////////////////////////////////////////
05adb9d2 2// Name: mac/dataform.h
ef6bd27b 3// Purpose: declaration of the wxDataFormat class
05adb9d2 4// Author: Stefan Csomor (lifted from dnd.h)
ef6bd27b
SC
5// Modified by:
6// Created: 10/21/99
7// RCS-ID: $Id$
05adb9d2 8// Copyright: (c) 1999 Stefan Csomor
ef6bd27b
SC
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
05adb9d2
SC
12#ifndef _WX_MAC_DATAFORM_H
13#define _WX_MAC_DATAFORM_H
ef6bd27b 14
2b5f62a0 15class WXDLLEXPORT wxDataFormat
ef6bd27b
SC
16{
17public:
5273bf2f 18 typedef unsigned long NativeFormat;
ef6bd27b
SC
19
20 wxDataFormat();
21 wxDataFormat(wxDataFormatId vType);
22 wxDataFormat(const wxString& rId);
23 wxDataFormat(const wxChar* pId);
24 wxDataFormat(NativeFormat vFormat);
25
26 wxDataFormat& operator=(NativeFormat vFormat)
27 { SetId(vFormat); return *this; }
28
29 // comparison (must have both versions)
05adb9d2
SC
30 bool operator==(NativeFormat format) const
31 { return m_format == (NativeFormat)format; }
32 bool operator!=(NativeFormat format) const
33 { return m_format != (NativeFormat)format; }
34 bool operator==(wxDataFormatId format) const
35 { return m_type == (wxDataFormatId)format; }
36 bool operator!=(wxDataFormatId format) const
37 { return m_type != (wxDataFormatId)format; }
ef6bd27b
SC
38
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)
05adb9d2
SC
42 NativeFormat GetFormatId() const { return m_format; }
43 operator NativeFormat() const { return m_format; }
ef6bd27b 44
05adb9d2 45 void SetId(NativeFormat format);
ef6bd27b
SC
46
47 // string ids are used for custom types - this SetId() must be used for
48 // application-specific formats
49 wxString GetId() const;
50 void SetId(const wxChar* pId);
51
52 // implementation
53 wxDataFormatId GetType() const;
05adb9d2 54 void SetType( wxDataFormatId type );
ef6bd27b
SC
55
56private:
05adb9d2
SC
57 wxDataFormatId m_type;
58 NativeFormat m_format;
ef6bd27b
SC
59};
60
05adb9d2 61#endif // _WX_MAC_DATAFORM_H