2007-07-05 12:31:44 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim:expandtab:shiftwidth=2:tabstop=2:cin:
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-07-05 12:31:44 -07:00
|
|
|
|
2007-08-14 09:47:41 -07:00
|
|
|
#ifndef __nsLocalHandlerAppImpl_h__
|
|
|
|
#define __nsLocalHandlerAppImpl_h__
|
2007-07-05 12:31:44 -07:00
|
|
|
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsIMIMEInfo.h"
|
|
|
|
#include "nsIFile.h"
|
2009-09-24 19:45:16 -07:00
|
|
|
#include "nsTArray.h"
|
2007-07-05 12:31:44 -07:00
|
|
|
|
2007-08-14 09:47:41 -07:00
|
|
|
class nsLocalHandlerApp : public nsILocalHandlerApp
|
2007-07-05 12:31:44 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIHANDLERAPP
|
|
|
|
NS_DECL_NSILOCALHANDLERAPP
|
2007-08-14 09:47:41 -07:00
|
|
|
|
|
|
|
nsLocalHandlerApp() { }
|
2007-07-05 12:31:44 -07:00
|
|
|
|
|
|
|
nsLocalHandlerApp(const PRUnichar *aName, nsIFile *aExecutable)
|
2007-08-14 09:47:41 -07:00
|
|
|
: mName(aName), mExecutable(aExecutable) { }
|
2007-07-05 12:31:44 -07:00
|
|
|
|
|
|
|
nsLocalHandlerApp(const nsAString & aName, nsIFile *aExecutable)
|
2007-08-14 09:47:41 -07:00
|
|
|
: mName(aName), mExecutable(aExecutable) { }
|
|
|
|
virtual ~nsLocalHandlerApp() { }
|
2007-07-05 12:31:44 -07:00
|
|
|
|
2007-08-14 09:47:41 -07:00
|
|
|
protected:
|
|
|
|
nsString mName;
|
2009-09-24 19:45:16 -07:00
|
|
|
nsString mDetailedDescription;
|
|
|
|
nsTArray<nsString> mParameters;
|
2007-07-05 12:31:44 -07:00
|
|
|
nsCOMPtr<nsIFile> mExecutable;
|
2007-10-03 23:10:47 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Launches this application with a single argument (typically either
|
|
|
|
* a file path or a URI spec). This is meant as a helper method for
|
|
|
|
* implementations of (e.g.) LaunchWithURI.
|
|
|
|
*
|
|
|
|
* @param aApp The application to launch (may not be null)
|
|
|
|
* @param aArg The argument to pass on the command line
|
|
|
|
*/
|
2009-09-24 19:45:16 -07:00
|
|
|
NS_HIDDEN_(nsresult) LaunchWithIProcess(const nsCString &aArg);
|
2007-07-05 12:31:44 -07:00
|
|
|
};
|
|
|
|
|
2007-10-03 23:10:47 -07:00
|
|
|
// any platforms that need a platform-specific class instead of just
|
|
|
|
// using nsLocalHandlerApp need to add an include and a typedef here.
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
# ifndef NSLOCALHANDLERAPPMAC_H_
|
|
|
|
# include "mac/nsLocalHandlerAppMac.h"
|
|
|
|
typedef nsLocalHandlerAppMac PlatformLocalHandlerApp_t;
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
typedef nsLocalHandlerApp PlatformLocalHandlerApp_t;
|
|
|
|
#endif
|
|
|
|
|
2007-08-14 09:47:41 -07:00
|
|
|
#endif // __nsLocalHandlerAppImpl_h__
|