uriloader/exthandler/nsLocalHandlerApp.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/uriloader/exthandler/nsLocalHandlerApp.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim:expandtab:shiftwidth=2:tabstop=2:cin:
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef __nsLocalHandlerAppImpl_h__
    1.11 +#define __nsLocalHandlerAppImpl_h__
    1.12 +
    1.13 +#include "nsString.h"
    1.14 +#include "nsIMIMEInfo.h"
    1.15 +#include "nsIFile.h"
    1.16 +#include "nsTArray.h"
    1.17 +
    1.18 +class nsLocalHandlerApp : public nsILocalHandlerApp
    1.19 +{
    1.20 +public:
    1.21 +  NS_DECL_ISUPPORTS
    1.22 +  NS_DECL_NSIHANDLERAPP
    1.23 +  NS_DECL_NSILOCALHANDLERAPP
    1.24 +
    1.25 +  nsLocalHandlerApp() { }
    1.26 +
    1.27 +  nsLocalHandlerApp(const char16_t *aName, nsIFile *aExecutable) 
    1.28 +    : mName(aName), mExecutable(aExecutable) { }
    1.29 +
    1.30 +  nsLocalHandlerApp(const nsAString & aName, nsIFile *aExecutable) 
    1.31 +    : mName(aName), mExecutable(aExecutable) { }
    1.32 +  virtual ~nsLocalHandlerApp() { }
    1.33 +
    1.34 +protected:
    1.35 +  nsString mName;
    1.36 +  nsString mDetailedDescription;
    1.37 +  nsTArray<nsString> mParameters;
    1.38 +  nsCOMPtr<nsIFile> mExecutable;
    1.39 +  
    1.40 +  /**
    1.41 +   * Launches this application with a single argument (typically either
    1.42 +   * a file path or a URI spec).  This is meant as a helper method for
    1.43 +   * implementations of (e.g.) LaunchWithURI.
    1.44 +   *
    1.45 +   * @param aApp The application to launch (may not be null)
    1.46 +   * @param aArg The argument to pass on the command line
    1.47 +   */
    1.48 +  NS_HIDDEN_(nsresult) LaunchWithIProcess(const nsCString &aArg);
    1.49 +};
    1.50 +
    1.51 +// any platforms that need a platform-specific class instead of just 
    1.52 +// using nsLocalHandlerApp need to add an include and a typedef here.
    1.53 +#ifdef XP_MACOSX
    1.54 +# ifndef NSLOCALHANDLERAPPMAC_H_  
    1.55 +# include "mac/nsLocalHandlerAppMac.h"
    1.56 +typedef nsLocalHandlerAppMac PlatformLocalHandlerApp_t;
    1.57 +# endif
    1.58 +#else 
    1.59 +typedef nsLocalHandlerApp PlatformLocalHandlerApp_t;
    1.60 +#endif
    1.61 +
    1.62 +#endif //  __nsLocalHandlerAppImpl_h__

mercurial