michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsICommandLine; michael@0: michael@0: /** michael@0: * Handles arguments on the command line of an XUL application. michael@0: * michael@0: * Each handler is registered in the category "command-line-handler". michael@0: * The entries in this category are read in alphabetical order, and each michael@0: * category value is treated as a service contractid implementing this michael@0: * interface. michael@0: * michael@0: * By convention, handler with ordinary priority should begin with "m". michael@0: * michael@0: * Example: michael@0: * Category Entry Value michael@0: * command-line-handler b-jsdebug @mozilla.org/venkman/clh;1 michael@0: * command-line-handler c-extensions @mozilla.org/extension-manager/clh;1 michael@0: * command-line-handler m-edit @mozilla.org/composer/clh;1 michael@0: * command-line-handler m-irc @mozilla.org/chatzilla/clh;1 michael@0: * command-line-handler y-final @mozilla.org/browser/clh-final;1 michael@0: * michael@0: * @note What do we do about localizing helpInfo? Do we make each handler do it, michael@0: * or provide a generic solution of some sort? Don't freeze this interface michael@0: * without thinking about this! michael@0: */ michael@0: michael@0: [scriptable, uuid(d4b123df-51ee-48b1-a663-002180e60d3b)] michael@0: interface nsICommandLineHandler : nsISupports michael@0: { michael@0: /** michael@0: * Process a command line. If this handler finds arguments that it michael@0: * understands, it should perform the appropriate actions (such as opening michael@0: * a window), and remove the arguments from the command-line array. michael@0: * michael@0: * @throw NS_ERROR_ABORT to immediately cease command-line handling michael@0: * (if this is STATE_INITIAL_LAUNCH, quits the app). michael@0: * All other exceptions are silently ignored. michael@0: */ michael@0: void handle(in nsICommandLine aCommandLine); michael@0: michael@0: /** michael@0: * When the app is launched with the -help argument, this attribute michael@0: * is retrieved and displayed to the user (on stdout). The text should michael@0: * have embedded newlines which wrap at 76 columns, and should include michael@0: * a newline at the end. By convention, the right column which contains flag michael@0: * descriptions begins at the 24th character. michael@0: */ michael@0: readonly attribute AUTF8String helpInfo; michael@0: };