|
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 nsMIMEInfoWin_h_ |
|
6 #define nsMIMEInfoWin_h_ |
|
7 |
|
8 #include "nsMIMEInfoImpl.h" |
|
9 #include "nsIPropertyBag.h" |
|
10 #include "nsIMutableArray.h" |
|
11 #include "nsTArray.h" |
|
12 |
|
13 class nsMIMEInfoWin : public nsMIMEInfoBase, public nsIPropertyBag { |
|
14 public: |
|
15 nsMIMEInfoWin(const char* aType = "") : nsMIMEInfoBase(aType) {} |
|
16 nsMIMEInfoWin(const nsACString& aMIMEType) : nsMIMEInfoBase(aMIMEType) {} |
|
17 nsMIMEInfoWin(const nsACString& aType, HandlerClass aClass) : |
|
18 nsMIMEInfoBase(aType, aClass) {} |
|
19 virtual ~nsMIMEInfoWin(); |
|
20 |
|
21 NS_IMETHOD LaunchWithFile(nsIFile* aFile); |
|
22 NS_IMETHOD GetHasDefaultHandler(bool * _retval); |
|
23 NS_IMETHOD GetPossibleLocalHandlers(nsIArray **_retval); |
|
24 |
|
25 NS_DECL_ISUPPORTS_INHERITED |
|
26 NS_DECL_NSIPROPERTYBAG |
|
27 |
|
28 void SetDefaultApplicationHandler(nsIFile* aDefaultApplication) |
|
29 { |
|
30 mDefaultApplication = aDefaultApplication; |
|
31 } |
|
32 |
|
33 protected: |
|
34 virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI); |
|
35 virtual nsresult LaunchDefaultWithFile(nsIFile* aFile); |
|
36 |
|
37 private: |
|
38 nsCOMPtr<nsIFile> mDefaultApplication; |
|
39 |
|
40 // Given a path to a local handler, return its |
|
41 // nsILocalHandlerApp instance. |
|
42 bool GetLocalHandlerApp(const nsAString& aCommandHandler, |
|
43 nsCOMPtr<nsILocalHandlerApp>& aApp); |
|
44 |
|
45 // Return the cleaned up file path associated |
|
46 // with a command verb located in root/Applications. |
|
47 bool GetAppsVerbCommandHandler(const nsAString& appExeName, |
|
48 nsAString& applicationPath, |
|
49 bool bEdit); |
|
50 |
|
51 // Return the cleaned up file path associated |
|
52 // with a progid command verb located in root. |
|
53 bool GetProgIDVerbCommandHandler(const nsAString& appProgIDName, |
|
54 nsAString& applicationPath, |
|
55 bool bEdit); |
|
56 |
|
57 // Lookup a rundll command handler and return |
|
58 // a populated command template for use with rundll32.exe. |
|
59 bool GetDllLaunchInfo(nsIFile * aDll, |
|
60 nsIFile * aFile, |
|
61 nsAString& args, bool bEdit); |
|
62 |
|
63 // Helper routine used in tracking app lists |
|
64 void ProcessPath(nsCOMPtr<nsIMutableArray>& appList, |
|
65 nsTArray<nsString>& trackList, |
|
66 const nsAString& appFilesystemCommand); |
|
67 |
|
68 }; |
|
69 |
|
70 #endif |