1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/uriloader/exthandler/mac/nsOSHelperAppService.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef nsOSHelperAppService_h__ 1.11 +#define nsOSHelperAppService_h__ 1.12 + 1.13 +// The OS helper app service is a subclass of nsExternalHelperAppService and is implemented on each 1.14 +// platform. It contains platform specific code for finding helper applications for a given mime type 1.15 +// in addition to launching those applications. This is the Mac version. 1.16 + 1.17 +#include "nsExternalHelperAppService.h" 1.18 +#include "nsCExternalHandlerService.h" 1.19 +#include "nsMIMEInfoImpl.h" 1.20 +#include "nsCOMPtr.h" 1.21 + 1.22 +class nsOSHelperAppService : public nsExternalHelperAppService 1.23 +{ 1.24 +public: 1.25 + nsOSHelperAppService(); 1.26 + virtual ~nsOSHelperAppService(); 1.27 + 1.28 + // override nsIExternalProtocolService methods 1.29 + NS_IMETHOD GetApplicationDescription(const nsACString& aScheme, nsAString& _retval); 1.30 + 1.31 + // method overrides --> used to hook the mime service into internet config.... 1.32 + NS_IMETHOD GetFromTypeAndExtension(const nsACString& aType, const nsACString& aFileExt, nsIMIMEInfo ** aMIMEInfo); 1.33 + already_AddRefed<nsIMIMEInfo> GetMIMEInfoFromOS(const nsACString& aMIMEType, const nsACString& aFileExt, bool * aFound); 1.34 + NS_IMETHOD GetProtocolHandlerInfoFromOS(const nsACString &aScheme, 1.35 + bool *found, 1.36 + nsIHandlerInfo **_retval); 1.37 + 1.38 + // GetFileTokenForPath must be implemented by each platform. 1.39 + // platformAppPath --> a platform specific path to an application that we got out of the 1.40 + // rdf data source. This can be a mac file spec, a unix path or a windows path depending on the platform 1.41 + // aFile --> an nsIFile representation of that platform application path. 1.42 + virtual nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile); 1.43 + 1.44 + nsresult OSProtocolHandlerExists(const char * aScheme, 1.45 + bool * aHandlerExists); 1.46 + 1.47 +private: 1.48 + uint32_t mPermissions; 1.49 +}; 1.50 + 1.51 +#endif // nsOSHelperAppService_h__