]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/dataform.h
PCH-less compilation fix
[wxWidgets.git] / include / wx / mac / carbon / dataform.h
CommitLineData
8cf73271
SC
1///////////////////////////////////////////////////////////////////////////////
2// Name: mac/dataform.h
3// Purpose: declaration of the wxDataFormat class
4// Author: Stefan Csomor (lifted from dnd.h)
5// Modified by:
6// Created: 10/21/99
7// RCS-ID: $Id$
8// Copyright: (c) 1999 Stefan Csomor
65571936 9// Licence: wxWindows licence
8cf73271
SC
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MAC_DATAFORM_H
13#define _WX_MAC_DATAFORM_H
14
15class WXDLLEXPORT wxDataFormat
16{
17public:
18 typedef unsigned long NativeFormat;
19
20 wxDataFormat();
21 wxDataFormat(wxDataFormatId vType);
22 wxDataFormat(const wxString& rId);
8cf73271
SC
23 wxDataFormat(NativeFormat vFormat);
24
25 wxDataFormat& operator=(NativeFormat vFormat)
26 { SetId(vFormat); return *this; }
27
28 // comparison (must have both versions)
0b6db82f
SC
29 bool operator==(const wxDataFormat& format) const ;
30 bool operator!=(const wxDataFormat& format) const
8f98c051 31 { return ! ( *this == format ); }
8cf73271
SC
32 bool operator==(wxDataFormatId format) const
33 { return m_type == (wxDataFormatId)format; }
34 bool operator!=(wxDataFormatId format) const
35 { return m_type != (wxDataFormatId)format; }
36
37 // explicit and implicit conversions to NativeFormat which is one of
38 // standard data types (implicit conversion is useful for preserving the
39 // compatibility with old code)
40 NativeFormat GetFormatId() const { return m_format; }
41 operator NativeFormat() const { return m_format; }
42
43 void SetId(NativeFormat format);
44
45 // string ids are used for custom types - this SetId() must be used for
46 // application-specific formats
47 wxString GetId() const;
a1eb65c2 48 void SetId(const wxString& pId);
8cf73271
SC
49
50 // implementation
51 wxDataFormatId GetType() const { return m_type; }
52 void SetType( wxDataFormatId type );
53
0b6db82f 54 // returns true if the format is one of those defined in wxDataFormatId
7017fd67 55 bool IsStandard() const { return m_type > 0 && m_type < wxDF_PRIVATE; }
8f98c051 56
8cf73271
SC
57private:
58 wxDataFormatId m_type;
59 NativeFormat m_format;
0b6db82f
SC
60 // indicates the type in case of wxDF_PRIVATE :
61 wxString m_id ;
8cf73271
SC
62};
63
64#endif // _WX_MAC_DATAFORM_H