Public Member Functions | Protected Member Functions

nsOSHelperAppService Class Reference

#include <nsOSHelperAppService.h>

Inheritance diagram for nsOSHelperAppService:
Collaboration diagram for nsOSHelperAppService:

List of all members.

Public Member Functions

 nsOSHelperAppService ()
virtual ~nsOSHelperAppService ()
already_AddRefed< nsIMIMEInfoGetMIMEInfoFromOS (const nsACString &aMimeType, const nsACString &aFileExt, PRBool *aFound)
 Given a mimetype and an extension, looks up a mime info from the OS.
virtual nsresult GetProtocolHandlerInfoFromOS (const nsACString &aScheme, PRBool *found, nsIHandlerInfo **_retval)
nsresult OSProtocolHandlerExists (const char *aProtocolScheme, PRBool *aHandlerExists)
virtual nsresult GetApplicationDescription (const nsACString &aScheme, nsAString &_retval)
virtual nsresult GetFileTokenForPath (const PRUnichar *platformAppPath, nsIFile **aFile)
 Given a string identifying an application, create an nsIFile representing it.

Protected Member Functions

already_AddRefed< nsMIMEInfoBase > GetFromType (const nsCString_external &aMimeType)
already_AddRefed< nsMIMEInfoBase > GetFromExtension (const nsCString_external &aFileExt)
virtual void FixFilePermissions (nsILocalFile *aFile)
 Fixes the file permissions to be correct.

Constructor & Destructor Documentation

nsOSHelperAppService::nsOSHelperAppService (  ) 
virtual nsOSHelperAppService::~nsOSHelperAppService (  )  [virtual]

Member Function Documentation

virtual void nsOSHelperAppService::FixFilePermissions ( nsILocalFile aFile  )  [protected, virtual]

Fixes the file permissions to be correct.

Base class has a no-op implementation, subclasses can use this to correctly inherit ACLs from the parent directory, to make the permissions obey the umask, etc.

Reimplemented from nsExternalHelperAppService.

virtual nsresult nsOSHelperAppService::GetApplicationDescription ( const nsACString aScheme,
nsAString _retval 
) [virtual]
virtual nsresult nsOSHelperAppService::GetFileTokenForPath ( const PRUnichar platformAppPath,
nsIFile **  aFile 
) [virtual]

Given a string identifying an application, create an nsIFile representing it.

This function should look in $PATH for the application. The base class implementation will first try to interpret platformAppPath as an absolute path, and if that fails it will look for a file next to the mozilla executable. Subclasses can override this method if they want a different behaviour.

Parameters:
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 [out] An nsIFile representation of that platform application path.

Reimplemented from nsExternalHelperAppService.

already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromExtension ( const nsCString_external aFileExt  )  [protected]
already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromType ( const nsCString_external aMimeType  )  [protected]
already_AddRefed<nsIMIMEInfo> nsOSHelperAppService::GetMIMEInfoFromOS ( const nsACString aMIMEType,
const nsACString aFileExt,
PRBool aFound 
) [virtual]

Given a mimetype and an extension, looks up a mime info from the OS.

The mime type is given preference. This function follows the same rules as nsIMIMEService::GetFromTypeAndExtension. This is supposed to be overridden by the platform-specific nsOSHelperAppService!

Parameters:
aFileExt The file extension; may be empty. UTF-8 encoded.
[out] aFound Should be set to PR_TRUE if the os has a mapping, to PR_FALSE otherwise. Must not be null.
Returns:
A MIMEInfo. This function must return a MIMEInfo object if it can allocate one. The only justifiable reason for not returning one is an out-of-memory error. If null, the value of aFound is unspecified.

Implements nsExternalHelperAppService.

virtual nsresult nsOSHelperAppService::GetProtocolHandlerInfoFromOS ( const nsACString aScheme,
PRBool found,
nsIHandlerInfo **  _retval 
) [virtual]
nsresult nsOSHelperAppService::OSProtocolHandlerExists ( const char *  aProtocolScheme,
PRBool aHandlerExists 
) [virtual]

The documentation for this class was generated from the following file: