intl/locale/public/nsIPlatformCharset.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/locale/public/nsIPlatformCharset.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsIPlatformCharset_h__
    1.10 +#define nsIPlatformCharset_h__
    1.11 +
    1.12 +#include "nsStringGlue.h"
    1.13 +#include "nsISupports.h"
    1.14 +
    1.15 +// Interface ID for our nsIPlatformCharset interface
    1.16 +
    1.17 +/* 778859d5-fc01-4f4b-bfaa-3c0d1b6c81d6 */
    1.18 +#define NS_IPLATFORMCHARSET_IID \
    1.19 +{   0x778859d5, \
    1.20 +    0xfc01, \
    1.21 +    0x4f4b, \
    1.22 +    {0xbf, 0xaa, 0x3c, 0x0d, 0x1b, 0x6c, 0x81, 0xd6} }
    1.23 +
    1.24 +#define NS_PLATFORMCHARSET_CID \
    1.25 +{ 0x84b0f182, 0xc6c7, 0x11d2, {0xb3, 0xb0, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 }}
    1.26 +
    1.27 +#define NS_PLATFORMCHARSET_CONTRACTID "@mozilla.org/intl/platformcharset;1"
    1.28 +
    1.29 +typedef enum {
    1.30 +     kPlatformCharsetSel_PlainTextInClipboard = 0,
    1.31 +     kPlatformCharsetSel_FileName = 1,
    1.32 +     kPlatformCharsetSel_Menu = 2,
    1.33 +     kPlatformCharsetSel_4xBookmarkFile = 3,
    1.34 +     kPlatformCharsetSel_KeyboardInput = 4,
    1.35 +     kPlatformCharsetSel_WindowManager = 5,
    1.36 +     kPlatformCharsetSel_4xPrefsJS = 6,
    1.37 +     kPlatformCharsetSel_PlainTextInFile = 7
    1.38 +} nsPlatformCharsetSel;
    1.39 +
    1.40 +/**
    1.41 + * DO NOT ADD NEW USES OF THIS INTERFACE!
    1.42 + * Removal is https://bugzilla.mozilla.org/show_bug.cgi?id=943272
    1.43 + *
    1.44 + * Instead, use UTF-16 APIs on Windows and UTF-8 APIs everywhere else.
    1.45 + * Assume plain text files are UTF-8.
    1.46 + */
    1.47 +class nsIPlatformCharset : public nsISupports
    1.48 +{
    1.49 +public:
    1.50 + 
    1.51 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPLATFORMCHARSET_IID)
    1.52 +
    1.53 +  NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsACString& oResult) = 0;
    1.54 +
    1.55 +  NS_IMETHOD GetDefaultCharsetForLocale(const nsAString& localeName, nsACString& oResult) = 0;
    1.56 +
    1.57 +};
    1.58 +
    1.59 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIPlatformCharset, NS_IPLATFORMCHARSET_IID)
    1.60 +
    1.61 +#endif /* nsIPlatformCharset_h__ */

mercurial