mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 06:22:20 +00:00

code review will come when this is done and gets turned on. Add a private interface to be shared between the os specific helper app service and the external app handler for launching an app.
71 lines
3.5 KiB
Plaintext
71 lines
3.5 KiB
Plaintext
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
*
|
|
* 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.
|
|
*
|
|
* The Original Code is the Mozilla browser.
|
|
*
|
|
* The Initial Developer of the Original Code is Netscape
|
|
* Communications, Inc. Portions created by Netscape are
|
|
* Copyright (C) 1999, Mozilla. All Rights Reserved.
|
|
*
|
|
* Contributor(s):
|
|
* Scott MacGregor <mscott@netscape.com>
|
|
*/
|
|
|
|
/* The external helper app service is used for finding and launching
|
|
platform specific external applications for a given mime content type.
|
|
*/
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
interface nsIURI;
|
|
interface nsIStreamListener;
|
|
interface nsIFile;
|
|
|
|
|
|
[scriptable, uuid(663CC0AA-42EA-11d4-98D0-001083010E9B)]
|
|
interface nsIExternalHelperAppService : nsISupports
|
|
{
|
|
// canHandleContent: determines if we have an external helper application for a given mime type
|
|
// aMimeContentType --> the specified mime type we are attempting to get a helper application for
|
|
// aUri --> the url for the data we are trying to load. The implementor may need this in order to figure
|
|
// out the file extension of the document.
|
|
// returns TRUE if we have such an app and FALSE otherwise.
|
|
boolean canHandleContent (in string aMimeContentType, in nsIURI aUri);
|
|
|
|
// doContent: binds an external helper application to a stream listener. The caller should pump data
|
|
// into the returned stream listener. When the OnStopRequest is issued, the stream listener implementation
|
|
// will launch the helper app with this data.
|
|
// aMimeContentType --> the content type of the incoming data
|
|
// aURI --> the URI corresponding to the incoming data
|
|
// aWindowContext --> use GetInterface to retrieve properties like the dom window or parent window...
|
|
// the service might need this in order to bring up dialogs.
|
|
// aAbortProcess --> set to TRUE by the helper service if the caller should just forget about loading the document
|
|
// (typically this occurs if the helper app just wants the URI to run and not the data)
|
|
// returns a nsIStreamListener which the caller should pump the data into.
|
|
nsIStreamListener doContent (in string aMimeContentType, in nsIURI aURI,
|
|
in nsISupports aWindowContext, out boolean aAbortProcess);
|
|
};
|
|
|
|
// this is a private interface shared between external app handlers and the platform specific
|
|
// external helper app service
|
|
[scriptable, uuid(491D04D5-449C-11d4-98D0-001083010E9B)]
|
|
interface nsPIExternalAppLauncher : nsISupports
|
|
{
|
|
// launchAppWithTempFile --> used by the handler to actually launch the helper application
|
|
// aTempFile --> the file which contains the data we want the helper app to use when it is launched
|
|
// aAppCookie --> a cookie that was given to the app handler when it was created by the OS specific
|
|
// external helper app service. This cookie contains all the information the service
|
|
// needs to know about the application in order to launch it. It's content differs by
|
|
// platform.
|
|
void launchAppWithTempFile(in nsIFile aTempFile, in nsISupports aAppCookie);
|
|
};
|