intl/locale/public/nsIPlatformCharset.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsIPlatformCharset_h__
michael@0 7 #define nsIPlatformCharset_h__
michael@0 8
michael@0 9 #include "nsStringGlue.h"
michael@0 10 #include "nsISupports.h"
michael@0 11
michael@0 12 // Interface ID for our nsIPlatformCharset interface
michael@0 13
michael@0 14 /* 778859d5-fc01-4f4b-bfaa-3c0d1b6c81d6 */
michael@0 15 #define NS_IPLATFORMCHARSET_IID \
michael@0 16 { 0x778859d5, \
michael@0 17 0xfc01, \
michael@0 18 0x4f4b, \
michael@0 19 {0xbf, 0xaa, 0x3c, 0x0d, 0x1b, 0x6c, 0x81, 0xd6} }
michael@0 20
michael@0 21 #define NS_PLATFORMCHARSET_CID \
michael@0 22 { 0x84b0f182, 0xc6c7, 0x11d2, {0xb3, 0xb0, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }}
michael@0 23
michael@0 24 #define NS_PLATFORMCHARSET_CONTRACTID "@mozilla.org/intl/platformcharset;1"
michael@0 25
michael@0 26 typedef enum {
michael@0 27 kPlatformCharsetSel_PlainTextInClipboard = 0,
michael@0 28 kPlatformCharsetSel_FileName = 1,
michael@0 29 kPlatformCharsetSel_Menu = 2,
michael@0 30 kPlatformCharsetSel_4xBookmarkFile = 3,
michael@0 31 kPlatformCharsetSel_KeyboardInput = 4,
michael@0 32 kPlatformCharsetSel_WindowManager = 5,
michael@0 33 kPlatformCharsetSel_4xPrefsJS = 6,
michael@0 34 kPlatformCharsetSel_PlainTextInFile = 7
michael@0 35 } nsPlatformCharsetSel;
michael@0 36
michael@0 37 /**
michael@0 38 * DO NOT ADD NEW USES OF THIS INTERFACE!
michael@0 39 * Removal is https://bugzilla.mozilla.org/show_bug.cgi?id=943272
michael@0 40 *
michael@0 41 * Instead, use UTF-16 APIs on Windows and UTF-8 APIs everywhere else.
michael@0 42 * Assume plain text files are UTF-8.
michael@0 43 */
michael@0 44 class nsIPlatformCharset : public nsISupports
michael@0 45 {
michael@0 46 public:
michael@0 47
michael@0 48 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPLATFORMCHARSET_IID)
michael@0 49
michael@0 50 NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult) = 0;
michael@0 51
michael@0 52 NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult) = 0;
michael@0 53
michael@0 54 };
michael@0 55
michael@0 56 NS_DEFINE_STATIC_IID_ACCESSOR(nsIPlatformCharset, NS_IPLATFORMCHARSET_IID)
michael@0 57
michael@0 58 #endif /* nsIPlatformCharset_h__ */

mercurial