2000-06-19 02:04:28 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2004-04-17 20:52:41 +04:00
|
|
|
* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
2000-06-19 02:04:28 +04:00
|
|
|
* The Original Code is the Mozilla browser.
|
2004-04-17 20:52:41 +04:00
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications, Inc.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1999
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
2000-06-19 02:04:28 +04:00
|
|
|
* Contributor(s):
|
|
|
|
* Scott MacGregor <mscott@netscape.com>
|
2004-04-17 20:52:41 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-06-19 02:04:28 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIURI;
|
2001-01-25 09:47:12 +03:00
|
|
|
interface nsIFile;
|
2004-10-25 11:46:01 +04:00
|
|
|
interface nsIPrompt;
|
2000-06-19 02:04:28 +04:00
|
|
|
|
2003-09-26 23:49:23 +04:00
|
|
|
/**
|
|
|
|
* The external protocol service is used for finding and launching
|
|
|
|
* platform specific applications for particular protocols.
|
|
|
|
*
|
|
|
|
* You can ask the external protocol service if it has an external
|
|
|
|
* handler for a given protocol scheme. And you can ask it to load
|
|
|
|
* the url using the default handler.
|
|
|
|
*/
|
2004-10-29 20:48:38 +04:00
|
|
|
[scriptable, uuid(a49813a4-98b7-4bdb-998c-8bd9704af0c0)]
|
2000-06-19 02:04:28 +04:00
|
|
|
interface nsIExternalProtocolService : nsISupports
|
|
|
|
{
|
2003-09-26 23:49:23 +04:00
|
|
|
/**
|
|
|
|
* Check whether a handler for a specific protocol exists.
|
|
|
|
* @param aProtocolScheme The scheme from a url: http, ftp, mailto, etc.
|
|
|
|
* @return true if we have a handler and false otherwise.
|
|
|
|
*/
|
2000-06-19 02:04:28 +04:00
|
|
|
boolean externalProtocolHandlerExists(in string aProtocolScheme);
|
|
|
|
|
2003-11-21 03:09:50 +03:00
|
|
|
/**
|
|
|
|
* Check whether a handler for a specific protocol is "exposed" as a visible
|
|
|
|
* feature of the current application.
|
|
|
|
*
|
|
|
|
* An exposed protocol handler is one that can be used in all contexts. A
|
|
|
|
* non-exposed protocol handler is one that can only be used internally by the
|
|
|
|
* application. For example, a non-exposed protocol would not be loaded by the
|
|
|
|
* application in response to a link click or a X-remote openURL command.
|
|
|
|
* Instead, it would be deferred to the system's external protocol handler.
|
|
|
|
*/
|
|
|
|
boolean isExposedProtocol(in string aProtocolScheme);
|
|
|
|
|
2003-09-26 23:49:23 +04:00
|
|
|
/**
|
|
|
|
* Used to load a url via an external protocol handler (if one exists)
|
|
|
|
* @param aURL The url to load
|
|
|
|
*/
|
2004-10-16 17:46:17 +04:00
|
|
|
void loadUrl (in nsIURI aURL);
|
|
|
|
|
2004-10-25 11:46:01 +04:00
|
|
|
/**
|
|
|
|
* Used to load a URI via an external application. Might prompt the user for
|
|
|
|
* permission to load the external application. Replaces loadUrl()
|
|
|
|
*
|
|
|
|
* @param aURI The URI to load
|
|
|
|
* @param aPrompt If null we grab one from windowwatcher if we need it
|
|
|
|
*/
|
|
|
|
void loadURI(in nsIURI aURI, in nsIPrompt aPrompt);
|
|
|
|
|
2004-10-16 17:46:17 +04:00
|
|
|
/**
|
|
|
|
* Gets a human-readable description for the application responsible for
|
|
|
|
* handling a specific protocol.
|
|
|
|
*
|
|
|
|
* @param aScheme The scheme to look up. For example, "mms".
|
|
|
|
*
|
|
|
|
* @throw NS_ERROR_NOT_IMPLEMENTED
|
|
|
|
* If getting descriptions for protocol helpers is not supported
|
|
|
|
* @throw NS_ERROR_NOT_AVAILABLE
|
|
|
|
* If no protocol helper exists for this scheme, or if it is not
|
|
|
|
* possible to get a description for it.
|
|
|
|
*/
|
|
|
|
AString getApplicationDescription(in AUTF8String aScheme);
|
2004-10-25 11:46:01 +04:00
|
|
|
};
|