michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIFile; michael@0: interface nsIInterfaceRequestor; michael@0: interface nsIArray; michael@0: michael@0: [scriptable, uuid(871cf229-2b21-4f04-b24d-e08061f14815)] michael@0: interface nsIParentalControlsService : nsISupports michael@0: { michael@0: /** michael@0: * @returns true if the current user account has parental controls michael@0: * restrictions enabled. michael@0: */ michael@0: readonly attribute boolean parentalControlsEnabled; michael@0: michael@0: /** michael@0: * @returns true if the current user account parental controls michael@0: * restrictions include the blocking of all file downloads. michael@0: */ michael@0: readonly attribute boolean blockFileDownloadsEnabled; michael@0: michael@0: /** michael@0: * Request that blocked URI(s) be allowed through parental michael@0: * control filters. Returns true if the URI was successfully michael@0: * overriden. Note, may block while native UI is shown. michael@0: * michael@0: * @param aTarget(s) URI to be overridden. In the case of michael@0: * multiple URI, the first URI in the array michael@0: * should be the root URI of the site. michael@0: * @param window Window that generates the event. michael@0: */ michael@0: boolean requestURIOverride(in nsIURI aTarget, [optional] in nsIInterfaceRequestor aWindowContext); michael@0: boolean requestURIOverrides(in nsIArray aTargets, [optional] in nsIInterfaceRequestor aWindowContext); michael@0: michael@0: /** michael@0: * @returns true if the current user account has parental controls michael@0: * logging enabled. If true, applications should log relevent events michael@0: * using 'log'. michael@0: */ michael@0: readonly attribute boolean loggingEnabled; michael@0: michael@0: /** michael@0: * Log entry types. Additional types can be defined and implemented michael@0: * as needed. Other possible event types might include email events, michael@0: * media related events, and IM events. michael@0: */ michael@0: const short ePCLog_URIVisit = 1; /* Web content */ michael@0: const short ePCLog_FileDownload = 2; /* File downloads */ michael@0: michael@0: /** michael@0: * Log an application specific parental controls michael@0: * event. michael@0: * michael@0: * @param aEntryType Constant defining the type of event. michael@0: * @param aFlag A flag indicating if the subject content michael@0: * was blocked. michael@0: * @param aSource The URI source of the subject content. michael@0: * @param aTarget The location the content was saved to if michael@0: * no blocking occurred. michael@0: */ michael@0: void log(in short aEntryType, in boolean aFlag, in nsIURI aSource, [optional] in nsIFile aTarget); michael@0: };