Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/. */
7 #include "nsISupports.idl"
9 interface nsIURI;
10 interface nsIFile;
11 interface nsIInterfaceRequestor;
12 interface nsIArray;
14 [scriptable, uuid(871cf229-2b21-4f04-b24d-e08061f14815)]
15 interface nsIParentalControlsService : nsISupports
16 {
17 /**
18 * @returns true if the current user account has parental controls
19 * restrictions enabled.
20 */
21 readonly attribute boolean parentalControlsEnabled;
23 /**
24 * @returns true if the current user account parental controls
25 * restrictions include the blocking of all file downloads.
26 */
27 readonly attribute boolean blockFileDownloadsEnabled;
29 /**
30 * Request that blocked URI(s) be allowed through parental
31 * control filters. Returns true if the URI was successfully
32 * overriden. Note, may block while native UI is shown.
33 *
34 * @param aTarget(s) URI to be overridden. In the case of
35 * multiple URI, the first URI in the array
36 * should be the root URI of the site.
37 * @param window Window that generates the event.
38 */
39 boolean requestURIOverride(in nsIURI aTarget, [optional] in nsIInterfaceRequestor aWindowContext);
40 boolean requestURIOverrides(in nsIArray aTargets, [optional] in nsIInterfaceRequestor aWindowContext);
42 /**
43 * @returns true if the current user account has parental controls
44 * logging enabled. If true, applications should log relevent events
45 * using 'log'.
46 */
47 readonly attribute boolean loggingEnabled;
49 /**
50 * Log entry types. Additional types can be defined and implemented
51 * as needed. Other possible event types might include email events,
52 * media related events, and IM events.
53 */
54 const short ePCLog_URIVisit = 1; /* Web content */
55 const short ePCLog_FileDownload = 2; /* File downloads */
57 /**
58 * Log an application specific parental controls
59 * event.
60 *
61 * @param aEntryType Constant defining the type of event.
62 * @param aFlag A flag indicating if the subject content
63 * was blocked.
64 * @param aSource The URI source of the subject content.
65 * @param aTarget The location the content was saved to if
66 * no blocking occurred.
67 */
68 void log(in short aEntryType, in boolean aFlag, in nsIURI aSource, [optional] in nsIFile aTarget);
69 };