/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

interface nsIURI;

/**
 * An observer of substitutions being set or unset on a
 * SubstitutingProtocolHandler. Useful for receiving asynchronous notification
 * in a child process after a substitution has been set in the parent process
 * and is propagated to the child.
 */
[scriptable, uuid(492c9192-3803-4e2b-8373-d25fe55f5588)]
interface nsISubstitutionObserver : nsISupports
{
    /**
     * To be called when a substition has been set or unset on a protocol
     * handler. Unset operations are identified by a null URI argument.
     *
     * @param aRoot the root key of the mapping
     * @param aBaseURI the base URI to be substituted for the root key by the
     *        protocol handler. For notifications triggered by unset
     *        operations (i.e., when is a substitution is removed from the
     *        protocol handler) this argument is null.
     */
    void onSetSubstitution(in ACString aRoot, in nsIURI aBaseURI);
};
