+#if wxOSX_USE_COCOA
+
+void wxDataObject::AddSupportedTypes( void* cfarray)
+{
+ size_t nFormats = GetFormatCount(wxDataObject::Set);
+ wxDataFormat *array = new wxDataFormat[nFormats];
+ GetAllFormats(array, wxDataObject::Set);
+
+ for (size_t i = 0; i < nFormats; i++)
+ {
+ wxDataFormat dataFormat = array[ i ];
+
+ if ( dataFormat.GetType() == wxDF_UNICODETEXT || dataFormat.GetType() == wxDF_TEXT )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypeUTF16PlainText);
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypePlainText);
+ }
+ else if ( dataFormat.GetType() == wxDF_FILENAME )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypeFileURL);
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kPasteboardTypeFileURLPromise);
+ }
+ else if ( dataFormat.GetType() == wxDF_HTML )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypeHTML);
+ }
+ else if ( dataFormat.GetType() == wxDF_BITMAP )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypeTIFF);
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypePICT);
+ }
+ else if ( dataFormat.GetType() == wxDF_METAFILE )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, kUTTypePDF);
+ }
+ else if ( dataFormat.GetType() == wxDF_PRIVATE )
+ {
+ CFArrayAppendValue((CFMutableArrayRef)cfarray, (CFStringRef) dataFormat.GetFormatId());
+ }
+ }
+ delete[] array;
+}
+
+#endif
+