1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/toolkit/components/downloads/nsIDownloadManager.idl
3 : */
4 :
5 : #ifndef __gen_nsIDownloadManager_h__
6 : #define __gen_nsIDownloadManager_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : /* For IDL files that don't want to include root IDL files. */
14 : #ifndef NS_NO_VTABLE
15 : #define NS_NO_VTABLE
16 : #endif
17 : class nsIURI; /* forward declaration */
18 :
19 : class nsILocalFile; /* forward declaration */
20 :
21 : class nsIDownload; /* forward declaration */
22 :
23 : class nsICancelable; /* forward declaration */
24 :
25 : class nsIMIMEInfo; /* forward declaration */
26 :
27 : class nsIDownloadProgressListener; /* forward declaration */
28 :
29 : class nsISimpleEnumerator; /* forward declaration */
30 :
31 : class mozIStorageConnection; /* forward declaration */
32 :
33 :
34 : /* starting interface: nsIDownloadManager */
35 : #define NS_IDOWNLOADMANAGER_IID_STR "bacca1ac-1b01-4a6f-9e91-c2ead1f7d2c0"
36 :
37 : #define NS_IDOWNLOADMANAGER_IID \
38 : {0xbacca1ac, 0x1b01, 0x4a6f, \
39 : { 0x9e, 0x91, 0xc2, 0xea, 0xd1, 0xf7, 0xd2, 0xc0 }}
40 :
41 34 : class NS_NO_VTABLE NS_SCRIPTABLE nsIDownloadManager : public nsISupports {
42 : public:
43 :
44 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOWNLOADMANAGER_IID)
45 :
46 : enum {
47 : DOWNLOAD_TYPE_DOWNLOAD = 0,
48 : DOWNLOAD_NOTSTARTED = -1,
49 : DOWNLOAD_DOWNLOADING = 0,
50 : DOWNLOAD_FINISHED = 1,
51 : DOWNLOAD_FAILED = 2,
52 : DOWNLOAD_CANCELED = 3,
53 : DOWNLOAD_PAUSED = 4,
54 : DOWNLOAD_QUEUED = 5,
55 : DOWNLOAD_BLOCKED_PARENTAL = 6,
56 : DOWNLOAD_SCANNING = 7,
57 : DOWNLOAD_DIRTY = 8,
58 : DOWNLOAD_BLOCKED_POLICY = 9
59 : };
60 :
61 : /* nsIDownload addDownload (in short aDownloadType, in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime aStartTime, in nsILocalFile aTempFile, in nsICancelable aCancelable); */
62 : NS_SCRIPTABLE NS_IMETHOD AddDownload(PRInt16 aDownloadType, nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime aStartTime, nsILocalFile *aTempFile, nsICancelable *aCancelable, nsIDownload * *_retval NS_OUTPARAM) = 0;
63 :
64 : /* nsIDownload getDownload (in unsigned long aID); */
65 : NS_SCRIPTABLE NS_IMETHOD GetDownload(PRUint32 aID, nsIDownload * *_retval NS_OUTPARAM) = 0;
66 :
67 : /* void cancelDownload (in unsigned long aID); */
68 : NS_SCRIPTABLE NS_IMETHOD CancelDownload(PRUint32 aID) = 0;
69 :
70 : /* void removeDownload (in unsigned long aID); */
71 : NS_SCRIPTABLE NS_IMETHOD RemoveDownload(PRUint32 aID) = 0;
72 :
73 : /* void removeDownloadsByTimeframe (in long long aBeginTime, in long long aEndTime); */
74 : NS_SCRIPTABLE NS_IMETHOD RemoveDownloadsByTimeframe(PRInt64 aBeginTime, PRInt64 aEndTime) = 0;
75 :
76 : /* void pauseDownload (in unsigned long aID); */
77 : NS_SCRIPTABLE NS_IMETHOD PauseDownload(PRUint32 aID) = 0;
78 :
79 : /* void resumeDownload (in unsigned long aID); */
80 : NS_SCRIPTABLE NS_IMETHOD ResumeDownload(PRUint32 aID) = 0;
81 :
82 : /* void retryDownload (in unsigned long aID); */
83 : NS_SCRIPTABLE NS_IMETHOD RetryDownload(PRUint32 aID) = 0;
84 :
85 : /* readonly attribute mozIStorageConnection DBConnection; */
86 : NS_SCRIPTABLE NS_IMETHOD GetDBConnection(mozIStorageConnection * *aDBConnection) = 0;
87 :
88 : /* readonly attribute boolean canCleanUp; */
89 : NS_SCRIPTABLE NS_IMETHOD GetCanCleanUp(bool *aCanCleanUp) = 0;
90 :
91 : /* void cleanUp (); */
92 : NS_SCRIPTABLE NS_IMETHOD CleanUp(void) = 0;
93 :
94 : /* readonly attribute long activeDownloadCount; */
95 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloadCount(PRInt32 *aActiveDownloadCount) = 0;
96 :
97 : /* readonly attribute nsISimpleEnumerator activeDownloads; */
98 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloads(nsISimpleEnumerator * *aActiveDownloads) = 0;
99 :
100 : /* void addListener (in nsIDownloadProgressListener aListener); */
101 : NS_SCRIPTABLE NS_IMETHOD AddListener(nsIDownloadProgressListener *aListener) = 0;
102 :
103 : /* void removeListener (in nsIDownloadProgressListener aListener); */
104 : NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIDownloadProgressListener *aListener) = 0;
105 :
106 : /* readonly attribute nsILocalFile defaultDownloadsDirectory; */
107 : NS_SCRIPTABLE NS_IMETHOD GetDefaultDownloadsDirectory(nsILocalFile * *aDefaultDownloadsDirectory) = 0;
108 :
109 : /* readonly attribute nsILocalFile userDownloadsDirectory; */
110 : NS_SCRIPTABLE NS_IMETHOD GetUserDownloadsDirectory(nsILocalFile * *aUserDownloadsDirectory) = 0;
111 :
112 : };
113 :
114 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIDownloadManager, NS_IDOWNLOADMANAGER_IID)
115 :
116 : /* Use this macro when declaring classes that implement this interface. */
117 : #define NS_DECL_NSIDOWNLOADMANAGER \
118 : NS_SCRIPTABLE NS_IMETHOD AddDownload(PRInt16 aDownloadType, nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime aStartTime, nsILocalFile *aTempFile, nsICancelable *aCancelable, nsIDownload * *_retval NS_OUTPARAM); \
119 : NS_SCRIPTABLE NS_IMETHOD GetDownload(PRUint32 aID, nsIDownload * *_retval NS_OUTPARAM); \
120 : NS_SCRIPTABLE NS_IMETHOD CancelDownload(PRUint32 aID); \
121 : NS_SCRIPTABLE NS_IMETHOD RemoveDownload(PRUint32 aID); \
122 : NS_SCRIPTABLE NS_IMETHOD RemoveDownloadsByTimeframe(PRInt64 aBeginTime, PRInt64 aEndTime); \
123 : NS_SCRIPTABLE NS_IMETHOD PauseDownload(PRUint32 aID); \
124 : NS_SCRIPTABLE NS_IMETHOD ResumeDownload(PRUint32 aID); \
125 : NS_SCRIPTABLE NS_IMETHOD RetryDownload(PRUint32 aID); \
126 : NS_SCRIPTABLE NS_IMETHOD GetDBConnection(mozIStorageConnection * *aDBConnection); \
127 : NS_SCRIPTABLE NS_IMETHOD GetCanCleanUp(bool *aCanCleanUp); \
128 : NS_SCRIPTABLE NS_IMETHOD CleanUp(void); \
129 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloadCount(PRInt32 *aActiveDownloadCount); \
130 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloads(nsISimpleEnumerator * *aActiveDownloads); \
131 : NS_SCRIPTABLE NS_IMETHOD AddListener(nsIDownloadProgressListener *aListener); \
132 : NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIDownloadProgressListener *aListener); \
133 : NS_SCRIPTABLE NS_IMETHOD GetDefaultDownloadsDirectory(nsILocalFile * *aDefaultDownloadsDirectory); \
134 : NS_SCRIPTABLE NS_IMETHOD GetUserDownloadsDirectory(nsILocalFile * *aUserDownloadsDirectory);
135 :
136 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
137 : #define NS_FORWARD_NSIDOWNLOADMANAGER(_to) \
138 : NS_SCRIPTABLE NS_IMETHOD AddDownload(PRInt16 aDownloadType, nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime aStartTime, nsILocalFile *aTempFile, nsICancelable *aCancelable, nsIDownload * *_retval NS_OUTPARAM) { return _to AddDownload(aDownloadType, aSource, aTarget, aDisplayName, aMIMEInfo, aStartTime, aTempFile, aCancelable, _retval); } \
139 : NS_SCRIPTABLE NS_IMETHOD GetDownload(PRUint32 aID, nsIDownload * *_retval NS_OUTPARAM) { return _to GetDownload(aID, _retval); } \
140 : NS_SCRIPTABLE NS_IMETHOD CancelDownload(PRUint32 aID) { return _to CancelDownload(aID); } \
141 : NS_SCRIPTABLE NS_IMETHOD RemoveDownload(PRUint32 aID) { return _to RemoveDownload(aID); } \
142 : NS_SCRIPTABLE NS_IMETHOD RemoveDownloadsByTimeframe(PRInt64 aBeginTime, PRInt64 aEndTime) { return _to RemoveDownloadsByTimeframe(aBeginTime, aEndTime); } \
143 : NS_SCRIPTABLE NS_IMETHOD PauseDownload(PRUint32 aID) { return _to PauseDownload(aID); } \
144 : NS_SCRIPTABLE NS_IMETHOD ResumeDownload(PRUint32 aID) { return _to ResumeDownload(aID); } \
145 : NS_SCRIPTABLE NS_IMETHOD RetryDownload(PRUint32 aID) { return _to RetryDownload(aID); } \
146 : NS_SCRIPTABLE NS_IMETHOD GetDBConnection(mozIStorageConnection * *aDBConnection) { return _to GetDBConnection(aDBConnection); } \
147 : NS_SCRIPTABLE NS_IMETHOD GetCanCleanUp(bool *aCanCleanUp) { return _to GetCanCleanUp(aCanCleanUp); } \
148 : NS_SCRIPTABLE NS_IMETHOD CleanUp(void) { return _to CleanUp(); } \
149 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloadCount(PRInt32 *aActiveDownloadCount) { return _to GetActiveDownloadCount(aActiveDownloadCount); } \
150 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloads(nsISimpleEnumerator * *aActiveDownloads) { return _to GetActiveDownloads(aActiveDownloads); } \
151 : NS_SCRIPTABLE NS_IMETHOD AddListener(nsIDownloadProgressListener *aListener) { return _to AddListener(aListener); } \
152 : NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIDownloadProgressListener *aListener) { return _to RemoveListener(aListener); } \
153 : NS_SCRIPTABLE NS_IMETHOD GetDefaultDownloadsDirectory(nsILocalFile * *aDefaultDownloadsDirectory) { return _to GetDefaultDownloadsDirectory(aDefaultDownloadsDirectory); } \
154 : NS_SCRIPTABLE NS_IMETHOD GetUserDownloadsDirectory(nsILocalFile * *aUserDownloadsDirectory) { return _to GetUserDownloadsDirectory(aUserDownloadsDirectory); }
155 :
156 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
157 : #define NS_FORWARD_SAFE_NSIDOWNLOADMANAGER(_to) \
158 : NS_SCRIPTABLE NS_IMETHOD AddDownload(PRInt16 aDownloadType, nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime aStartTime, nsILocalFile *aTempFile, nsICancelable *aCancelable, nsIDownload * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDownload(aDownloadType, aSource, aTarget, aDisplayName, aMIMEInfo, aStartTime, aTempFile, aCancelable, _retval); } \
159 : NS_SCRIPTABLE NS_IMETHOD GetDownload(PRUint32 aID, nsIDownload * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDownload(aID, _retval); } \
160 : NS_SCRIPTABLE NS_IMETHOD CancelDownload(PRUint32 aID) { return !_to ? NS_ERROR_NULL_POINTER : _to->CancelDownload(aID); } \
161 : NS_SCRIPTABLE NS_IMETHOD RemoveDownload(PRUint32 aID) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDownload(aID); } \
162 : NS_SCRIPTABLE NS_IMETHOD RemoveDownloadsByTimeframe(PRInt64 aBeginTime, PRInt64 aEndTime) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDownloadsByTimeframe(aBeginTime, aEndTime); } \
163 : NS_SCRIPTABLE NS_IMETHOD PauseDownload(PRUint32 aID) { return !_to ? NS_ERROR_NULL_POINTER : _to->PauseDownload(aID); } \
164 : NS_SCRIPTABLE NS_IMETHOD ResumeDownload(PRUint32 aID) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResumeDownload(aID); } \
165 : NS_SCRIPTABLE NS_IMETHOD RetryDownload(PRUint32 aID) { return !_to ? NS_ERROR_NULL_POINTER : _to->RetryDownload(aID); } \
166 : NS_SCRIPTABLE NS_IMETHOD GetDBConnection(mozIStorageConnection * *aDBConnection) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDBConnection(aDBConnection); } \
167 : NS_SCRIPTABLE NS_IMETHOD GetCanCleanUp(bool *aCanCleanUp) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCanCleanUp(aCanCleanUp); } \
168 : NS_SCRIPTABLE NS_IMETHOD CleanUp(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CleanUp(); } \
169 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloadCount(PRInt32 *aActiveDownloadCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetActiveDownloadCount(aActiveDownloadCount); } \
170 : NS_SCRIPTABLE NS_IMETHOD GetActiveDownloads(nsISimpleEnumerator * *aActiveDownloads) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetActiveDownloads(aActiveDownloads); } \
171 : NS_SCRIPTABLE NS_IMETHOD AddListener(nsIDownloadProgressListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddListener(aListener); } \
172 : NS_SCRIPTABLE NS_IMETHOD RemoveListener(nsIDownloadProgressListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aListener); } \
173 : NS_SCRIPTABLE NS_IMETHOD GetDefaultDownloadsDirectory(nsILocalFile * *aDefaultDownloadsDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultDownloadsDirectory(aDefaultDownloadsDirectory); } \
174 : NS_SCRIPTABLE NS_IMETHOD GetUserDownloadsDirectory(nsILocalFile * *aUserDownloadsDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserDownloadsDirectory(aUserDownloadsDirectory); }
175 :
176 : #if 0
177 : /* Use the code below as a template for the implementation class for this interface. */
178 :
179 : /* Header file */
180 : class nsDownloadManager : public nsIDownloadManager
181 : {
182 : public:
183 : NS_DECL_ISUPPORTS
184 : NS_DECL_NSIDOWNLOADMANAGER
185 :
186 : nsDownloadManager();
187 :
188 : private:
189 : ~nsDownloadManager();
190 :
191 : protected:
192 : /* additional members */
193 : };
194 :
195 : /* Implementation file */
196 : NS_IMPL_ISUPPORTS1(nsDownloadManager, nsIDownloadManager)
197 :
198 : nsDownloadManager::nsDownloadManager()
199 : {
200 : /* member initializers and constructor code */
201 : }
202 :
203 : nsDownloadManager::~nsDownloadManager()
204 : {
205 : /* destructor code */
206 : }
207 :
208 : /* nsIDownload addDownload (in short aDownloadType, in nsIURI aSource, in nsIURI aTarget, in AString aDisplayName, in nsIMIMEInfo aMIMEInfo, in PRTime aStartTime, in nsILocalFile aTempFile, in nsICancelable aCancelable); */
209 : NS_IMETHODIMP nsDownloadManager::AddDownload(PRInt16 aDownloadType, nsIURI *aSource, nsIURI *aTarget, const nsAString & aDisplayName, nsIMIMEInfo *aMIMEInfo, PRTime aStartTime, nsILocalFile *aTempFile, nsICancelable *aCancelable, nsIDownload * *_retval NS_OUTPARAM)
210 : {
211 : return NS_ERROR_NOT_IMPLEMENTED;
212 : }
213 :
214 : /* nsIDownload getDownload (in unsigned long aID); */
215 : NS_IMETHODIMP nsDownloadManager::GetDownload(PRUint32 aID, nsIDownload * *_retval NS_OUTPARAM)
216 : {
217 : return NS_ERROR_NOT_IMPLEMENTED;
218 : }
219 :
220 : /* void cancelDownload (in unsigned long aID); */
221 : NS_IMETHODIMP nsDownloadManager::CancelDownload(PRUint32 aID)
222 : {
223 : return NS_ERROR_NOT_IMPLEMENTED;
224 : }
225 :
226 : /* void removeDownload (in unsigned long aID); */
227 : NS_IMETHODIMP nsDownloadManager::RemoveDownload(PRUint32 aID)
228 : {
229 : return NS_ERROR_NOT_IMPLEMENTED;
230 : }
231 :
232 : /* void removeDownloadsByTimeframe (in long long aBeginTime, in long long aEndTime); */
233 : NS_IMETHODIMP nsDownloadManager::RemoveDownloadsByTimeframe(PRInt64 aBeginTime, PRInt64 aEndTime)
234 : {
235 : return NS_ERROR_NOT_IMPLEMENTED;
236 : }
237 :
238 : /* void pauseDownload (in unsigned long aID); */
239 : NS_IMETHODIMP nsDownloadManager::PauseDownload(PRUint32 aID)
240 : {
241 : return NS_ERROR_NOT_IMPLEMENTED;
242 : }
243 :
244 : /* void resumeDownload (in unsigned long aID); */
245 : NS_IMETHODIMP nsDownloadManager::ResumeDownload(PRUint32 aID)
246 : {
247 : return NS_ERROR_NOT_IMPLEMENTED;
248 : }
249 :
250 : /* void retryDownload (in unsigned long aID); */
251 : NS_IMETHODIMP nsDownloadManager::RetryDownload(PRUint32 aID)
252 : {
253 : return NS_ERROR_NOT_IMPLEMENTED;
254 : }
255 :
256 : /* readonly attribute mozIStorageConnection DBConnection; */
257 : NS_IMETHODIMP nsDownloadManager::GetDBConnection(mozIStorageConnection * *aDBConnection)
258 : {
259 : return NS_ERROR_NOT_IMPLEMENTED;
260 : }
261 :
262 : /* readonly attribute boolean canCleanUp; */
263 : NS_IMETHODIMP nsDownloadManager::GetCanCleanUp(bool *aCanCleanUp)
264 : {
265 : return NS_ERROR_NOT_IMPLEMENTED;
266 : }
267 :
268 : /* void cleanUp (); */
269 : NS_IMETHODIMP nsDownloadManager::CleanUp()
270 : {
271 : return NS_ERROR_NOT_IMPLEMENTED;
272 : }
273 :
274 : /* readonly attribute long activeDownloadCount; */
275 : NS_IMETHODIMP nsDownloadManager::GetActiveDownloadCount(PRInt32 *aActiveDownloadCount)
276 : {
277 : return NS_ERROR_NOT_IMPLEMENTED;
278 : }
279 :
280 : /* readonly attribute nsISimpleEnumerator activeDownloads; */
281 : NS_IMETHODIMP nsDownloadManager::GetActiveDownloads(nsISimpleEnumerator * *aActiveDownloads)
282 : {
283 : return NS_ERROR_NOT_IMPLEMENTED;
284 : }
285 :
286 : /* void addListener (in nsIDownloadProgressListener aListener); */
287 : NS_IMETHODIMP nsDownloadManager::AddListener(nsIDownloadProgressListener *aListener)
288 : {
289 : return NS_ERROR_NOT_IMPLEMENTED;
290 : }
291 :
292 : /* void removeListener (in nsIDownloadProgressListener aListener); */
293 : NS_IMETHODIMP nsDownloadManager::RemoveListener(nsIDownloadProgressListener *aListener)
294 : {
295 : return NS_ERROR_NOT_IMPLEMENTED;
296 : }
297 :
298 : /* readonly attribute nsILocalFile defaultDownloadsDirectory; */
299 : NS_IMETHODIMP nsDownloadManager::GetDefaultDownloadsDirectory(nsILocalFile * *aDefaultDownloadsDirectory)
300 : {
301 : return NS_ERROR_NOT_IMPLEMENTED;
302 : }
303 :
304 : /* readonly attribute nsILocalFile userDownloadsDirectory; */
305 : NS_IMETHODIMP nsDownloadManager::GetUserDownloadsDirectory(nsILocalFile * *aUserDownloadsDirectory)
306 : {
307 : return NS_ERROR_NOT_IMPLEMENTED;
308 : }
309 :
310 : /* End of implementation class template. */
311 : #endif
312 :
313 :
314 : #endif /* __gen_nsIDownloadManager_h__ */
|