uriloader/exthandler/win/nsMIMEInfoWin.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     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/. */
     5 #ifndef nsMIMEInfoWin_h_
     6 #define nsMIMEInfoWin_h_
     8 #include "nsMIMEInfoImpl.h"
     9 #include "nsIPropertyBag.h"
    10 #include "nsIMutableArray.h"
    11 #include "nsTArray.h"
    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();
    21     NS_IMETHOD LaunchWithFile(nsIFile* aFile);
    22     NS_IMETHOD GetHasDefaultHandler(bool * _retval);
    23     NS_IMETHOD GetPossibleLocalHandlers(nsIArray **_retval); 
    25     NS_DECL_ISUPPORTS_INHERITED
    26     NS_DECL_NSIPROPERTYBAG
    28     void SetDefaultApplicationHandler(nsIFile* aDefaultApplication) 
    29     { 
    30       mDefaultApplication = aDefaultApplication; 
    31     }
    33   protected:
    34     virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI);
    35     virtual nsresult LaunchDefaultWithFile(nsIFile* aFile);
    37   private:
    38     nsCOMPtr<nsIFile>      mDefaultApplication;
    40     // Given a path to a local handler, return its 
    41     // nsILocalHandlerApp instance.
    42     bool GetLocalHandlerApp(const nsAString& aCommandHandler,
    43                               nsCOMPtr<nsILocalHandlerApp>& aApp);
    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);
    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);
    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);
    63     // Helper routine used in tracking app lists
    64     void ProcessPath(nsCOMPtr<nsIMutableArray>& appList,
    65                      nsTArray<nsString>& trackList,
    66                      const nsAString& appFilesystemCommand);
    68 };
    70 #endif

mercurial