Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "nsISupports.idl" |
michael@0 | 6 | |
michael@0 | 7 | interface nsICommandLine; |
michael@0 | 8 | |
michael@0 | 9 | /** |
michael@0 | 10 | * Handles arguments on the command line of an XUL application. |
michael@0 | 11 | * |
michael@0 | 12 | * Each handler is registered in the category "command-line-handler". |
michael@0 | 13 | * The entries in this category are read in alphabetical order, and each |
michael@0 | 14 | * category value is treated as a service contractid implementing this |
michael@0 | 15 | * interface. |
michael@0 | 16 | * |
michael@0 | 17 | * By convention, handler with ordinary priority should begin with "m". |
michael@0 | 18 | * |
michael@0 | 19 | * Example: |
michael@0 | 20 | * Category Entry Value |
michael@0 | 21 | * command-line-handler b-jsdebug @mozilla.org/venkman/clh;1 |
michael@0 | 22 | * command-line-handler c-extensions @mozilla.org/extension-manager/clh;1 |
michael@0 | 23 | * command-line-handler m-edit @mozilla.org/composer/clh;1 |
michael@0 | 24 | * command-line-handler m-irc @mozilla.org/chatzilla/clh;1 |
michael@0 | 25 | * command-line-handler y-final @mozilla.org/browser/clh-final;1 |
michael@0 | 26 | * |
michael@0 | 27 | * @note What do we do about localizing helpInfo? Do we make each handler do it, |
michael@0 | 28 | * or provide a generic solution of some sort? Don't freeze this interface |
michael@0 | 29 | * without thinking about this! |
michael@0 | 30 | */ |
michael@0 | 31 | |
michael@0 | 32 | [scriptable, uuid(d4b123df-51ee-48b1-a663-002180e60d3b)] |
michael@0 | 33 | interface nsICommandLineHandler : nsISupports |
michael@0 | 34 | { |
michael@0 | 35 | /** |
michael@0 | 36 | * Process a command line. If this handler finds arguments that it |
michael@0 | 37 | * understands, it should perform the appropriate actions (such as opening |
michael@0 | 38 | * a window), and remove the arguments from the command-line array. |
michael@0 | 39 | * |
michael@0 | 40 | * @throw NS_ERROR_ABORT to immediately cease command-line handling |
michael@0 | 41 | * (if this is STATE_INITIAL_LAUNCH, quits the app). |
michael@0 | 42 | * All other exceptions are silently ignored. |
michael@0 | 43 | */ |
michael@0 | 44 | void handle(in nsICommandLine aCommandLine); |
michael@0 | 45 | |
michael@0 | 46 | /** |
michael@0 | 47 | * When the app is launched with the -help argument, this attribute |
michael@0 | 48 | * is retrieved and displayed to the user (on stdout). The text should |
michael@0 | 49 | * have embedded newlines which wrap at 76 columns, and should include |
michael@0 | 50 | * a newline at the end. By convention, the right column which contains flag |
michael@0 | 51 | * descriptions begins at the 24th character. |
michael@0 | 52 | */ |
michael@0 | 53 | readonly attribute AUTF8String helpInfo; |
michael@0 | 54 | }; |