Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
#include "nsISupports.idl"
7
8
interface nsIURI;
9
10
/**
11
* nsINestedURI is an interface that must be implemented by any nsIURI
12
* implementation which has an "inner" URI that it actually gets data
13
* from.
14
*
15
* For example, if URIs for the scheme "sanitize" have the structure:
16
*
17
* sanitize:http://example.com
18
*
19
* and opening a channel on such a sanitize: URI gets the data from
20
* http://example.com, sanitizes it, and returns it, then the sanitize: URI
21
* should implement nsINestedURI and return the http://example.com URI as its
22
* inner URI.
23
*/
24
[scriptable, builtinclass, uuid(6de2c874-796c-46bf-b57f-0d7bd7d6cab0)]
25
interface nsINestedURI : nsISupports
26
{
27
/**
28
* The inner URI for this nested URI. This must not return null if the
29
* getter succeeds; URIs that have no inner must not QI to this interface.
30
* Dynamically changing whether there is an inner URI is not allowed.
31
*
32
* Modifying the returned URI must not in any way modify the nested URI; this
33
* means the returned URI must be either immutable or a clone.
34
*/
35
readonly attribute nsIURI innerURI;
36
37
/**
38
* The innermost URI for this nested URI. This must not return null if the
39
* getter succeeds. This is equivalent to repeatedly calling innerURI while
40
* the returned URI QIs to nsINestedURI.
41
*
42
* Modifying the returned URI must not in any way modify the nested URI; this
43
* means the returned URI must be either immutable or a clone.
44
*/
45
readonly attribute nsIURI innermostURI;
46
};
47
48
[scriptable, builtinclass, uuid(ca3d6c03-4eee-4271-a97a-d16c0a0b2c5c)]
49
interface nsINestedURIMutator : nsISupports
50
{
51
/*
52
* - Creates a new URI with the given innerURI.
53
*/
54
[must_use, noscript] void init(in nsIURI innerURI);
55
};
56
57
[scriptable, builtinclass, uuid(c6357a3b-c2bb-4b4b-9278-513377398a38)]
58
interface nsINestedAboutURIMutator : nsISupports
59
{
60
/*
61
* - Creates a new URI with the given innerURI and base.
62
*/
63
[must_use, noscript] void initWithBase(in nsIURI innerURI, in nsIURI baseURI);
64
};
65
66
[scriptable, builtinclass, uuid(3bd44535-08ea-478f-99b9-85fa1084e820)]
67
interface nsIJSURIMutator : nsISupports
68
{
69
/*
70
* - Inits the URI by setting the base URI
71
* - It is the caller's responsibility to also call SetSpec afterwards,
72
* otherwise we will return an incomplete URI (with only a base)
73
*/
74
[must_use, noscript] void setBase(in nsIURI aBaseURI);
75
};