Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 interface nsIURI;
8 interface nsIVariant;
10 [scriptable, uuid(41e4ccc9-f0c8-4cd7-9753-7a38514b8488)]
11 interface mozIVisitInfo : nsISupports
12 {
13 /**
14 * The machine-local (internal) id of the visit.
15 */
16 readonly attribute long long visitId;
18 /**
19 * The time the visit occurred.
20 */
21 readonly attribute PRTime visitDate;
23 /**
24 * The transition type used to get to this visit. One of the TRANSITION_TYPE
25 * constants on nsINavHistory.
26 *
27 * @see nsINavHistory.idl
28 */
29 readonly attribute unsigned long transitionType;
31 /**
32 * The referring URI of this visit. This may be null.
33 */
34 readonly attribute nsIURI referrerURI;
35 };
37 [scriptable, uuid(ad83e137-c92a-4b7b-b67e-0a318811f91e)]
38 interface mozIPlaceInfo : nsISupports
39 {
40 /**
41 * The machine-local (internal) id of the place.
42 */
43 readonly attribute long long placeId;
45 /**
46 * The globally unique id of the place.
47 */
48 readonly attribute ACString guid;
50 /**
51 * The URI of the place.
52 */
53 readonly attribute nsIURI uri;
55 /**
56 * The title associated with the place.
57 */
58 readonly attribute AString title;
60 /**
61 * The frecency of the place.
62 */
63 readonly attribute long long frecency;
65 /**
66 * An array of mozIVisitInfo objects for the place.
67 */
68 [implicit_jscontext]
69 readonly attribute jsval visits;
70 };
72 /**
73 * Shared Callback interface for mozIAsyncHistory methods. The semantics
74 * for each method are detailed in mozIAsyncHistory.
75 */
76 [scriptable, uuid(1f266877-2859-418b-a11b-ec3ae4f4f93d)]
77 interface mozIVisitInfoCallback : nsISupports
78 {
79 /**
80 * Called when the given place could not be processed.
81 *
82 * @param aResultCode
83 * nsresult indicating the failure reason.
84 * @param aPlaceInfo
85 * The information that was given to the caller for the place.
86 */
87 void handleError(in nsresult aResultCode,
88 in mozIPlaceInfo aPlaceInfo);
90 /**
91 * Called for each place processed successfully.
92 *
93 * @param aPlaceInfo
94 * The current info stored for the place.
95 */
96 void handleResult(in mozIPlaceInfo aPlaceInfo);
98 /**
99 * Called when all records were processed.
100 */
101 void handleCompletion();
103 };
105 [scriptable, function, uuid(994092bf-936f-449b-8dd6-0941e024360d)]
106 interface mozIVisitedStatusCallback : nsISupports
107 {
108 /**
109 * Notifies whether a certain URI has been visited.
110 *
111 * @param aURI
112 * URI being notified about.
113 * @param aVisitedStatus
114 * The visited status of aURI.
115 */
116 void isVisited(in nsIURI aURI,
117 in boolean aVisitedStatus);
118 };
120 [scriptable, uuid(1643EFD2-A329-4733-A39D-17069C8D3B2D)]
121 interface mozIAsyncHistory : nsISupports
122 {
123 /**
124 * Gets the available information for the given array of places, each
125 * identified by either nsIURI or places GUID (string).
126 *
127 * The retrieved places info objects DO NOT include the visits data (the
128 * |visits| attribute is set to null).
129 *
130 * If a given place does not exist in the database, aCallback.handleError is
131 * called for it with NS_ERROR_NOT_AVAILABLE result code.
132 *
133 * @param aPlaceIdentifiers
134 * The place[s] for which to retrieve information, identified by either
135 * a single place GUID, a single URI, or a JS array of URIs and/or GUIDs.
136 * @param aCallback
137 * A mozIVisitInfoCallback object which consists of callbacks to be
138 * notified for successful or failed retrievals.
139 * If there's no information available for a given place, aCallback
140 * is called with a stub place info object, containing just the provided
141 * data (GUID or URI).
142 *
143 * @throws NS_ERROR_INVALID_ARG
144 * - Passing in NULL for aPlaceIdentifiers or aCallback.
145 * - Not providing at least one valid GUID or URI.
146 */
147 [implicit_jscontext]
148 void getPlacesInfo(in jsval aPlaceIdentifiers,
149 in mozIVisitInfoCallback aCallback);
151 /**
152 * Adds a set of visits for one or more mozIPlaceInfo objects, and updates
153 * each mozIPlaceInfo's title or guid.
154 *
155 * aCallback.handleResult is called for each visit added.
156 *
157 * @param aPlaceInfo
158 * The mozIPlaceInfo object[s] containing the information to store or
159 * update. This can be a single object, or an array of objects.
160 * @param [optional] aCallback
161 * A mozIVisitInfoCallback object which consists of callbacks to be
162 * notified for successful and/or failed changes.
163 *
164 * @throws NS_ERROR_INVALID_ARG
165 * - Passing in NULL for aPlaceInfo.
166 * - Not providing at least one valid guid, or uri for all
167 * mozIPlaceInfo object[s].
168 * - Not providing an array or nothing for the visits property of
169 * mozIPlaceInfo.
170 * - Not providing a visitDate and transitionType for each
171 * mozIVisitInfo.
172 * - Providing an invalid transitionType for a mozIVisitInfo.
173 */
174 [implicit_jscontext]
175 void updatePlaces(in jsval aPlaceInfo,
176 [optional] in mozIVisitInfoCallback aCallback);
178 /**
179 * Checks if a given URI has been visited.
180 *
181 * @param aURI
182 * The URI to check for.
183 * @param aCallback
184 * A mozIVisitStatusCallback object which receives the visited status.
185 */
186 void isURIVisited(in nsIURI aURI,
187 in mozIVisitedStatusCallback aCallback);
188 };