docshell/base/nsIURIFixup.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #include "nsISupports.idl"
michael@0 8
michael@0 9 interface nsIURI;
michael@0 10 interface nsIInputStream;
michael@0 11
michael@0 12 /**
michael@0 13 * Interface implemented by objects capable of fixing up strings into URIs
michael@0 14 */
michael@0 15 [scriptable, uuid(731877f8-973b-414c-b772-9ca1f3fffb7e)]
michael@0 16 interface nsIURIFixup : nsISupports
michael@0 17 {
michael@0 18 /** No fixup flags. */
michael@0 19 const unsigned long FIXUP_FLAG_NONE = 0;
michael@0 20
michael@0 21 /**
michael@0 22 * Allow the fixup to use a keyword lookup service to complete the URI.
michael@0 23 * The fixup object implementer should honour this flag and only perform
michael@0 24 * any lengthy keyword (or search) operation if it is set.
michael@0 25 */
michael@0 26 const unsigned long FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP = 1;
michael@0 27
michael@0 28 /**
michael@0 29 * Tell the fixup to make an alternate URI from the input URI, for example
michael@0 30 * to turn foo into www.foo.com.
michael@0 31 */
michael@0 32 const unsigned long FIXUP_FLAGS_MAKE_ALTERNATE_URI = 2;
michael@0 33
michael@0 34 /**
michael@0 35 * Fix common scheme typos.
michael@0 36 */
michael@0 37 const unsigned long FIXUP_FLAG_FIX_SCHEME_TYPOS = 8;
michael@0 38
michael@0 39 /* Note that flag 4 is available. */
michael@0 40
michael@0 41 /**
michael@0 42 * Converts an internal URI (e.g. a wyciwyg URI) into one which we can
michael@0 43 * expose to the user, for example on the URL bar.
michael@0 44 *
michael@0 45 * @param aURI The URI to be converted
michael@0 46 * @return nsIURI The converted, exposable URI
michael@0 47 * @throws NS_ERROR_MALFORMED_URI when the exposable portion of aURI is malformed
michael@0 48 * @throws NS_ERROR_UNKNOWN_PROTOCOL when we can't get a protocol handler service
michael@0 49 * for the URI scheme.
michael@0 50 */
michael@0 51 nsIURI createExposableURI(in nsIURI aURI);
michael@0 52
michael@0 53 /**
michael@0 54 * Converts the specified string into a URI, first attempting
michael@0 55 * to correct any errors in the syntax or other vagaries. Returns
michael@0 56 * a wellformed URI or nullptr if it can't.
michael@0 57 *
michael@0 58 * @param aURIText Candidate URI.
michael@0 59 * @param aFixupFlags Flags that govern ways the URI may be fixed up.
michael@0 60 * @param aPostData The POST data to submit with the returned
michael@0 61 * URI (see nsISearchSubmission).
michael@0 62 */
michael@0 63 nsIURI createFixupURI(in AUTF8String aURIText, in unsigned long aFixupFlags,
michael@0 64 [optional] out nsIInputStream aPostData);
michael@0 65
michael@0 66 /**
michael@0 67 * Converts the specified keyword string into a URI. Note that it's the
michael@0 68 * caller's responsibility to check whether keywords are enabled and
michael@0 69 * whether aKeyword is a sensible keyword.
michael@0 70 *
michael@0 71 * @param aKeyword The keyword string to convert into a URI
michael@0 72 * @param aPostData The POST data to submit to the returned URI
michael@0 73 * (see nsISearchSubmission).
michael@0 74 *
michael@0 75 * @throws NS_ERROR_FAILURE if the resulting URI requires submission of POST
michael@0 76 * data and aPostData is null.
michael@0 77 */
michael@0 78 nsIURI keywordToURI(in AUTF8String aKeyword,
michael@0 79 [optional] out nsIInputStream aPostData);
michael@0 80 };
michael@0 81

mercurial