intl/uconv/idl/nsICharsetConverterManager.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/uconv/idl/nsICharsetConverterManager.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,110 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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 +#include "nsISupports.idl"
    1.10 +#include "nsIAtom.idl"
    1.11 +
    1.12 +%{ C++
    1.13 +#include "nsIUnicodeDecoder.h"
    1.14 +#include "nsIUnicodeEncoder.h"
    1.15 +
    1.16 +// XXX change to NS_CHARSETCONVERTERMANAGER_CID
    1.17 +#define NS_ICHARSETCONVERTERMANAGER_CID \
    1.18 +  {0x3c1c0163, 0x9bd0, 0x11d3, { 0x9d, 0x9, 0x0, 0x50, 0x4, 0x0, 0x7, 0xb2}}
    1.19 +
    1.20 +#define NS_CHARSETCONVERTERMANAGER_CONTRACTID "@mozilla.org/charset-converter-manager;1"
    1.21 +%}
    1.22 +
    1.23 +interface nsIUnicodeDecoder;
    1.24 +interface nsIUnicodeEncoder;
    1.25 +interface nsIUTF8StringEnumerator;
    1.26 +
    1.27 +/**
    1.28 + * DON'T ADD NEW USES OF THIS INTERFACE TO MOZILLA-CENTRAL. Use 
    1.29 + * mozilla::dom::EncodingUtils instead.
    1.30 + *
    1.31 + * Here Charsets are identified by ASCII strings. Charset alias
    1.32 + * resolution is provided by default in most methods. "Raw"
    1.33 + * versions that do not need this resolution are also provided.
    1.34 + *
    1.35 + * @deprecated Use mozilla::dom::EncodingUtils in mozilla-central instead.
    1.36 + * @created         21/Feb/2000
    1.37 + * @author  Catalin Rotaru [CATA]
    1.38 + */
    1.39 +[scriptable, uuid(a0550d46-8d9c-47dd-acc7-c083620dff12)]
    1.40 +interface nsICharsetConverterManager : nsISupports
    1.41 +{
    1.42 +    /**
    1.43 +     * Get the Unicode decoder for the given charset.
    1.44 +     * The "Raw" version skips charset alias resolution
    1.45 +     */
    1.46 +    [noscript] nsIUnicodeDecoder getUnicodeDecoder(in string charset);
    1.47 +    [noscript] nsIUnicodeDecoder getUnicodeDecoderRaw(in string charset);
    1.48 +    [noscript] nsIUnicodeDecoder getUnicodeDecoderInternal(in string charset);
    1.49 +
    1.50 +    /**
    1.51 +     * Get the Unicode encoder for the given charset.
    1.52 +     * The "Raw" version skips charset alias resolution
    1.53 +     */
    1.54 +    [noscript] nsIUnicodeEncoder getUnicodeEncoder(in string charset);
    1.55 +    [noscript] nsIUnicodeEncoder getUnicodeEncoderRaw(in string charset);
    1.56 +
    1.57 +    /**
    1.58 +     * A shortcut to calling nsICharsetAlias to do alias resolution
    1.59 +     * @throws if aCharset is an unknown charset.
    1.60 +     */
    1.61 +    ACString getCharsetAlias(in string aCharset);
    1.62 +    
    1.63 +    /**
    1.64 +     * Get the complete list of available decoders.
    1.65 +     */
    1.66 +    nsIUTF8StringEnumerator getDecoderList();
    1.67 +
    1.68 +    /**
    1.69 +     * Get the complete list of available encoders.
    1.70 +     */
    1.71 +    nsIUTF8StringEnumerator getEncoderList();
    1.72 +
    1.73 +    /**
    1.74 +     * Get the complete list of available charset detectors.
    1.75 +     */
    1.76 +    nsIUTF8StringEnumerator GetCharsetDetectorList();
    1.77 +
    1.78 +    /**
    1.79 +     * Get the human-readable name for the given charset.
    1.80 +     * @throws if aCharset is an unknown charset.
    1.81 +     */
    1.82 +    AString getCharsetTitle(in string aCharset);
    1.83 +
    1.84 +    /**
    1.85 +     * Get some data about the given charset. This includes whether the 
    1.86 +     * character encoding may be used for certain purposes, if it is 
    1.87 +     * multi-byte, and the language code for it. See charsetData.properties
    1.88 +     * for the source of this data. Some known property names:
    1.89 +     *    notForBrowser  - not to be used in the browser.
    1.90 +     *    notForOutgoing - not to be used for exporting files.
    1.91 +     *    LangGroup      - language code for charset, e.g. 'he' and 'zh-CN'.
    1.92 +     *    isMultibyte    - is this a multi-byte charset?
    1.93 +     *    isInternal     - not to be used in untrusted web content.
    1.94 +     * 
    1.95 +     * @param aCharset name of the character encoding, e.g. 'iso-8859-15'.
    1.96 +     * @param aProp property desired for the character encoding.
    1.97 +     * @throws if aCharset is an unknown charset.
    1.98 +     * @return the value of the property, for the character encoding.
    1.99 +     */
   1.100 +    AString getCharsetData(in string aCharset, 
   1.101 +                           in wstring aProp);
   1.102 +
   1.103 +    /**
   1.104 +     * Get the language group for the given charset. This is similar to 
   1.105 +     * calling <tt>getCharsetData</tt> with the <tt>prop</tt> "LangGroup".
   1.106 +     * 
   1.107 +     * @param aCharset name of the character encoding, e.g. 'iso-8859-15'.
   1.108 +     * @throws if aCharset is an unknown charset.
   1.109 +     * @return the language code for the character encoding.
   1.110 +     */
   1.111 +    nsIAtom getCharsetLangGroup(in string aCharset);
   1.112 +    nsIAtom getCharsetLangGroupRaw(in string aCharset);
   1.113 +};

mercurial