toolkit/components/commandlines/nsICommandLineRunner.idl

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.

     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/. */
     5 #include "nsISupports.idl"
     6 #include "nsICommandLine.idl"
     8 [ptr] native nsArgvArray(const char* const);
    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  */
    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);
    37   /**
    38    * Set the windowContext parameter.
    39    */
    40   void setWindowContext(in nsIDOMWindow aWindow);
    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();
    51   /**
    52    * Process and combine the help text provided by each command-line handler.
    53    */
    54   readonly attribute AUTF8String helpText;
    55 };

mercurial