1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/parentalcontrols/nsIParentalControlsService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIURI; 1.13 +interface nsIFile; 1.14 +interface nsIInterfaceRequestor; 1.15 +interface nsIArray; 1.16 + 1.17 +[scriptable, uuid(871cf229-2b21-4f04-b24d-e08061f14815)] 1.18 +interface nsIParentalControlsService : nsISupports 1.19 +{ 1.20 + /** 1.21 + * @returns true if the current user account has parental controls 1.22 + * restrictions enabled. 1.23 + */ 1.24 + readonly attribute boolean parentalControlsEnabled; 1.25 + 1.26 + /** 1.27 + * @returns true if the current user account parental controls 1.28 + * restrictions include the blocking of all file downloads. 1.29 + */ 1.30 + readonly attribute boolean blockFileDownloadsEnabled; 1.31 + 1.32 + /** 1.33 + * Request that blocked URI(s) be allowed through parental 1.34 + * control filters. Returns true if the URI was successfully 1.35 + * overriden. Note, may block while native UI is shown. 1.36 + * 1.37 + * @param aTarget(s) URI to be overridden. In the case of 1.38 + * multiple URI, the first URI in the array 1.39 + * should be the root URI of the site. 1.40 + * @param window Window that generates the event. 1.41 + */ 1.42 + boolean requestURIOverride(in nsIURI aTarget, [optional] in nsIInterfaceRequestor aWindowContext); 1.43 + boolean requestURIOverrides(in nsIArray aTargets, [optional] in nsIInterfaceRequestor aWindowContext); 1.44 + 1.45 + /** 1.46 + * @returns true if the current user account has parental controls 1.47 + * logging enabled. If true, applications should log relevent events 1.48 + * using 'log'. 1.49 + */ 1.50 + readonly attribute boolean loggingEnabled; 1.51 + 1.52 + /** 1.53 + * Log entry types. Additional types can be defined and implemented 1.54 + * as needed. Other possible event types might include email events, 1.55 + * media related events, and IM events. 1.56 + */ 1.57 + const short ePCLog_URIVisit = 1; /* Web content */ 1.58 + const short ePCLog_FileDownload = 2; /* File downloads */ 1.59 + 1.60 + /** 1.61 + * Log an application specific parental controls 1.62 + * event. 1.63 + * 1.64 + * @param aEntryType Constant defining the type of event. 1.65 + * @param aFlag A flag indicating if the subject content 1.66 + * was blocked. 1.67 + * @param aSource The URI source of the subject content. 1.68 + * @param aTarget The location the content was saved to if 1.69 + * no blocking occurred. 1.70 + */ 1.71 + void log(in short aEntryType, in boolean aFlag, in nsIURI aSource, [optional] in nsIFile aTarget); 1.72 +};