1 /* -*- Mode: C++; tab-width: 2; 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/. */
6 #ifndef nsIPlatformCharset_h__
7 #define nsIPlatformCharset_h__
9 #include "nsStringGlue.h"
10 #include "nsISupports.h"
12 // Interface ID for our nsIPlatformCharset interface
14 /* 778859d5-fc01-4f4b-bfaa-3c0d1b6c81d6 */
15 #define NS_IPLATFORMCHARSET_IID \
19 {0xbf, 0xaa, 0x3c, 0x0d, 0x1b, 0x6c, 0x81, 0xd6} }
21 #define NS_PLATFORMCHARSET_CID \
22 { 0x84b0f182, 0xc6c7, 0x11d2, {0xb3, 0xb0, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }}
24 #define NS_PLATFORMCHARSET_CONTRACTID "@mozilla.org/intl/platformcharset;1"
27 kPlatformCharsetSel_PlainTextInClipboard
= 0,
28 kPlatformCharsetSel_FileName
= 1,
29 kPlatformCharsetSel_Menu
= 2,
30 kPlatformCharsetSel_4xBookmarkFile
= 3,
31 kPlatformCharsetSel_KeyboardInput
= 4,
32 kPlatformCharsetSel_WindowManager
= 5,
33 kPlatformCharsetSel_4xPrefsJS
= 6,
34 kPlatformCharsetSel_PlainTextInFile
= 7
35 } nsPlatformCharsetSel
;
38 * DO NOT ADD NEW USES OF THIS INTERFACE!
39 * Removal is https://bugzilla.mozilla.org/show_bug.cgi?id=943272
41 * Instead, use UTF-16 APIs on Windows and UTF-8 APIs everywhere else.
42 * Assume plain text files are UTF-8.
44 class nsIPlatformCharset
: public nsISupports
48 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPLATFORMCHARSET_IID
)
50 NS_IMETHOD
GetCharset(nsPlatformCharsetSel selector
, nsACString
& oResult
) = 0;
52 NS_IMETHOD
GetDefaultCharsetForLocale(const nsAString
& localeName
, nsACString
& oResult
) = 0;
56 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPlatformCharset
, NS_IPLATFORMCHARSET_IID
)
58 #endif /* nsIPlatformCharset_h__ */