|
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 #ifndef nsPlatformCharset_h__ |
|
6 #define nsPlatformCharset_h__ |
|
7 |
|
8 #include "nsIPlatformCharset.h" |
|
9 |
|
10 class nsPlatformCharset : public nsIPlatformCharset |
|
11 { |
|
12 NS_DECL_ISUPPORTS |
|
13 |
|
14 public: |
|
15 |
|
16 nsPlatformCharset(); |
|
17 virtual ~nsPlatformCharset(); |
|
18 |
|
19 NS_IMETHOD Init(); |
|
20 NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult); |
|
21 NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult); |
|
22 |
|
23 private: |
|
24 nsCString mCharset; |
|
25 nsString mLocale; // remember the locale & charset |
|
26 |
|
27 nsresult MapToCharset(nsAString& inANSICodePage, nsACString& outCharset); |
|
28 nsresult InitGetCharset(nsACString& oString); |
|
29 nsresult VerifyCharset(nsCString &aCharset); |
|
30 }; |
|
31 |
|
32 #endif // nsPlatformCharset_h__ |
|
33 |
|
34 |