1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:cin:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsOSHelperAppService_h__
8 #define nsOSHelperAppService_h__
10 // The OS helper app service is a subclass of nsExternalHelperAppService and
11 // is implemented on each platform. It contains platform specific code for
12 // finding helper applications for a given mime type in addition to launching
13 // those applications. This is the UIKit version.
15 #include "nsExternalHelperAppService.h"
16 #include "nsCExternalHandlerService.h"
19 class nsOSHelperAppService final
: public nsExternalHelperAppService
{
21 nsOSHelperAppService();
22 ~nsOSHelperAppService();
24 // override nsIExternalProtocolService methods
25 NS_IMETHOD
GetApplicationDescription(const nsACString
& aScheme
,
26 nsAString
& _retval
) override
;
27 NS_IMETHOD
IsCurrentAppOSDefaultForProtocol(const nsACString
& aScheme
,
28 bool* _retval
) override
;
30 // method overrides --> used to hook the mime service into internet config....
31 NS_IMETHOD
GetFromTypeAndExtension(const nsACString
& aType
,
32 const nsACString
& aFileExt
,
33 nsIMIMEInfo
** aMIMEInfo
) override
;
34 NS_IMETHOD
GetMIMEInfoFromOS(const nsACString
& aMIMEType
,
35 const nsACString
& aFileExt
, bool* aFound
,
36 nsIMIMEInfo
** aMIMEInfo
) override
;
37 NS_IMETHOD
GetProtocolHandlerInfoFromOS(const nsACString
& aScheme
,
39 nsIHandlerInfo
** _retval
) override
;
41 // GetFileTokenForPath must be implemented by each platform.
42 // platformAppPath --> a platform specific path to an application that we got
43 // out of the rdf data source. This can be a mac file
44 // spec, a unix path or a windows path depending on the
46 // aFile --> an nsIFile representation of that platform application path.
47 virtual nsresult
GetFileTokenForPath(const char16_t
* platformAppPath
,
48 nsIFile
** aFile
) override
;
50 nsresult
OSProtocolHandlerExists(const char* aScheme
,
51 bool* aHandlerExists
) override
;
54 #endif // nsOSHelperAppService_h__