1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef nsMIMEInfoChild_h 6 #define nsMIMEInfoChild_h 7 8 #include "nsMIMEInfoImpl.h" 9 10 /* 11 * A platform-generic nsMIMEInfo implementation to be used in child process 12 * generic code that needs a MIMEInfo with limited functionality. 13 */ 14 class nsChildProcessMIMEInfo : public nsMIMEInfoImpl { 15 public: 16 explicit nsChildProcessMIMEInfo(const char* aMIMEType = "") nsMIMEInfoImpl(aMIMEType)17 : nsMIMEInfoImpl(aMIMEType) {} 18 nsChildProcessMIMEInfo(const nsACString & aMIMEType)19 explicit nsChildProcessMIMEInfo(const nsACString& aMIMEType) 20 : nsMIMEInfoImpl(aMIMEType) {} 21 nsChildProcessMIMEInfo(const nsACString & aType,HandlerClass aClass)22 nsChildProcessMIMEInfo(const nsACString& aType, HandlerClass aClass) 23 : nsMIMEInfoImpl(aType, aClass) {} 24 LaunchWithFile(nsIFile * aFile)25 NS_IMETHOD LaunchWithFile(nsIFile* aFile) override { 26 return NS_ERROR_NOT_IMPLEMENTED; 27 }; 28 IsCurrentAppOSDefault(bool * _retval)29 NS_IMETHOD IsCurrentAppOSDefault(bool* _retval) override { 30 return NS_ERROR_NOT_IMPLEMENTED; 31 }; 32 33 protected: LoadUriInternal(nsIURI * aURI)34 [[nodiscard]] virtual nsresult LoadUriInternal(nsIURI* aURI) override { 35 return NS_ERROR_NOT_IMPLEMENTED; 36 }; 37 38 #ifdef DEBUG LaunchDefaultWithFile(nsIFile * aFile)39 [[nodiscard]] virtual nsresult LaunchDefaultWithFile( 40 nsIFile* aFile) override { 41 return NS_ERROR_UNEXPECTED; 42 } 43 #endif OpenApplicationWithURI(nsIFile * aApplication,const nsCString & aURI)44 [[nodiscard]] static nsresult OpenApplicationWithURI(nsIFile* aApplication, 45 const nsCString& aURI) { 46 return NS_ERROR_NOT_IMPLEMENTED; 47 } 48 GetDefaultDescription(nsAString & aDefaultDescription)49 NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription) override { 50 return NS_ERROR_NOT_IMPLEMENTED; 51 }; 52 }; 53 54 #endif 55