intl/uconv/idl/nsITextToSubURI.idl

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include "nsISupports.idl"
michael@0 7
michael@0 8
michael@0 9 %{C++
michael@0 10 // {8B042E22-6F87-11d3-B3C8-00805F8A6670}
michael@0 11 #define NS_TEXTTOSUBURI_CID { 0x8b042e22, 0x6f87, 0x11d3, { 0xb3, 0xc8, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } }
michael@0 12 #define NS_ITEXTTOSUBURI_CONTRACTID "@mozilla.org/intl/texttosuburi;1"
michael@0 13 %}
michael@0 14
michael@0 15 [scriptable, uuid(8B042E24-6F87-11d3-B3C8-00805F8A6670)]
michael@0 16 interface nsITextToSubURI : nsISupports
michael@0 17 {
michael@0 18 string ConvertAndEscape(in string charset, in wstring text);
michael@0 19 wstring UnEscapeAndConvert(in string charset, in string text);
michael@0 20
michael@0 21 /**
michael@0 22 * Unescapes the given URI fragment (for UI purpose only)
michael@0 23 * Note:
michael@0 24 * <ul>
michael@0 25 * <li> escaping back the result (unescaped string) is not guaranteed to
michael@0 26 * give the original escaped string
michael@0 27 * <li> In case of a conversion error, the URI fragment (escaped) is
michael@0 28 * assumed to be in UTF-8 and converted to AString (UTF-16)
michael@0 29 * <li> Always succeeeds (callers don't need to do error checking)
michael@0 30 * </ul>
michael@0 31 *
michael@0 32 * @param aCharset the charset to convert from
michael@0 33 * @param aURIFragment the URI (or URI fragment) to unescape
michael@0 34 * @return Unescaped aURIFragment converted to unicode
michael@0 35 */
michael@0 36 AString unEscapeURIForUI(in ACString aCharset, in AUTF8String aURIFragment);
michael@0 37
michael@0 38 /**
michael@0 39 * Unescapes only non ASCII characters in the given URI fragment
michael@0 40 * note: this method assumes the URI as UTF-8 and fallbacks to the given
michael@0 41 * charset if the charset is an ASCII superset
michael@0 42 *
michael@0 43 * @param aCharset the charset to convert from
michael@0 44 * @param aURIFragment the URI (or URI fragment) to unescape
michael@0 45 * @return Unescaped aURIFragment converted to unicode
michael@0 46 * @throws NS_ERROR_UCONV_NOCONV when there is no decoder for aCharset
michael@0 47 * or error code of nsIUnicodeDecoder in case of conversion failure
michael@0 48 */
michael@0 49 AString unEscapeNonAsciiURI(in ACString aCharset, in AUTF8String aURIFragment);
michael@0 50 };

mercurial