netwerk/base/public/nsIStandardURL.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIStandardURL.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; 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 "nsIMutable.idl"
    1.10 +
    1.11 +interface nsIURI;
    1.12 +
    1.13 +/**
    1.14 + * nsIStandardURL defines the interface to an URL with the standard
    1.15 + * file path format common to protocols like http, ftp, and file.
    1.16 + * It supports initialization from a relative path and provides
    1.17 + * some customization on how URLs are normalized.
    1.18 + */
    1.19 +[scriptable, uuid(babd6cca-ebe7-4329-967c-d6b9e33caa81)]
    1.20 +interface nsIStandardURL : nsIMutable
    1.21 +{
    1.22 +    /**
    1.23 +     * blah:foo/bar    => blah://foo/bar
    1.24 +     * blah:/foo/bar   => blah:///foo/bar
    1.25 +     * blah://foo/bar  => blah://foo/bar
    1.26 +     * blah:///foo/bar => blah:///foo/bar
    1.27 +     */
    1.28 +    const unsigned long URLTYPE_STANDARD        = 1;
    1.29 +
    1.30 +    /**
    1.31 +     * blah:foo/bar    => blah://foo/bar
    1.32 +     * blah:/foo/bar   => blah://foo/bar
    1.33 +     * blah://foo/bar  => blah://foo/bar
    1.34 +     * blah:///foo/bar => blah://foo/bar
    1.35 +     */
    1.36 +    const unsigned long URLTYPE_AUTHORITY       = 2;
    1.37 +
    1.38 +    /**
    1.39 +     * blah:foo/bar    => blah:///foo/bar
    1.40 +     * blah:/foo/bar   => blah:///foo/bar
    1.41 +     * blah://foo/bar  => blah://foo/bar
    1.42 +     * blah:///foo/bar => blah:///foo/bar
    1.43 +     */
    1.44 +    const unsigned long URLTYPE_NO_AUTHORITY    = 3;
    1.45 +
    1.46 +    /**
    1.47 +     * Initialize a standard URL.
    1.48 +     *
    1.49 +     * @param aUrlType       - one of the URLTYPE_ flags listed above.
    1.50 +     * @param aDefaultPort   - if the port parsed from the URL string matches
    1.51 +     *                         this port, then the port will be removed from the
    1.52 +     *                         canonical form of the URL.
    1.53 +     * @param aSpec          - URL string.
    1.54 +     * @param aOriginCharset - the charset from which this URI string
    1.55 +     *                         originated.  this corresponds to the charset
    1.56 +     *                         that should be used when communicating this
    1.57 +     *                         URI to an origin server, for example.  if
    1.58 +     *                         null, then provide aBaseURI implements this
    1.59 +     *                         interface, the origin charset of aBaseURI will
    1.60 +     *                         be assumed, otherwise defaulting to UTF-8 (i.e.,
    1.61 +     *                         no charset transformation from aSpec).
    1.62 +     * @param aBaseURI       - if null, aSpec must specify an absolute URI.
    1.63 +     *                         otherwise, aSpec will be resolved relative
    1.64 +     *                         to aBaseURI.
    1.65 +     */
    1.66 +    void init(in unsigned long aUrlType,
    1.67 +              in long aDefaultPort,
    1.68 +              in AUTF8String aSpec,
    1.69 +              in string aOriginCharset,
    1.70 +              in nsIURI aBaseURI);
    1.71 +};

mercurial