1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/corefoundation/cfstring.h
3 // Purpose: wxCFStringRef and other string functions
4 // Author: Stefan Csomor
6 // Created: 2004-10-29 (from code in wx/mac/carbon/private.h)
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 // Usage: Darwin (base library)
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef __WX_CFSTRINGHOLDER_H__
14 #define __WX_CFSTRINGHOLDER_H__
16 #include <CoreFoundation/CFString.h>
18 #include "wx/dlimpexp.h"
19 #include "wx/fontenc.h"
20 #include "wx/osx/core/cfref.h"
22 class WXDLLIMPEXP_FWD_BASE wxString
;
24 WXDLLIMPEXP_BASE
void wxMacConvertNewlines13To10( wxString
*data
) ;
25 WXDLLIMPEXP_BASE
void wxMacConvertNewlines10To13( wxString
*data
) ;
27 WXDLLIMPEXP_BASE
void wxMacConvertNewlines13To10( char * data
) ;
28 WXDLLIMPEXP_BASE
void wxMacConvertNewlines10To13( char * data
) ;
30 WXDLLIMPEXP_BASE wxUint32
wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding
) ;
31 WXDLLIMPEXP_BASE wxFontEncoding
wxMacGetFontEncFromSystemEnc(wxUint32 encoding
) ;
32 WXDLLIMPEXP_BASE
void wxMacWakeUp() ;
34 class WXDLLIMPEXP_BASE wxCFStringRef
: public wxCFRef
< CFStringRef
>
41 wxCFStringRef(const wxString
&str
,
42 wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
) ;
44 #if wxOSX_USE_COCOA_OR_IPHONE
45 wxCFStringRef(NSString
* ref
)
46 : wxCFRef
< CFStringRef
>((CFStringRef
) ref
)
51 wxCFStringRef(CFStringRef ref
)
52 : wxCFRef
< CFStringRef
>(ref
)
56 wxCFStringRef(const wxCFStringRef
& otherRef
)
57 : wxCFRef
< CFStringRef
>(otherRef
)
65 wxString
AsString( wxFontEncoding encoding
= wxFONTENCODING_DEFAULT
) ;
67 #if wxOSX_USE_COCOA_OR_IPHONE
68 NSString
* AsNSString() const { return (NSString
*)(CFStringRef
) *this; }
73 // corresponding class for holding UniChars (native unicode characters)
75 class WXDLLIMPEXP_BASE wxMacUniCharBuffer
78 wxMacUniCharBuffer( const wxString
&str
) ;
80 ~wxMacUniCharBuffer() ;
82 UniCharPtr
GetBuffer() ;
84 UniCharCount
GetChars() ;
88 UniCharCount m_chars
;
90 #endif //__WXCFSTRINGHOLDER_H__