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 nsMIMEInfoWin_h_ michael@0: #define nsMIMEInfoWin_h_ michael@0: michael@0: #include "nsMIMEInfoImpl.h" michael@0: #include "nsIPropertyBag.h" michael@0: #include "nsIMutableArray.h" michael@0: #include "nsTArray.h" michael@0: michael@0: class nsMIMEInfoWin : public nsMIMEInfoBase, public nsIPropertyBag { michael@0: public: michael@0: nsMIMEInfoWin(const char* aType = "") : nsMIMEInfoBase(aType) {} michael@0: nsMIMEInfoWin(const nsACString& aMIMEType) : nsMIMEInfoBase(aMIMEType) {} michael@0: nsMIMEInfoWin(const nsACString& aType, HandlerClass aClass) : michael@0: nsMIMEInfoBase(aType, aClass) {} michael@0: virtual ~nsMIMEInfoWin(); michael@0: michael@0: NS_IMETHOD LaunchWithFile(nsIFile* aFile); michael@0: NS_IMETHOD GetHasDefaultHandler(bool * _retval); michael@0: NS_IMETHOD GetPossibleLocalHandlers(nsIArray **_retval); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_NSIPROPERTYBAG michael@0: michael@0: void SetDefaultApplicationHandler(nsIFile* aDefaultApplication) michael@0: { michael@0: mDefaultApplication = aDefaultApplication; michael@0: } michael@0: michael@0: protected: michael@0: virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI); michael@0: virtual nsresult LaunchDefaultWithFile(nsIFile* aFile); michael@0: michael@0: private: michael@0: nsCOMPtr mDefaultApplication; michael@0: michael@0: // Given a path to a local handler, return its michael@0: // nsILocalHandlerApp instance. michael@0: bool GetLocalHandlerApp(const nsAString& aCommandHandler, michael@0: nsCOMPtr& aApp); michael@0: michael@0: // Return the cleaned up file path associated michael@0: // with a command verb located in root/Applications. michael@0: bool GetAppsVerbCommandHandler(const nsAString& appExeName, michael@0: nsAString& applicationPath, michael@0: bool bEdit); michael@0: michael@0: // Return the cleaned up file path associated michael@0: // with a progid command verb located in root. michael@0: bool GetProgIDVerbCommandHandler(const nsAString& appProgIDName, michael@0: nsAString& applicationPath, michael@0: bool bEdit); michael@0: michael@0: // Lookup a rundll command handler and return michael@0: // a populated command template for use with rundll32.exe. michael@0: bool GetDllLaunchInfo(nsIFile * aDll, michael@0: nsIFile * aFile, michael@0: nsAString& args, bool bEdit); michael@0: michael@0: // Helper routine used in tracking app lists michael@0: void ProcessPath(nsCOMPtr& appList, michael@0: nsTArray& trackList, michael@0: const nsAString& appFilesystemCommand); michael@0: michael@0: }; michael@0: michael@0: #endif