michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsIPlatformCharset_h__ michael@0: #define nsIPlatformCharset_h__ michael@0: michael@0: #include "nsStringGlue.h" michael@0: #include "nsISupports.h" michael@0: michael@0: // Interface ID for our nsIPlatformCharset interface michael@0: michael@0: /* 778859d5-fc01-4f4b-bfaa-3c0d1b6c81d6 */ michael@0: #define NS_IPLATFORMCHARSET_IID \ michael@0: { 0x778859d5, \ michael@0: 0xfc01, \ michael@0: 0x4f4b, \ michael@0: {0xbf, 0xaa, 0x3c, 0x0d, 0x1b, 0x6c, 0x81, 0xd6} } michael@0: michael@0: #define NS_PLATFORMCHARSET_CID \ michael@0: { 0x84b0f182, 0xc6c7, 0x11d2, {0xb3, 0xb0, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }} michael@0: michael@0: #define NS_PLATFORMCHARSET_CONTRACTID "@mozilla.org/intl/platformcharset;1" michael@0: michael@0: typedef enum { michael@0: kPlatformCharsetSel_PlainTextInClipboard = 0, michael@0: kPlatformCharsetSel_FileName = 1, michael@0: kPlatformCharsetSel_Menu = 2, michael@0: kPlatformCharsetSel_4xBookmarkFile = 3, michael@0: kPlatformCharsetSel_KeyboardInput = 4, michael@0: kPlatformCharsetSel_WindowManager = 5, michael@0: kPlatformCharsetSel_4xPrefsJS = 6, michael@0: kPlatformCharsetSel_PlainTextInFile = 7 michael@0: } nsPlatformCharsetSel; michael@0: michael@0: /** michael@0: * DO NOT ADD NEW USES OF THIS INTERFACE! michael@0: * Removal is https://bugzilla.mozilla.org/show_bug.cgi?id=943272 michael@0: * michael@0: * Instead, use UTF-16 APIs on Windows and UTF-8 APIs everywhere else. michael@0: * Assume plain text files are UTF-8. michael@0: */ michael@0: class nsIPlatformCharset : public nsISupports michael@0: { michael@0: public: michael@0: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPLATFORMCHARSET_IID) michael@0: michael@0: NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult) = 0; michael@0: michael@0: NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult) = 0; michael@0: michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIPlatformCharset, NS_IPLATFORMCHARSET_IID) michael@0: michael@0: #endif /* nsIPlatformCharset_h__ */