1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:cin:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __nsLocalHandlerAppImpl_h__
8 #define __nsLocalHandlerAppImpl_h__
11 #include "nsIMIMEInfo.h"
17 class nsLocalHandlerApp
: public nsILocalHandlerApp
{
21 NS_DECL_NSILOCALHANDLERAPP
23 nsLocalHandlerApp() {}
25 nsLocalHandlerApp(const char16_t
* aName
, nsIFile
* aExecutable
)
26 : mName(aName
), mExecutable(aExecutable
) {}
28 nsLocalHandlerApp(const nsAString
& aName
, nsIFile
* aExecutable
)
29 : mName(aName
), mExecutable(aExecutable
) {}
32 virtual ~nsLocalHandlerApp() {}
34 virtual std::function
<nsresult(nsString
&)>
35 GetPrettyNameOnNonMainThreadCallback();
38 nsString mDetailedDescription
;
39 nsTArray
<nsString
> mParameters
;
40 nsCOMPtr
<nsIFile
> mExecutable
;
43 * Launches this application with a single argument (typically either
44 * a file path or a URI spec). This is meant as a helper method for
45 * implementations of (e.g.) LaunchWithURI.
47 * @param aApp The application to launch (may not be null)
48 * @param aArg The argument to pass on the command line
50 nsresult
LaunchWithIProcess(const nsCString
& aArg
);
53 // any platforms that need a platform-specific class instead of just
54 // using nsLocalHandlerApp need to add an include and a typedef here.
56 # ifndef NSLOCALHANDLERAPPMAC_H_
57 # include "mac/nsLocalHandlerAppMac.h"
58 typedef nsLocalHandlerAppMac PlatformLocalHandlerApp_t
;
61 # ifndef NSLOCALHANDLERAPPWIN_H_
62 # include "win/nsLocalHandlerAppWin.h"
63 typedef nsLocalHandlerAppWin PlatformLocalHandlerApp_t
;
66 typedef nsLocalHandlerApp PlatformLocalHandlerApp_t
;
69 #endif // __nsLocalHandlerAppImpl_h__