1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: mac/dataform.h
3 // Purpose: declaration of the wxDataFormat class
4 // Author: Stefan Csomor (lifted from dnd.h)
8 // Copyright: (c) 1999 Stefan Csomor
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MAC_DATAFORM_H
13 #define _WX_MAC_DATAFORM_H
15 class WXDLLIMPEXP_CORE wxDataFormat
18 typedef unsigned long NativeFormat
;
21 wxDataFormat(wxDataFormatId vType
);
22 wxDataFormat(const wxDataFormat
& rFormat
);
23 wxDataFormat(const wxString
& rId
);
24 wxDataFormat(const wxChar
* pId
);
25 wxDataFormat(NativeFormat vFormat
);
28 wxDataFormat
& operator=(NativeFormat vFormat
)
29 { SetId(vFormat
); return *this; }
31 // comparison (must have both versions)
32 bool operator==(const wxDataFormat
& format
) const ;
33 bool operator!=(const wxDataFormat
& format
) const
34 { return ! ( *this == format
); }
35 bool operator==(wxDataFormatId format
) const
36 { return m_type
== (wxDataFormatId
)format
; }
37 bool operator!=(wxDataFormatId format
) const
38 { return m_type
!= (wxDataFormatId
)format
; }
40 wxDataFormat
& operator=(const wxDataFormat
& format
);
42 // explicit and implicit conversions to NativeFormat which is one of
43 // standard data types (implicit conversion is useful for preserving the
44 // compatibility with old code)
45 NativeFormat
GetFormatId() const { return m_format
; }
46 operator NativeFormat() const { return m_format
; }
48 void SetId(NativeFormat format
);
50 // string ids are used for custom types - this SetId() must be used for
51 // application-specific formats
52 wxString
GetId() const;
53 void SetId(const wxString
& pId
);
56 wxDataFormatId
GetType() const { return m_type
; }
57 void SetType( wxDataFormatId type
);
59 // returns true if the format is one of those defined in wxDataFormatId
60 bool IsStandard() const { return m_type
> 0 && m_type
< wxDF_PRIVATE
; }
63 wxDataFormatId m_type
;
64 NativeFormat m_format
;
65 // indicates the type in case of wxDF_PRIVATE :
69 #endif // _WX_MAC_DATAFORM_H