toolkit/components/commandlines/nsICommandLineRunner.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/commandlines/nsICommandLineRunner.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#include "nsISupports.idl"
     1.9 +#include "nsICommandLine.idl"
    1.10 +
    1.11 +[ptr] native nsArgvArray(const char* const);
    1.12 +
    1.13 +/**
    1.14 + * Extension of nsICommandLine that allows for initialization of new command lines
    1.15 + * and running the command line actions by processing the command line handlers.
    1.16 + *
    1.17 + * @status INTERNAL - This interface is not meant for use by embedders, and is
    1.18 + *                    not intended to be frozen. If you are an embedder and need
    1.19 + *                    functionality provided by this interface, talk to Benjamin
    1.20 + *                    Smedberg <benjamin@smedbergs.us>.
    1.21 + */
    1.22 +
    1.23 +[uuid(c9f2996c-b25a-4d3d-821f-4cd0c4bc8afb)]
    1.24 +interface nsICommandLineRunner : nsICommandLine
    1.25 +{
    1.26 +  /**
    1.27 +   * This method assumes a native character set, and is meant to be called
    1.28 +   * with the argc/argv passed to main(). Talk to bsmedberg if you need to
    1.29 +   * create a command line using other data. argv will not be altered in any
    1.30 +   * way.
    1.31 +   *
    1.32 +   * On Windows, the "native" character set is UTF-8, not the native codepage.
    1.33 +   *
    1.34 +   * @param workingDir The working directory for resolving file and URI paths.
    1.35 +   * @param state      The nsICommandLine.state flag.
    1.36 +   */
    1.37 +  void init(in long argc, in nsArgvArray argv,
    1.38 +            in nsIFile workingDir, in unsigned long state);
    1.39 +
    1.40 +  /**
    1.41 +   * Set the windowContext parameter.
    1.42 +   */
    1.43 +  void setWindowContext(in nsIDOMWindow aWindow);
    1.44 +
    1.45 +  /**
    1.46 +   * Process the command-line handlers in the proper order, calling "handle()" on
    1.47 +   * each.
    1.48 +   *
    1.49 +   * @throws NS_ERROR_ABORT if any handler throws NS_ERROR_ABORT. All other errors
    1.50 +   *         thrown by handlers will be silently ignored.
    1.51 +   */
    1.52 +  void run();
    1.53 +
    1.54 +  /**
    1.55 +   * Process and combine the help text provided by each command-line handler.
    1.56 +   */
    1.57 +  readonly attribute AUTF8String helpText;
    1.58 +};

mercurial