michael@0: /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsOSHelperAppService_h__ michael@0: #define nsOSHelperAppService_h__ michael@0: michael@0: // The OS helper app service is a subclass of nsExternalHelperAppService and is implemented on each michael@0: // platform. It contains platform specific code for finding helper applications for a given mime type michael@0: // in addition to launching those applications. This is the Mac version. michael@0: michael@0: #include "nsExternalHelperAppService.h" michael@0: #include "nsCExternalHandlerService.h" michael@0: #include "nsMIMEInfoImpl.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: class nsOSHelperAppService : public nsExternalHelperAppService michael@0: { michael@0: public: michael@0: nsOSHelperAppService(); michael@0: virtual ~nsOSHelperAppService(); michael@0: michael@0: // override nsIExternalProtocolService methods michael@0: NS_IMETHOD GetApplicationDescription(const nsACString& aScheme, nsAString& _retval); michael@0: michael@0: // method overrides --> used to hook the mime service into internet config.... michael@0: NS_IMETHOD GetFromTypeAndExtension(const nsACString& aType, const nsACString& aFileExt, nsIMIMEInfo ** aMIMEInfo); michael@0: already_AddRefed GetMIMEInfoFromOS(const nsACString& aMIMEType, const nsACString& aFileExt, bool * aFound); michael@0: NS_IMETHOD GetProtocolHandlerInfoFromOS(const nsACString &aScheme, michael@0: bool *found, michael@0: nsIHandlerInfo **_retval); michael@0: michael@0: // GetFileTokenForPath must be implemented by each platform. michael@0: // platformAppPath --> a platform specific path to an application that we got out of the michael@0: // rdf data source. This can be a mac file spec, a unix path or a windows path depending on the platform michael@0: // aFile --> an nsIFile representation of that platform application path. michael@0: virtual nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile); michael@0: michael@0: nsresult OSProtocolHandlerExists(const char * aScheme, michael@0: bool * aHandlerExists); michael@0: michael@0: private: michael@0: uint32_t mPermissions; michael@0: }; michael@0: michael@0: #endif // nsOSHelperAppService_h__