2007-07-05 23:31:44 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim:expandtab:shiftwidth=2:tabstop=2:cin:
|
2012-05-21 15:12:37 +04: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 23:31:44 +04:00
|
|
|
|
2007-08-14 20:47:41 +04:00
|
|
|
#ifndef __nsLocalHandlerAppImpl_h__
|
|
|
|
#define __nsLocalHandlerAppImpl_h__
|
2007-07-05 23:31:44 +04:00
|
|
|
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsIMIMEInfo.h"
|
|
|
|
#include "nsIFile.h"
|
2009-09-25 06:45:16 +04:00
|
|
|
#include "nsTArray.h"
|
2007-07-05 23:31:44 +04:00
|
|
|
|
2007-08-14 20:47:41 +04:00
|
|
|
class nsLocalHandlerApp : public nsILocalHandlerApp
|
2007-07-05 23:31:44 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIHANDLERAPP
|
|
|
|
NS_DECL_NSILOCALHANDLERAPP
|
2007-08-14 20:47:41 +04:00
|
|
|
|
|
|
|
nsLocalHandlerApp() { }
|
2007-07-05 23:31:44 +04:00
|
|
|
|
2014-01-04 19:02:17 +04:00
|
|
|
nsLocalHandlerApp(const char16_t *aName, nsIFile *aExecutable)
|
2007-08-14 20:47:41 +04:00
|
|
|
: mName(aName), mExecutable(aExecutable) { }
|
2007-07-05 23:31:44 +04:00
|
|
|
|
|
|
|
nsLocalHandlerApp(const nsAString & aName, nsIFile *aExecutable)
|
2007-08-14 20:47:41 +04:00
|
|
|
: mName(aName), mExecutable(aExecutable) { }
|
2007-07-05 23:31:44 +04:00
|
|
|
|
2007-08-14 20:47:41 +04:00
|
|
|
protected:
|
2014-06-23 22:49:09 +04:00
|
|
|
virtual ~nsLocalHandlerApp() { }
|
|
|
|
|
2007-08-14 20:47:41 +04:00
|
|
|
nsString mName;
|
2009-09-25 06:45:16 +04:00
|
|
|
nsString mDetailedDescription;
|
|
|
|
nsTArray<nsString> mParameters;
|
2007-07-05 23:31:44 +04:00
|
|
|
nsCOMPtr<nsIFile> mExecutable;
|
2007-10-04 10:10:47 +04: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
|
|
|
|
*/
|
2014-06-02 16:08:21 +04:00
|
|
|
nsresult LaunchWithIProcess(const nsCString &aArg);
|
2007-07-05 23:31:44 +04:00
|
|
|
};
|
|
|
|
|
2007-10-04 10:10:47 +04: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 20:47:41 +04:00
|
|
|
#endif // __nsLocalHandlerAppImpl_h__
|