docshell/base/nsIRefreshURI.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/base/nsIRefreshURI.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface nsIChannel;
    1.13 +interface nsIPrincipal;
    1.14 +interface nsIURI;
    1.15 +
    1.16 +[scriptable, uuid(a5e61a3c-51bd-45be-ac0c-e87b71860656)]
    1.17 +interface nsIRefreshURI : nsISupports {
    1.18 +    /**
    1.19 +      * Load a uri after waiting for aMillis milliseconds. If the docshell
    1.20 +      * is busy loading a page currently, the refresh request will be
    1.21 +      * queued and executed when the current load finishes. 
    1.22 +      *
    1.23 +      * @param aUri The uri to refresh.
    1.24 +      * @param aMillis The number of milliseconds to wait.
    1.25 +      * @param aRepeat Flag to indicate if the uri is to be 
    1.26 +      *                repeatedly refreshed every aMillis milliseconds.
    1.27 +      * @param aMetaRefresh Flag to indicate if this is a Meta refresh.
    1.28 +      */
    1.29 +    void refreshURI(in nsIURI aURI, in long aMillis, in boolean aRepeat,
    1.30 +                    in boolean aMetaRefresh);
    1.31 +
    1.32 +    /**
    1.33 +      * Loads a URI immediately as if it were a refresh.
    1.34 +      *
    1.35 +      * @param aURI The URI to refresh.
    1.36 +      * @param aMillis The number of milliseconds by which this refresh would
    1.37 +      *                be delayed if it were not being forced.
    1.38 +      * @param aMetaRefresh Flag to indicate if this is a meta refresh.
    1.39 +      */
    1.40 +    void forceRefreshURI(in nsIURI aURI, in long aMillis, in boolean aMetaRefresh);
    1.41 +
    1.42 +    /**
    1.43 +      * Checks the passed in channel to see if there is a refresh header, 
    1.44 +      * if there is, will setup a timer to refresh the uri found
    1.45 +      * in the header. If docshell is busy loading a page currently, the
    1.46 +      * request will be queued and executed when the current page 
    1.47 +      * finishes loading. 
    1.48 +      *
    1.49 +      * Returns the NS_REFRESHURI_HEADER_FOUND success code if a refresh
    1.50 +      * header was found and successfully setup.
    1.51 +      *
    1.52 +      * @param aChannel The channel to be parsed. 
    1.53 +      */
    1.54 +    void setupRefreshURI(in nsIChannel aChannel); 
    1.55 +
    1.56 +    /**
    1.57 +      * Parses the passed in header string and sets up a refreshURI if
    1.58 +      * a "refresh" header is found. If docshell is busy loading a page 
    1.59 +      * currently, the request will be queued and executed when 
    1.60 +      * the current page finishes loading. 
    1.61 +      *
    1.62 +      * @param aBaseURI base URI to resolve refresh uri with.
    1.63 +      * @param principal the associated principal
    1.64 +      * @param aHeader  The meta refresh header string.
    1.65 +      */
    1.66 +    void setupRefreshURIFromHeader(in nsIURI aBaseURI, in nsIPrincipal principal, in ACString aHeader);
    1.67 +
    1.68 +    /**
    1.69 +      * Cancels all timer loads.
    1.70 +      */
    1.71 +    void cancelRefreshURITimers();
    1.72 +
    1.73 +   /**
    1.74 +     * True when there are pending refreshes, false otherwise.
    1.75 +     */
    1.76 +   readonly attribute boolean refreshPending;
    1.77 +};

mercurial