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
8interface nsIURI;
9interface nsIChannel;
10interface nsILoadInfo;
11
12[scriptable, uuid(c0c19db9-1b5a-4ac5-b656-ed6f8149fa48)]
13interface nsIAboutModule : nsISupports
14{
15
16    /**
17     * Constructs a new channel for the about protocol module.
18     *
19     * @param aURI the uri of the new channel
20     * @param aLoadInfo the loadinfo of the new channel
21     */
22    nsIChannel newChannel(in nsIURI aURI,
23                          in nsILoadInfo aLoadInfo);
24
25    /**
26     * A flag that indicates whether a URI should be run with content
27     * privileges. If it is, the about: protocol handler will enforce that
28     * the principal of channels created for it be based on their
29     * originalURI or URI (depending on the channel flags), by setting
30     * their "owner" to null.
31     * If content needs to be able to link to this URI, specify
32     * URI_CONTENT_LINKABLE as well.
33     */
34    const unsigned long URI_SAFE_FOR_UNTRUSTED_CONTENT = (1 << 0);
35
36    /**
37     * A flag that indicates whether script should be enabled for the
38     * given about: URI even if it's disabled in general.
39     */
40    const unsigned long ALLOW_SCRIPT = (1 << 1);
41
42    /**
43     * A flag that indicates whether this about: URI doesn't want to be listed
44     * in about:about, especially if it's not useful without a query string.
45     */
46    const unsigned long HIDE_FROM_ABOUTABOUT = (1 << 2);
47
48    /**
49     * A flag that indicates whether this about: URI wants Indexed DB enabled.
50     */
51    const unsigned long ENABLE_INDEXED_DB = (1 << 3);
52
53    /**
54     * A flag that indicates that this URI can be loaded in a child process
55     */
56    const unsigned long URI_CAN_LOAD_IN_CHILD = (1 << 4);
57
58    /**
59     * A flag that indicates that this URI must be loaded in a child process
60     */
61    const unsigned long URI_MUST_LOAD_IN_CHILD = (1 << 5);
62
63    /**
64     * Obsolete. This flag no longer has any effect and will be removed in future.
65     */
66    const unsigned long MAKE_UNLINKABLE = (1 << 6);
67
68    /**
69     * A flag that indicates that this URI should be linkable from content.
70     * Ignored unless URI_SAFE_FOR_UNTRUSTED_CONTENT is also specified.
71     */
72    const unsigned long MAKE_LINKABLE = (1 << 7);
73
74    /**
75     * A method to get the flags that apply to a given about: URI.  The URI
76     * passed in is guaranteed to be one of the URIs that this module
77     * registered to deal with.
78     */
79    unsigned long getURIFlags(in nsIURI aURI);
80};
81
82%{C++
83
84#define NS_ABOUT_MODULE_CONTRACTID        "@mozilla.org/network/protocol/about;1"
85#define NS_ABOUT_MODULE_CONTRACTID_PREFIX NS_ABOUT_MODULE_CONTRACTID "?what="
86#define NS_ABOUT_MODULE_CONTRACTID_LENGTH 49      // strlen(NS_ABOUT_MODULE_CONTRACTID_PREFIX)
87
88%}
89