1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/dataform.h
3 // Purpose: declaration of the wxDataFormat class
4 // Author: Stefan Csomor (lifted from dnd.h)
7 // Copyright: (c) 1999 Stefan Csomor
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MAC_DATAFORM_H
12 #define _WX_MAC_DATAFORM_H
14 class WXDLLIMPEXP_CORE wxDataFormat
17 typedef unsigned long NativeFormat
;
20 wxDataFormat(wxDataFormatId vType
);
21 wxDataFormat(const wxDataFormat
& rFormat
);
22 wxDataFormat(const wxString
& rId
);
23 wxDataFormat(const wxChar
* pId
);
24 wxDataFormat(NativeFormat vFormat
);
27 wxDataFormat
& operator=(NativeFormat vFormat
)
28 { SetId(vFormat
); return *this; }
30 // comparison (must have both versions)
31 bool operator==(const wxDataFormat
& format
) const ;
32 bool operator!=(const wxDataFormat
& format
) const
33 { return ! ( *this == 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
; }
39 wxDataFormat
& operator=(const wxDataFormat
& format
);
41 // explicit and implicit conversions to NativeFormat which is one of
42 // standard data types (implicit conversion is useful for preserving the
43 // compatibility with old code)
44 NativeFormat
GetFormatId() const { return m_format
; }
45 operator NativeFormat() const { return m_format
; }
47 void SetId(NativeFormat format
);
49 // string ids are used for custom types - this SetId() must be used for
50 // application-specific formats
51 wxString
GetId() const;
52 void SetId(const wxString
& pId
);
55 wxDataFormatId
GetType() const { return m_type
; }
56 void SetType( wxDataFormatId type
);
58 // returns true if the format is one of those defined in wxDataFormatId
59 bool IsStandard() const { return m_type
> 0 && m_type
< wxDF_PRIVATE
; }
62 wxDataFormatId m_type
;
63 NativeFormat m_format
;
64 // indicates the type in case of wxDF_PRIVATE :
68 #endif // _WX_MAC_DATAFORM_H