toolkit/components/commandlines/nsICommandLineValidator.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/commandlines/nsICommandLineValidator.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     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 +
    1.10 +interface nsICommandLine;
    1.11 +
    1.12 +/**
    1.13 + * Validates arguments on the command line of an XUL application.
    1.14 + *
    1.15 + * Each validator is registered in the category "command-line-validator".
    1.16 + * The entries in this category are read in alphabetical order, and each
    1.17 + * category value is treated as a service contractid implementing this
    1.18 + * interface.
    1.19 + *
    1.20 + * By convention, validator with ordinary priority should begin with "m".
    1.21 + *
    1.22 + * Example:
    1.23 + * Category               Entry          Value
    1.24 + * command-line-validator b-browser      @mozilla.org/browser/clh;1
    1.25 + * command-line-validator m-edit         @mozilla.org/composer/clh;1
    1.26 + * command-line-validator m-irc          @mozilla.org/chatzilla/clh;1
    1.27 + *
    1.28 + */
    1.29 +
    1.30 +[scriptable, uuid(5ecaa593-7660-4a3a-957a-92d5770671c7)]
    1.31 +interface nsICommandLineValidator : nsISupports
    1.32 +{
    1.33 +  /**
    1.34 +   * Process the command-line validators in the proper order, calling
    1.35 +   * "validate()" on each.
    1.36 +   *
    1.37 +   * @throws NS_ERROR_ABORT if any validator throws NS_ERROR_ABORT. All other
    1.38 +   *         errors thrown by validators will be silently ignored.
    1.39 +   */
    1.40 +  void validate(in nsICommandLine aCommandLine);
    1.41 +};

mercurial