Bug #38374 --> more updates for external helper application support. (NOT PART OF THE BUILD)

code review will come when this is done and gets turned on.

More mac file updates.
This commit is contained in:
mscott%netscape.com 2000-06-22 04:41:36 +00:00
Родитель 9882e2766e
Коммит ad5c9fe08a
2 изменённых файлов: 51 добавлений и 0 удалений

Просмотреть файл

@ -177,3 +177,41 @@ NS_IMETHODIMP nsOSHelperAppService::LoadUrl(nsIURI * aURL)
return rv;
}
nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * platformAppPath, nsIFile ** aFile)
{
// FIX ME....the incoming path is a mac specific path...create an nsIFile that represents this mac file spec and
// return it.
return NS_ERROR_FAILURE;
}
nsresult nsOSHelperAppService::CreateStreamListenerWithApp(nsIFile * aApplicationToUse, const char * aFileExtension, nsIStreamListener ** aStreamListener)
{
nsresult rv = NS_OK;
// FIX ME.....create an nsExternalApplication instance given aApplicationToUse as the application the user
// has told us he wants to use for this content type.
// return that external application
// create an application that represents this app name...
// here's the windows code to be used as an example
#if 0
nsExternalApplication * application = nsnull;
NS_NEWXPCOM(application, nsExternalApplication);
NS_IF_ADDREF(application);
if (application)
{
application->SetLocalFile(aApplicationToUse);
nsCOMPtr<nsISupports> appSupports = do_QueryInterface(application);
// this code is incomplete and just here to get things started..
nsExternalAppHandler * handler = CreateNewExternalHandler(appSupports, aFileExtension);
handler->QueryInterface(NS_GET_IID(nsIStreamListener), (void **) aStreamListener);
}
NS_IF_RELEASE(application);
#endif
return rv;
}

Просмотреть файл

@ -46,6 +46,19 @@ public:
NS_IMETHOD ExternalProtocolHandlerExists(const char * aProtocolScheme, PRBool * aHandlerExists);
NS_IMETHOD LoadUrl(nsIURI * aURL);
// GetFileTokenForPath must be implemented by each platform.
// platformAppPath --> a platform specific path to an application that we got out of the
// rdf data source. This can be a mac file spec, a unix path or a windows path depending on the platform
// aFile --> an nsIFile representation of that platform application path.
virtual nsresult GetFileTokenForPath(const PRUnichar * platformAppPath, nsIFile ** aFile);
// CreateStreamListenerWithApp --> must be implemented by each platform.
// aApplicationToUse --> the application the user wishes to launch with the incoming data
// aFileExtensionForData --> the extension we are going to use for the temp file in the external app handler
// aStreamListener --> the stream listener (really a external app handler) we're going to use for retrieving the data
virtual nsresult CreateStreamListenerWithApp(nsIFile * aApplicationToUse, const char * aFileExtensionForData, nsIStreamListener ** aStreamListener);
protected:
// add any mac specific service state here