]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/corefoundation/cfstring.h
reverted r51340: don't use wxWeakRef in the library code as long as not all supported...
[wxWidgets.git] / include / wx / mac / corefoundation / cfstring.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/corefoundation/cfstring.h
3 // Purpose: wxCFStringRef and other string functions
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 2004-10-29 (from code in wx/mac/carbon/private.h)
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 // Usage: Darwin (base library)
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef __WX_CFSTRINGHOLDER_H__
14 #define __WX_CFSTRINGHOLDER_H__
15
16 #include <CoreFoundation/CFString.h>
17
18 #include "wx/dlimpexp.h"
19 #include "wx/fontenc.h"
20 #include "wx/mac/corefoundation/cfref.h"
21
22 class WXDLLIMPEXP_FWD_BASE wxString;
23
24 WXDLLIMPEXP_BASE void wxMacConvertNewlines13To10( wxString *data ) ;
25 WXDLLIMPEXP_BASE void wxMacConvertNewlines10To13( wxString *data ) ;
26
27 WXDLLIMPEXP_BASE void wxMacConvertNewlines13To10( char * data ) ;
28 WXDLLIMPEXP_BASE void wxMacConvertNewlines10To13( char * data ) ;
29
30 WXDLLIMPEXP_BASE wxUint32 wxMacGetSystemEncFromFontEnc(wxFontEncoding encoding) ;
31 WXDLLIMPEXP_BASE wxFontEncoding wxMacGetFontEncFromSystemEnc(wxUint32 encoding) ;
32 WXDLLIMPEXP_BASE void wxMacWakeUp() ;
33
34 class WXDLLIMPEXP_BASE wxCFStringRef : public wxCFRef< CFStringRef >
35 {
36 public:
37 wxCFStringRef()
38 {
39 }
40
41 wxCFStringRef(const wxString &str,
42 wxFontEncoding encoding = wxFONTENCODING_DEFAULT) ;
43
44 wxCFStringRef(CFStringRef ref)
45 : wxCFRef< CFStringRef >(ref)
46 {
47 }
48
49 wxCFStringRef(const wxCFStringRef& otherRef )
50 : wxCFRef< CFStringRef >(otherRef)
51 {
52 }
53
54 ~wxCFStringRef()
55 {
56 }
57
58 wxString AsString( wxFontEncoding encoding = wxFONTENCODING_DEFAULT ) ;
59
60 private:
61 } ;
62
63 // corresponding class for holding UniChars (native unicode characters)
64
65 class WXDLLIMPEXP_BASE wxMacUniCharBuffer
66 {
67 public :
68 wxMacUniCharBuffer( const wxString &str ) ;
69
70 ~wxMacUniCharBuffer() ;
71
72 UniChar* GetBuffer() ;
73
74 UniCharCount GetChars() ;
75
76 private :
77 UniChar* m_ubuf ;
78 UniCharCount m_chars ;
79 };
80 #endif //__WXCFSTRINGHOLDER_H__