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