1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_SHARED_IMPL_PPB_CHAR_SET_SHARED_H_
6 #define PPAPI_SHARED_IMPL_PPB_CHAR_SET_SHARED_H_
8 #include "base/basictypes.h"
9 #include "ppapi/c/dev/ppb_char_set_dev.h"
10 #include "ppapi/c/trusted/ppb_char_set_trusted.h"
11 #include "ppapi/shared_impl/ppapi_shared_export.h"
15 // Contains the implementation of character set conversion that is shared
16 // between the proxy and the renderer.
17 class PPAPI_SHARED_EXPORT PPB_CharSet_Shared
{
19 static char* UTF16ToCharSetDeprecated(const uint16_t* utf16
,
21 const char* output_char_set
,
22 PP_CharSet_ConversionError on_error
,
23 uint32_t* output_length
);
24 static PP_Bool
UTF16ToCharSet(const uint16_t utf16
[],
26 const char* output_char_set
,
27 PP_CharSet_Trusted_ConversionError on_error
,
29 uint32_t* output_length
);
31 static uint16_t* CharSetToUTF16Deprecated(const char* input
,
33 const char* input_char_set
,
34 PP_CharSet_ConversionError on_error
,
35 uint32_t* output_length
);
36 static PP_Bool
CharSetToUTF16(const char* input
,
38 const char* input_char_set
,
39 PP_CharSet_Trusted_ConversionError on_error
,
40 uint16_t* output_buffer
,
41 uint32_t* output_utf16_length
);
46 #endif // PPAPI_SHARED_IMPL_PPB_CHAR_SET_SHARED_H_