2000-06-16 21:35:13 +00:00
|
|
|
/* -*- 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;
|
2003-07-01 14:16:06 +00:00
|
|
|
interface nsIRequest;
|
2000-06-16 21:35:13 +00:00
|
|
|
interface nsIStreamListener;
|
|
|
|
interface nsIFile;
|
2000-07-07 01:48:05 +00:00
|
|
|
interface nsIMIMEInfo;
|
2000-10-04 06:54:47 +00:00
|
|
|
interface nsIWebProgressListener;
|
2000-06-16 21:35:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
[scriptable, uuid(663CC0AA-42EA-11d4-98D0-001083010E9B)]
|
|
|
|
interface nsIExternalHelperAppService : nsISupports
|
|
|
|
{
|
|
|
|
// 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
|
2003-07-01 14:16:06 +00:00
|
|
|
// aRequest --> the request corresponding to the incoming data
|
2000-06-16 21:35:13 +00:00
|
|
|
// aWindowContext --> use GetInterface to retrieve properties like the dom window or parent window...
|
|
|
|
// the service might need this in order to bring up dialogs.
|
|
|
|
// returns a nsIStreamListener which the caller should pump the data into.
|
2003-07-01 14:16:06 +00:00
|
|
|
nsIStreamListener doContent (in string aMimeContentType, in nsIRequest aRequest,
|
|
|
|
in nsISupports aWindowContext);
|
2002-02-27 00:43:46 +00:00
|
|
|
|
|
|
|
// applyDecodingForType: returns true if this type is to be decoded
|
|
|
|
// prior to saving or passing off to helper apps,
|
|
|
|
// false otherwise
|
|
|
|
boolean applyDecodingForType (in string aMimeContentType);
|
2002-03-14 00:51:28 +00:00
|
|
|
|
|
|
|
// applyDecodingForExtension: returns false if files with this extension
|
|
|
|
// are not to be decoded prior to saving or
|
|
|
|
// passing off to helper apps, false otherwise
|
|
|
|
boolean applyDecodingForExtension(in string aExtension);
|
2000-06-16 21:35:13 +00:00
|
|
|
};
|
2000-06-17 23:03:24 +00:00
|
|
|
|
|
|
|
// 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
|
2000-07-07 01:48:05 +00:00
|
|
|
void launchAppWithTempFile(in nsIMIMEInfo aMIMEInfo, in nsIFile aTempFile);
|
2001-07-11 03:23:24 +00:00
|
|
|
|
|
|
|
// mscott --> eventually I should move this into a new service so other consumers can add temporary files
|
|
|
|
// they want deleted on exit.
|
|
|
|
// aTemporaryFile --> a temporary file we should delete on exit.
|
|
|
|
|
|
|
|
void deleteTemporaryFileOnExit(in nsIFile aTemporaryFile);
|
2000-07-07 01:48:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// a helper app launcher is a small object created to handle the launching of an external application.
|
|
|
|
|
|
|
|
[scriptable, uuid(9503D0FE-4C9D-11d4-98D0-001083010E9B)]
|
|
|
|
interface nsIHelperAppLauncher : nsISupports
|
|
|
|
{
|
|
|
|
// the mime info object associated with the content type this helper app launcher is currently
|
|
|
|
// attempting to load
|
|
|
|
readonly attribute nsIMIMEInfo MIMEInfo;
|
|
|
|
|
2001-05-03 21:24:36 +00:00
|
|
|
// the source url
|
|
|
|
readonly attribute nsIURI source;
|
|
|
|
|
2002-01-25 22:05:16 +00:00
|
|
|
readonly attribute wstring suggestedFileName;
|
|
|
|
|
2000-07-07 01:48:05 +00:00
|
|
|
// saveToDisk: called when we want to just save the content to a particular file
|
|
|
|
// aNewFileLocation --> location where the content should be saved
|
|
|
|
void saveToDisk(in nsIFile aNewFileLocation, in boolean aRememberThisPreference);
|
|
|
|
|
|
|
|
// launchWithApplication: use aApplication to launch with this content
|
|
|
|
// aApplication --> nsIFile corresponding to the location of the application to use
|
|
|
|
// aRememberThisPreference --> TRUE if we should remember this choice.
|
|
|
|
void launchWithApplication(in nsIFile aApplication, in boolean aRememberThisPreference);
|
|
|
|
|
|
|
|
// called if the user decides to cancel the handling of this content type
|
|
|
|
void Cancel();
|
2000-10-04 06:54:47 +00:00
|
|
|
|
|
|
|
// the following methods are used by the progress dialog to get or set information
|
|
|
|
// on the current helper app launcher download
|
|
|
|
void setWebProgressListener(in nsIWebProgressListener aWebProgressListener);
|
|
|
|
// when the stand along progress window actually closes, it calls this method
|
|
|
|
// so we can release any local state...
|
|
|
|
void closeProgressWindow();
|
|
|
|
|
|
|
|
// aSourceUrl--> the url we are downloading....and the file we are saving too
|
2001-01-25 06:47:12 +00:00
|
|
|
// aTimeDownloadStarted --> time in ms that the download actually began
|
|
|
|
nsIFile getDownloadInfo(out nsIURI aSourceUrl, out long long aTimeDownloadStarted);
|
2000-10-04 06:54:47 +00:00
|
|
|
|
2000-06-17 23:03:24 +00:00
|
|
|
};
|