netwerk/streamconv/public/nsIDirIndexListener.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/streamconv/public/nsIDirIndexListener.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,79 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsIStreamListener.idl"
    1.10 +
    1.11 +interface nsIDirIndex;
    1.12 +
    1.13 +/**
    1.14 + * This interface is used to receive contents of directory index listings
    1.15 + * from a protocol. They can then be transformed into an output format
    1.16 + * (such as rdf, html, etc)
    1.17 + */
    1.18 +[scriptable, uuid(fae4e9a8-1dd1-11b2-b53c-8f3aa1bbf8f5)]
    1.19 +interface nsIDirIndexListener : nsISupports {
    1.20 +    /**
    1.21 +     * Called for each directory entry
    1.22 +     *
    1.23 +     * @param request - the request
    1.24 +     * @param ctxt - opaque parameter
    1.25 +     * @param index - new index to add
    1.26 +     */
    1.27 +    void onIndexAvailable(in nsIRequest aRequest,
    1.28 +                          in nsISupports aCtxt,
    1.29 +                          in nsIDirIndex aIndex);
    1.30 +
    1.31 +    /**
    1.32 +     * Called for each information line
    1.33 +     *
    1.34 +     * @param request - the request
    1.35 +     * @param ctxt - opaque parameter
    1.36 +     * @param info - new info to add
    1.37 +     */
    1.38 +    void onInformationAvailable(in nsIRequest aRequest,
    1.39 +                                in nsISupports aCtxt,
    1.40 +                                in AString aInfo);
    1.41 +
    1.42 +};
    1.43 +
    1.44 +%{C++
    1.45 +#define NS_IDIRINDEXLISTENER_KEY         "@mozilla.org/dirIndexListener;1"
    1.46 +%}
    1.47 +
    1.48 +/**
    1.49 + * A parser for application/http-index-format
    1.50 + */
    1.51 +[scriptable, uuid(38e3066c-1dd2-11b2-9b59-8be515c1ee3f)]
    1.52 +interface nsIDirIndexParser : nsIStreamListener {
    1.53 +    /**
    1.54 +     * The interface to use as a callback for new entries
    1.55 +     */
    1.56 +    attribute nsIDirIndexListener listener;
    1.57 +
    1.58 +    /**
    1.59 +     * The comment given, if any
    1.60 +     * This result is only valid _after_ OnStopRequest has occurred,
    1.61 +     * because it can occur anywhere in the datastream
    1.62 +     */
    1.63 +    readonly attribute string comment;
    1.64 +
    1.65 +    /**
    1.66 +     * The encoding to use
    1.67 +     */
    1.68 +    attribute string encoding;
    1.69 +};
    1.70 +
    1.71 +%{C++
    1.72 +#define NS_DIRINDEXPARSER_CID \
    1.73 +{ /* a0d6ad32-1dd1-11b2-aa55-a40187b54036 */ \
    1.74 +    0xa0d6ad32, \
    1.75 +    0x1dd1, \
    1.76 +    0x11b2, \
    1.77 +    { 0xaa, 0x55, 0xa4, 0x01, 0x87, 0xb5, 0x40, 0x36 } \
    1.78 +}
    1.79 +
    1.80 +#define NS_DIRINDEXPARSER_CONTRACTID "@mozilla.org/dirIndexParser;1"
    1.81 +
    1.82 +%}

mercurial