|
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 #include "nsICommandLine.idl" |
|
7 |
|
8 [ptr] native nsArgvArray(const char* const); |
|
9 |
|
10 /** |
|
11 * Extension of nsICommandLine that allows for initialization of new command lines |
|
12 * and running the command line actions by processing the command line handlers. |
|
13 * |
|
14 * @status INTERNAL - This interface is not meant for use by embedders, and is |
|
15 * not intended to be frozen. If you are an embedder and need |
|
16 * functionality provided by this interface, talk to Benjamin |
|
17 * Smedberg <benjamin@smedbergs.us>. |
|
18 */ |
|
19 |
|
20 [uuid(c9f2996c-b25a-4d3d-821f-4cd0c4bc8afb)] |
|
21 interface nsICommandLineRunner : nsICommandLine |
|
22 { |
|
23 /** |
|
24 * This method assumes a native character set, and is meant to be called |
|
25 * with the argc/argv passed to main(). Talk to bsmedberg if you need to |
|
26 * create a command line using other data. argv will not be altered in any |
|
27 * way. |
|
28 * |
|
29 * On Windows, the "native" character set is UTF-8, not the native codepage. |
|
30 * |
|
31 * @param workingDir The working directory for resolving file and URI paths. |
|
32 * @param state The nsICommandLine.state flag. |
|
33 */ |
|
34 void init(in long argc, in nsArgvArray argv, |
|
35 in nsIFile workingDir, in unsigned long state); |
|
36 |
|
37 /** |
|
38 * Set the windowContext parameter. |
|
39 */ |
|
40 void setWindowContext(in nsIDOMWindow aWindow); |
|
41 |
|
42 /** |
|
43 * Process the command-line handlers in the proper order, calling "handle()" on |
|
44 * each. |
|
45 * |
|
46 * @throws NS_ERROR_ABORT if any handler throws NS_ERROR_ABORT. All other errors |
|
47 * thrown by handlers will be silently ignored. |
|
48 */ |
|
49 void run(); |
|
50 |
|
51 /** |
|
52 * Process and combine the help text provided by each command-line handler. |
|
53 */ |
|
54 readonly attribute AUTF8String helpText; |
|
55 }; |