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