uriloader/exthandler/win/nsMIMEInfoWin.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/uriloader/exthandler/win/nsMIMEInfoWin.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef nsMIMEInfoWin_h_
     1.9 +#define nsMIMEInfoWin_h_
    1.10 +
    1.11 +#include "nsMIMEInfoImpl.h"
    1.12 +#include "nsIPropertyBag.h"
    1.13 +#include "nsIMutableArray.h"
    1.14 +#include "nsTArray.h"
    1.15 +
    1.16 +class nsMIMEInfoWin : public nsMIMEInfoBase, public nsIPropertyBag {
    1.17 +  public:
    1.18 +    nsMIMEInfoWin(const char* aType = "") : nsMIMEInfoBase(aType) {}
    1.19 +    nsMIMEInfoWin(const nsACString& aMIMEType) : nsMIMEInfoBase(aMIMEType) {}
    1.20 +    nsMIMEInfoWin(const nsACString& aType, HandlerClass aClass) :
    1.21 +      nsMIMEInfoBase(aType, aClass) {}
    1.22 +    virtual ~nsMIMEInfoWin();
    1.23 +
    1.24 +    NS_IMETHOD LaunchWithFile(nsIFile* aFile);
    1.25 +    NS_IMETHOD GetHasDefaultHandler(bool * _retval);
    1.26 +    NS_IMETHOD GetPossibleLocalHandlers(nsIArray **_retval); 
    1.27 +
    1.28 +    NS_DECL_ISUPPORTS_INHERITED
    1.29 +    NS_DECL_NSIPROPERTYBAG
    1.30 +
    1.31 +    void SetDefaultApplicationHandler(nsIFile* aDefaultApplication) 
    1.32 +    { 
    1.33 +      mDefaultApplication = aDefaultApplication; 
    1.34 +    }
    1.35 +
    1.36 +  protected:
    1.37 +    virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI);
    1.38 +    virtual nsresult LaunchDefaultWithFile(nsIFile* aFile);
    1.39 +
    1.40 +  private:
    1.41 +    nsCOMPtr<nsIFile>      mDefaultApplication;
    1.42 +    
    1.43 +    // Given a path to a local handler, return its 
    1.44 +    // nsILocalHandlerApp instance.
    1.45 +    bool GetLocalHandlerApp(const nsAString& aCommandHandler,
    1.46 +                              nsCOMPtr<nsILocalHandlerApp>& aApp);
    1.47 +
    1.48 +    // Return the cleaned up file path associated 
    1.49 +    // with a command verb located in root/Applications.
    1.50 +    bool GetAppsVerbCommandHandler(const nsAString& appExeName,
    1.51 +                                     nsAString& applicationPath,
    1.52 +                                     bool bEdit);
    1.53 +
    1.54 +    // Return the cleaned up file path associated 
    1.55 +    // with a progid command verb located in root.
    1.56 +    bool GetProgIDVerbCommandHandler(const nsAString& appProgIDName,
    1.57 +                                       nsAString& applicationPath,
    1.58 +                                       bool bEdit);
    1.59 +
    1.60 +    // Lookup a rundll command handler and return
    1.61 +    // a populated command template for use with rundll32.exe.
    1.62 +    bool GetDllLaunchInfo(nsIFile * aDll,
    1.63 +                            nsIFile * aFile,
    1.64 +                            nsAString& args, bool bEdit);
    1.65 +
    1.66 +    // Helper routine used in tracking app lists
    1.67 +    void ProcessPath(nsCOMPtr<nsIMutableArray>& appList,
    1.68 +                     nsTArray<nsString>& trackList,
    1.69 +                     const nsAString& appFilesystemCommand);
    1.70 +
    1.71 +};
    1.72 +
    1.73 +#endif

mercurial