Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * vim: sw=2 ts=2 sts=2 |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | interface nsIURI; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * This interface can be used to add a download to history. There is a separate |
michael@0 | 13 | * interface specifically for downloads in case embedders choose to track |
michael@0 | 14 | * downloads differently from other types of history. |
michael@0 | 15 | */ |
michael@0 | 16 | [scriptable, uuid(4dcd6a12-a091-4f38-8360-022929635746)] |
michael@0 | 17 | interface nsIDownloadHistory : nsISupports { |
michael@0 | 18 | /** |
michael@0 | 19 | * Adds a download to history. This will also notify observers that the |
michael@0 | 20 | * URI aSource is visited with the topic NS_LINK_VISITED_EVENT_TOPIC if |
michael@0 | 21 | * aSource has not yet been visited. |
michael@0 | 22 | * |
michael@0 | 23 | * @param aSource |
michael@0 | 24 | * The source of the download we are adding to history. This cannot be |
michael@0 | 25 | * null. |
michael@0 | 26 | * @param aReferrer |
michael@0 | 27 | * [optional] The referrer of source URI. |
michael@0 | 28 | * @param aStartTime |
michael@0 | 29 | * [optional] The time the download was started. If the start time |
michael@0 | 30 | * is not given, the current time is used. |
michael@0 | 31 | * @param aDestination |
michael@0 | 32 | * [optional] The target where the download is to be saved on the local |
michael@0 | 33 | * filesystem. |
michael@0 | 34 | * @throws NS_ERROR_NOT_AVAILABLE |
michael@0 | 35 | * In a situation where a history implementation is not available, |
michael@0 | 36 | * where 'history implementation' refers to something like |
michael@0 | 37 | * nsIGlobalHistory and friends. |
michael@0 | 38 | * @note This addition is not guaranteed to be synchronous, since it delegates |
michael@0 | 39 | * the actual addition to the underlying history implementation. If you |
michael@0 | 40 | * need to observe the completion of the addition, use the underlying |
michael@0 | 41 | * history implementation's notifications system (e.g. nsINavHistoryObserver |
michael@0 | 42 | * for toolkit's implementation of this interface). |
michael@0 | 43 | */ |
michael@0 | 44 | void addDownload(in nsIURI aSource, [optional] in nsIURI aReferrer, |
michael@0 | 45 | [optional] in PRTime aStartTime, |
michael@0 | 46 | [optional] in nsIURI aDestination); |
michael@0 | 47 | |
michael@0 | 48 | /** |
michael@0 | 49 | * Remove all downloads from history. |
michael@0 | 50 | * |
michael@0 | 51 | * @note This removal is not guaranteed to be synchronous, since it delegates |
michael@0 | 52 | * the actual removal to the underlying history implementation. If you |
michael@0 | 53 | * need to observe the completion of the removal, use the underlying |
michael@0 | 54 | * history implementation's notifications system (e.g. nsINavHistoryObserver |
michael@0 | 55 | * for toolkit's implementation of this interface). |
michael@0 | 56 | */ |
michael@0 | 57 | void removeAllDownloads(); |
michael@0 | 58 | }; |