uriloader/exthandler/nsLocalHandlerApp.h

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim:expandtab:shiftwidth=2:tabstop=2:cin:
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef __nsLocalHandlerAppImpl_h__
michael@0 8 #define __nsLocalHandlerAppImpl_h__
michael@0 9
michael@0 10 #include "nsString.h"
michael@0 11 #include "nsIMIMEInfo.h"
michael@0 12 #include "nsIFile.h"
michael@0 13 #include "nsTArray.h"
michael@0 14
michael@0 15 class nsLocalHandlerApp : public nsILocalHandlerApp
michael@0 16 {
michael@0 17 public:
michael@0 18 NS_DECL_ISUPPORTS
michael@0 19 NS_DECL_NSIHANDLERAPP
michael@0 20 NS_DECL_NSILOCALHANDLERAPP
michael@0 21
michael@0 22 nsLocalHandlerApp() { }
michael@0 23
michael@0 24 nsLocalHandlerApp(const char16_t *aName, nsIFile *aExecutable)
michael@0 25 : mName(aName), mExecutable(aExecutable) { }
michael@0 26
michael@0 27 nsLocalHandlerApp(const nsAString & aName, nsIFile *aExecutable)
michael@0 28 : mName(aName), mExecutable(aExecutable) { }
michael@0 29 virtual ~nsLocalHandlerApp() { }
michael@0 30
michael@0 31 protected:
michael@0 32 nsString mName;
michael@0 33 nsString mDetailedDescription;
michael@0 34 nsTArray<nsString> mParameters;
michael@0 35 nsCOMPtr<nsIFile> mExecutable;
michael@0 36
michael@0 37 /**
michael@0 38 * Launches this application with a single argument (typically either
michael@0 39 * a file path or a URI spec). This is meant as a helper method for
michael@0 40 * implementations of (e.g.) LaunchWithURI.
michael@0 41 *
michael@0 42 * @param aApp The application to launch (may not be null)
michael@0 43 * @param aArg The argument to pass on the command line
michael@0 44 */
michael@0 45 NS_HIDDEN_(nsresult) LaunchWithIProcess(const nsCString &aArg);
michael@0 46 };
michael@0 47
michael@0 48 // any platforms that need a platform-specific class instead of just
michael@0 49 // using nsLocalHandlerApp need to add an include and a typedef here.
michael@0 50 #ifdef XP_MACOSX
michael@0 51 # ifndef NSLOCALHANDLERAPPMAC_H_
michael@0 52 # include "mac/nsLocalHandlerAppMac.h"
michael@0 53 typedef nsLocalHandlerAppMac PlatformLocalHandlerApp_t;
michael@0 54 # endif
michael@0 55 #else
michael@0 56 typedef nsLocalHandlerApp PlatformLocalHandlerApp_t;
michael@0 57 #endif
michael@0 58
michael@0 59 #endif // __nsLocalHandlerAppImpl_h__

mercurial