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