Import from 1.9a8 tarball
[mozilla-extra.git] / extensions / webdav / public / nsIWebDAVService.idl
blob722af752229f7e7904b2ffdf4dc7b5a9fbf06a94
1 /* -*- Mode: idl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 // vim:expandtab:ts=4 sw=4:
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
16 * The Original Code is Mozilla.
18 * The Initial Developer of the Original Code is
19 * Oracle Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 2004
21 * the Initial Developer. All Rights Reserved.
23 * Contributor(s):
24 * Mike Shaver <shaver@off.net> (original author)
25 * Dan Mosedale <dan.mosedale@oracle.com>
26 * Gary van der Merwe <garyvdm@gmail.com>
28 * Alternatively, the contents of this file may be used under the terms of
29 * either the GNU General Public License Version 2 or later (the "GPL"), or
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the GPL or the LGPL are applicable instead
32 * of those above. If you wish to allow use of your version of this file only
33 * under the terms of either the GPL or the LGPL, and not to allow others to
34 * use your version of this file under the terms of the MPL, indicate your
35 * decision by deleting the provisions above and replace them with the notice
36 * and other provisions required by the GPL or the LGPL. If you do not delete
37 * the provisions above, a recipient may use your version of this file under
38 * the terms of any one of the MPL, the GPL or the LGPL.
40 * ***** END LICENSE BLOCK ***** */
42 #include "nsISupports.idl"
43 #include "nsIWebDAVListener.idl"
44 #include "nsIWebDAVResource.idl"
46 interface nsIStreamListener;
47 interface nsIOutputStream;
48 interface nsIInputStream;
49 interface nsIDOMDocument;
50 interface nsIInterfaceRequestor;
52 [scriptable,uuid(173ef52e-2a2f-45ca-8f9f-abc7429163c2)]
53 interface nsIWebDAVService : nsISupports
55 /**
56 * @param notificationCallbacks
57 * The notification callbacks to be passed to the channel
58 * that will be used to perform this opperation. This is
59 * set by clients, who wish to provide a means to receive
60 * progress, status and protocol-specific notifications.
62 * Interfaces commonly requested include:
63 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
64 * @param closure caller-private data returned via listener
66 void lockResources(in PRUint32 count,
67 [array, size_is(count)]
68 in nsIWebDAVResource resources,
69 in nsIWebDAVOperationListener listener,
70 in nsIInterfaceRequestor notificationCallbacks,
71 in nsISupports closure);
73 /**
74 * @param notificationCallbacks
75 * The notification callbacks to be passed to the channel
76 * that will be used to perform this opperation. This is
77 * set by clients, who wish to provide a means to receive
78 * progress, status and protocol-specific notifications.
80 * Interfaces commonly requested include:
81 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
82 * @param closure caller-private data returned via listener
84 void unlockResources(in PRUint32 count,
85 [array, size_is(count)]
86 in nsIWebDAVResource resources,
87 in nsIWebDAVOperationListener listener,
88 in nsIInterfaceRequestor notificationCallbacks,
89 in nsISupports closure);
90 /**
91 * @param notificationCallbacks
92 * The notification callbacks to be passed to the channel
93 * that will be used to perform this opperation. This is
94 * set by clients, who wish to provide a means to receive
95 * progress, status and protocol-specific notifications.
97 * Interfaces commonly requested include:
98 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
99 * @param closure caller-private data returned via listener
101 void getResourcePropertyNames(in nsIWebDAVResource resource,
102 in boolean withDepth,
103 in nsIWebDAVOperationListener listener,
104 in nsIInterfaceRequestor notificationCallbacks,
105 in nsISupports closure);
107 * @param properties an array of propertynames, where the namespace
108 * and the name of the properties are separated by
109 * a space
110 * @param notificationCallbacks
111 * The notification callbacks to be passed to the channel
112 * that will be used to perform this opperation. This is
113 * set by clients, who wish to provide a means to receive
114 * progress, status and protocol-specific notifications.
116 * Interfaces commonly requested include:
117 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
118 * @param closure caller-private data returned via listener
120 void getResourceProperties(in nsIWebDAVResource resource,
121 in PRUint32 propCount,
122 [array, size_is(propCount)]
123 in string properties, /* XXX wstring? */
124 in boolean withDepth,
125 in nsIWebDAVOperationListener listener,
126 in nsIInterfaceRequestor notificationCallbacks,
127 in nsISupports closure);
129 * @param notificationCallbacks
130 * The notification callbacks to be passed to the channel
131 * that will be used to perform this opperation. This is
132 * set by clients, who wish to provide a means to receive
133 * progress, status and protocol-specific notifications.
135 * Interfaces commonly requested include:
136 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
137 * @param closure caller-private data returned via listener
139 void getResourceOptions(in nsIWebDAVResource resource,
140 in nsIWebDAVOperationListener listener,
141 in nsIInterfaceRequestor notificationCallbacks,
142 in nsISupports closure);
145 * @param notificationCallbacks
146 * The notification callbacks to be passed to the channel
147 * that will be used to perform this opperation. This is
148 * set by clients, who wish to provide a means to receive
149 * progress, status and protocol-specific notifications.
151 * Interfaces commonly requested include:
152 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
153 * XXX need to add a closure param
155 void get(in nsIWebDAVResource resource, in nsIStreamListener listener,
156 in nsIInterfaceRequestor notificationCallbacks);
159 * GET the resource and stick it in the provided OutputStream.
160 * Your output stream must be buffered, or we will fail miserably.
161 * I would check that for you and provide a buffered wrapper automatically,
162 * but there is no way to check if one is needed!
164 * @param notificationCallbacks
165 * The notification callbacks to be passed to the channel
166 * that will be used to perform this opperation. This is
167 * set by clients, who wish to provide a means to receive
168 * progress, status and protocol-specific notifications.
170 * Interfaces commonly requested include:
171 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
172 * @param closure caller-private data returned via listener
174 void getToOutputStream(in nsIWebDAVResource resource,
175 in nsIOutputStream stream,
176 in nsIWebDAVOperationListener listener,
177 in nsIInterfaceRequestor notificationCallbacks,
178 in nsISupports closure);
181 * GET the resource and return it to the listener as a string.
183 * @param notificationCallbacks
184 * The notification callbacks to be passed to the channel
185 * that will be used to perform this opperation. This is
186 * set by clients, who wish to provide a means to receive
187 * progress, status and protocol-specific notifications.
189 * Interfaces commonly requested include:
190 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
191 * @param closure caller-private data returned via listener
193 void getToString(in nsIWebDAVResource resource,
194 in nsIWebDAVOperationListener listener,
195 in nsIInterfaceRequestor notificationCallbacks,
196 in nsISupports closure);
199 * @param notificationCallbacks
200 * The notification callbacks to be passed to the channel
201 * that will be used to perform this opperation. This is
202 * set by clients, who wish to provide a means to receive
203 * progress, status and protocol-specific notifications.
205 * Interfaces commonly requested include:
206 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
207 * @param closure caller-private data returned via listener
209 void put(in nsIWebDAVResource resource, in ACString contentType,
210 in nsIInputStream data, in nsIWebDAVOperationListener listener,
211 in nsIInterfaceRequestor notificationCallbacks,
212 in nsISupports closure);
215 * @param notificationCallbacks
216 * The notification callbacks to be passed to the channel
217 * that will be used to perform this opperation. This is
218 * set by clients, who wish to provide a means to receive
219 * progress, status and protocol-specific notifications.
221 * Interfaces commonly requested include:
222 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
223 * @param closure caller-private data returned via listener
225 void putFromString(in nsIWebDAVResource resource, in ACString contentType,
226 in AUTF8String data,
227 in nsIWebDAVOperationListener listener,
228 in nsIInterfaceRequestor notificationCallbacks,
229 in nsISupports closure);
232 * @param notificationCallbacks
233 * The notification callbacks to be passed to the channel
234 * that will be used to perform this opperation. This is
235 * set by clients, who wish to provide a means to receive
236 * progress, status and protocol-specific notifications.
238 * Interfaces commonly requested include:
239 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
240 * @param closure caller-private data returned via listener
242 void remove(in nsIWebDAVResource resource,
243 in nsIWebDAVOperationListener listener,
244 in nsIInterfaceRequestor notificationCallbacks,
245 in nsISupports closure);
248 * @param notificationCallbacks
249 * The notification callbacks to be passed to the channel
250 * that will be used to perform this opperation. This is
251 * set by clients, who wish to provide a means to receive
252 * progress, status and protocol-specific notifications.
254 * Interfaces commonly requested include:
255 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
256 * @param closure caller-private data returned via listener
258 void moveTo(in nsIWebDAVResource resource,
259 in ACString destination,
260 in boolean overwrite,
261 in nsIWebDAVOperationListener listener,
262 in nsIInterfaceRequestor notificationCallbacks,
263 in nsISupports closure);
266 * @param notificationCallbacks
267 * The notification callbacks to be passed to the channel
268 * that will be used to perform this opperation. This is
269 * set by clients, who wish to provide a means to receive
270 * progress, status and protocol-specific notifications.
272 * Interfaces commonly requested include:
273 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
274 * @param closure caller-private data returned via listener
276 void copyTo(in nsIWebDAVResource resource,
277 in ACString destination,
278 in boolean recursive,
279 in boolean overwrite,
280 in nsIWebDAVOperationListener listener,
281 in nsIInterfaceRequestor notificationCallbacks,
282 in nsISupports closure);
284 * @param notificationCallbacks
285 * The notification callbacks to be passed to the channel
286 * that will be used to perform this opperation. This is
287 * set by clients, who wish to provide a means to receive
288 * progress, status and protocol-specific notifications.
290 * Interfaces commonly requested include:
291 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
292 * @param closure caller-private data returned via listener
294 void makeCollection(in nsIWebDAVResource resource,
295 in nsIWebDAVOperationListener listener,
296 in nsIInterfaceRequestor notificationCallbacks,
297 in nsISupports closure);
300 * Requests the specified report on the given resource with a Depth: header
301 * set to zero.
303 * @param resource the resource to perform this query on?
304 * @param query an XML document of the query
305 * @param withDepth if true, set the Depth header to 1 instead of 0
306 * @param listener results will be called back through this interface
307 * @param notificationCallbacks
308 * The notification callbacks to be passed to the channel
309 * that will be used to perform this opperation. This is
310 * set by clients, who wish to provide a means to receive
311 * progress, status and protocol-specific notifications.
313 * Interfaces commonly requested include:
314 * nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.
315 * @param closure caller-private data returned via listener
317 void report(in nsIWebDAVResource resource,
318 in nsIDOMDocument query,
319 in boolean withDepth,
320 in nsIWebDAVOperationListener listener,
321 in nsIInterfaceRequestor notificationCallbacks,
322 in nsISupports closure);
325 [scriptable,uuid(96c8d65a-fa17-408c-8008-1aa2b95952d4)]
326 interface nsIWebDAVResourceXXX : nsISupports
328 readonly attribute boolean isCollection;
330 void setProperties([array,size_is(count)] in string propname,
331 [array,size_is(count)] in string propvalues,
332 in PRUint32 count);