michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=2 sts=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: #include "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: michael@0: /** michael@0: * This interface can be used to add a download to history. There is a separate michael@0: * interface specifically for downloads in case embedders choose to track michael@0: * downloads differently from other types of history. michael@0: */ michael@0: [scriptable, uuid(4dcd6a12-a091-4f38-8360-022929635746)] michael@0: interface nsIDownloadHistory : nsISupports { michael@0: /** michael@0: * Adds a download to history. This will also notify observers that the michael@0: * URI aSource is visited with the topic NS_LINK_VISITED_EVENT_TOPIC if michael@0: * aSource has not yet been visited. michael@0: * michael@0: * @param aSource michael@0: * The source of the download we are adding to history. This cannot be michael@0: * null. michael@0: * @param aReferrer michael@0: * [optional] The referrer of source URI. michael@0: * @param aStartTime michael@0: * [optional] The time the download was started. If the start time michael@0: * is not given, the current time is used. michael@0: * @param aDestination michael@0: * [optional] The target where the download is to be saved on the local michael@0: * filesystem. michael@0: * @throws NS_ERROR_NOT_AVAILABLE michael@0: * In a situation where a history implementation is not available, michael@0: * where 'history implementation' refers to something like michael@0: * nsIGlobalHistory and friends. michael@0: * @note This addition is not guaranteed to be synchronous, since it delegates michael@0: * the actual addition to the underlying history implementation. If you michael@0: * need to observe the completion of the addition, use the underlying michael@0: * history implementation's notifications system (e.g. nsINavHistoryObserver michael@0: * for toolkit's implementation of this interface). michael@0: */ michael@0: void addDownload(in nsIURI aSource, [optional] in nsIURI aReferrer, michael@0: [optional] in PRTime aStartTime, michael@0: [optional] in nsIURI aDestination); michael@0: michael@0: /** michael@0: * Remove all downloads from history. michael@0: * michael@0: * @note This removal is not guaranteed to be synchronous, since it delegates michael@0: * the actual removal to the underlying history implementation. If you michael@0: * need to observe the completion of the removal, use the underlying michael@0: * history implementation's notifications system (e.g. nsINavHistoryObserver michael@0: * for toolkit's implementation of this interface). michael@0: */ michael@0: void removeAllDownloads(); michael@0: };