Backed out changeset 3fe07c50c854 (bug 946316) for bustage. a=backout
[gecko.git] / widget / os2 / nsOS2Uni.h
blobbe44f0eea8c55349d626ff51467d10ad19788103
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef _nsos2uni_h
6 #define _nsos2uni_h
8 #include <uconv.h>
9 #include "nsTArray.h"
10 #include "nsICharsetConverterManager.h"
11 #include "gfxCore.h"
13 enum ConverterRequest {
14 eConv_Encoder,
15 eConv_Decoder
18 class OS2Uni {
19 public:
20 static nsISupports* GetUconvObject(int CodePage, ConverterRequest aReq);
21 static void FreeUconvObjects();
22 private:
23 static nsICharsetConverterManager* gCharsetManager;
26 #define CHAR_BUFFER_SIZE 1024
27 typedef nsAutoTArray<char, CHAR_BUFFER_SIZE> nsAutoCharBuffer;
28 typedef nsAutoTArray<PRUnichar, CHAR_BUFFER_SIZE> nsAutoChar16Buffer;
30 nsresult WideCharToMultiByte(int aCodePage, const PRUnichar* aSrc,
31 int32_t aSrcLength, nsAutoCharBuffer& aResult,
32 int32_t& aResultLength);
33 nsresult MultiByteToWideChar(int aCodePage, const char* aSrc,
34 int32_t aSrcLength, nsAutoChar16Buffer& aResult,
35 int32_t& aResultLength);
37 #endif