OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0
-Release/WINNT_5.2_Depend/mozilla/netwerk/base/public/nsIRequest.idl |
| 3 */ |
| 4 |
| 5 #ifndef __gen_nsIRequest_h__ |
| 6 #define __gen_nsIRequest_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 nsILoadGroup; /* forward declaration */ |
| 18 |
| 19 typedef PRUint32 nsLoadFlags; |
| 20 |
| 21 |
| 22 /* starting interface: nsIRequest */ |
| 23 #define NS_IREQUEST_IID_STR "ef6bfbd2-fd46-48d8-96b7-9f8f0fd387fe" |
| 24 |
| 25 #define NS_IREQUEST_IID \ |
| 26 {0xef6bfbd2, 0xfd46, 0x48d8, \ |
| 27 { 0x96, 0xb7, 0x9f, 0x8f, 0x0f, 0xd3, 0x87, 0xfe }} |
| 28 |
| 29 /** |
| 30 * nsIRequest |
| 31 * |
| 32 * @status FROZEN |
| 33 */ |
| 34 class NS_NO_VTABLE nsIRequest : public nsISupports { |
| 35 public: |
| 36 |
| 37 NS_DEFINE_STATIC_IID_ACCESSOR(NS_IREQUEST_IID) |
| 38 |
| 39 /** |
| 40 * The name of the request. Often this is the URI of the request. |
| 41 */ |
| 42 /* readonly attribute AUTF8String name; */ |
| 43 NS_IMETHOD GetName(nsACString & aName) = 0; |
| 44 |
| 45 /** |
| 46 * @return TRUE if the request has yet to reach completion. |
| 47 * @return FALSE if the request has reached completion (e.g., after |
| 48 * OnStopRequest has fired). |
| 49 * Suspended requests are still considered pending. |
| 50 */ |
| 51 /* boolean isPending (); */ |
| 52 NS_IMETHOD IsPending(PRBool *_retval) = 0; |
| 53 |
| 54 /** |
| 55 * The error status associated with the request. |
| 56 */ |
| 57 /* readonly attribute nsresult status; */ |
| 58 NS_IMETHOD GetStatus(nsresult *aStatus) = 0; |
| 59 |
| 60 /** |
| 61 * Cancels the current request. This will close any open input or |
| 62 * output streams and terminate any async requests. Users should |
| 63 * normally pass NS_BINDING_ABORTED, although other errors may also |
| 64 * be passed. The error passed in will become the value of the |
| 65 * status attribute. |
| 66 * |
| 67 * @param aStatus the reason for canceling this request. |
| 68 * |
| 69 * NOTE: most nsIRequest implementations expect aStatus to be a |
| 70 * failure code; however, some implementations may allow aStatus to |
| 71 * be a success code such as NS_OK. In general, aStatus should be |
| 72 * a failure code. |
| 73 */ |
| 74 /* void cancel (in nsresult aStatus); */ |
| 75 NS_IMETHOD Cancel(nsresult aStatus) = 0; |
| 76 |
| 77 /** |
| 78 * Suspends the current request. This may have the effect of closing |
| 79 * any underlying transport (in order to free up resources), although |
| 80 * any open streams remain logically opened and will continue delivering |
| 81 * data when the transport is resumed. |
| 82 * |
| 83 * NOTE: some implementations are unable to immediately suspend, and |
| 84 * may continue to deliver events already posted to an event queue. In |
| 85 * general, callers should be capable of handling events even after |
| 86 * suspending a request. |
| 87 */ |
| 88 /* void suspend (); */ |
| 89 NS_IMETHOD Suspend(void) = 0; |
| 90 |
| 91 /** |
| 92 * Resumes the current request. This may have the effect of re-opening |
| 93 * any underlying transport and will resume the delivery of data to |
| 94 * any open streams. |
| 95 */ |
| 96 /* void resume (); */ |
| 97 NS_IMETHOD Resume(void) = 0; |
| 98 |
| 99 /** |
| 100 * The load group of this request. While pending, the request is a |
| 101 * member of the load group. It is the responsibility of the request |
| 102 * to implement this policy. |
| 103 */ |
| 104 /* attribute nsILoadGroup loadGroup; */ |
| 105 NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) = 0; |
| 106 NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup) = 0; |
| 107 |
| 108 /** |
| 109 * The load flags of this request. Bits 0-15 are reserved. |
| 110 * |
| 111 * When added to a load group, this request's load flags are merged with |
| 112 * the load flags of the load group. |
| 113 */ |
| 114 /* attribute nsLoadFlags loadFlags; */ |
| 115 NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) = 0; |
| 116 NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) = 0; |
| 117 |
| 118 /************************************************************************** |
| 119 * Listed below are the various load flags which may be or'd together. |
| 120 */ |
| 121 /** |
| 122 * No special load flags: |
| 123 */ |
| 124 enum { LOAD_NORMAL = 0U }; |
| 125 |
| 126 /** |
| 127 * Don't deliver status notifications to the nsIProgressEventSink, or keep |
| 128 * this load from completing the nsILoadGroup it may belong to. |
| 129 */ |
| 130 enum { LOAD_BACKGROUND = 1U }; |
| 131 |
| 132 /************************************************************************** |
| 133 * The following flags control the flow of data into the cache. |
| 134 */ |
| 135 /** |
| 136 * This flag prevents caching of any kind. It does not, however, prevent |
| 137 * cached content from being used to satisfy this request. |
| 138 */ |
| 139 enum { INHIBIT_CACHING = 128U }; |
| 140 |
| 141 /** |
| 142 * This flag prevents caching on disk (or other persistent media), which |
| 143 * may be needed to preserve privacy. For HTTPS, this flag is set auto- |
| 144 * matically. |
| 145 */ |
| 146 enum { INHIBIT_PERSISTENT_CACHING = 256U }; |
| 147 |
| 148 /************************************************************************** |
| 149 * The following flags control what happens when the cache contains data |
| 150 * that could perhaps satisfy this request. They are listed in descending |
| 151 * order of precidence. |
| 152 */ |
| 153 /** |
| 154 * Force an end-to-end download of content data from the origin server. |
| 155 * This flag is used for a shift-reload. |
| 156 */ |
| 157 enum { LOAD_BYPASS_CACHE = 512U }; |
| 158 |
| 159 /** |
| 160 * Load from the cache, bypassing protocol specific validation logic. This |
| 161 * flag is used when browsing via history. It is not recommended for normal |
| 162 * browsing as it may likely violate reasonable assumptions made by the |
| 163 * server and confuse users. |
| 164 */ |
| 165 enum { LOAD_FROM_CACHE = 1024U }; |
| 166 |
| 167 /** |
| 168 * The following flags control the frequency of cached content validation |
| 169 * when neither LOAD_BYPASS_CACHE or LOAD_FROM_CACHE are set. By default, |
| 170 * cached content is automatically validated if necessary before reuse. |
| 171 * |
| 172 * VALIDATE_ALWAYS forces validation of any cached content independent of |
| 173 * its expiration time. |
| 174 * |
| 175 * VALIDATE_NEVER disables validation of expired content. |
| 176 * |
| 177 * VALIDATE_ONCE_PER_SESSION disables validation of expired content, |
| 178 * provided it has already been validated (at least once) since the start |
| 179 * of this session. |
| 180 * |
| 181 * NOTE TO IMPLEMENTORS: |
| 182 * These flags are intended for normal browsing, and they should therefore |
| 183 * not apply to content that must be validated before each use. Consider, |
| 184 * for example, a HTTP response with a "Cache-control: no-cache" header. |
| 185 * According to RFC2616, this response must be validated before it can |
| 186 * be taken from a cache. Breaking this requirement could result in |
| 187 * incorrect and potentially undesirable side-effects. |
| 188 */ |
| 189 enum { VALIDATE_ALWAYS = 2048U }; |
| 190 |
| 191 enum { VALIDATE_NEVER = 4096U }; |
| 192 |
| 193 enum { VALIDATE_ONCE_PER_SESSION = 8192U }; |
| 194 |
| 195 }; |
| 196 |
| 197 /* Use this macro when declaring classes that implement this interface. */ |
| 198 #define NS_DECL_NSIREQUEST \ |
| 199 NS_IMETHOD GetName(nsACString & aName); \ |
| 200 NS_IMETHOD IsPending(PRBool *_retval); \ |
| 201 NS_IMETHOD GetStatus(nsresult *aStatus); \ |
| 202 NS_IMETHOD Cancel(nsresult aStatus); \ |
| 203 NS_IMETHOD Suspend(void); \ |
| 204 NS_IMETHOD Resume(void); \ |
| 205 NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup); \ |
| 206 NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup); \ |
| 207 NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags); \ |
| 208 NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags); \ |
| 209 |
| 210 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 211 #define NS_FORWARD_NSIREQUEST(_to) \ |
| 212 NS_IMETHOD GetName(nsACString & aName) { return _to GetName(aName); } \ |
| 213 NS_IMETHOD IsPending(PRBool *_retval) { return _to IsPending(_retval); } \ |
| 214 NS_IMETHOD GetStatus(nsresult *aStatus) { return _to GetStatus(aStatus); } \ |
| 215 NS_IMETHOD Cancel(nsresult aStatus) { return _to Cancel(aStatus); } \ |
| 216 NS_IMETHOD Suspend(void) { return _to Suspend(); } \ |
| 217 NS_IMETHOD Resume(void) { return _to Resume(); } \ |
| 218 NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) { return _to GetLoadGroup(
aLoadGroup); } \ |
| 219 NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup) { return _to SetLoadGroup(a
LoadGroup); } \ |
| 220 NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) { return _to GetLoadFlags(aLo
adFlags); } \ |
| 221 NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) { return _to SetLoadFlags(aLoa
dFlags); } \ |
| 222 |
| 223 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 224 #define NS_FORWARD_SAFE_NSIREQUEST(_to) \ |
| 225 NS_IMETHOD GetName(nsACString & aName) { return !_to ? NS_ERROR_NULL_POINTER :
_to->GetName(aName); } \ |
| 226 NS_IMETHOD IsPending(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER :
_to->IsPending(_retval); } \ |
| 227 NS_IMETHOD GetStatus(nsresult *aStatus) { return !_to ? NS_ERROR_NULL_POINTER
: _to->GetStatus(aStatus); } \ |
| 228 NS_IMETHOD Cancel(nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _t
o->Cancel(aStatus); } \ |
| 229 NS_IMETHOD Suspend(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Suspend(
); } \ |
| 230 NS_IMETHOD Resume(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Resume();
} \ |
| 231 NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) { return !_to ? NS_ERROR_N
ULL_POINTER : _to->GetLoadGroup(aLoadGroup); } \ |
| 232 NS_IMETHOD SetLoadGroup(nsILoadGroup * aLoadGroup) { return !_to ? NS_ERROR_NU
LL_POINTER : _to->SetLoadGroup(aLoadGroup); } \ |
| 233 NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) { return !_to ? NS_ERROR_NULL
_POINTER : _to->GetLoadFlags(aLoadFlags); } \ |
| 234 NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) { return !_to ? NS_ERROR_NULL_
POINTER : _to->SetLoadFlags(aLoadFlags); } \ |
| 235 |
| 236 #if 0 |
| 237 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 238 |
| 239 /* Header file */ |
| 240 class nsRequest : public nsIRequest |
| 241 { |
| 242 public: |
| 243 NS_DECL_ISUPPORTS |
| 244 NS_DECL_NSIREQUEST |
| 245 |
| 246 nsRequest(); |
| 247 |
| 248 private: |
| 249 ~nsRequest(); |
| 250 |
| 251 protected: |
| 252 /* additional members */ |
| 253 }; |
| 254 |
| 255 /* Implementation file */ |
| 256 NS_IMPL_ISUPPORTS1(nsRequest, nsIRequest) |
| 257 |
| 258 nsRequest::nsRequest() |
| 259 { |
| 260 /* member initializers and constructor code */ |
| 261 } |
| 262 |
| 263 nsRequest::~nsRequest() |
| 264 { |
| 265 /* destructor code */ |
| 266 } |
| 267 |
| 268 /* readonly attribute AUTF8String name; */ |
| 269 NS_IMETHODIMP nsRequest::GetName(nsACString & aName) |
| 270 { |
| 271 return NS_ERROR_NOT_IMPLEMENTED; |
| 272 } |
| 273 |
| 274 /* boolean isPending (); */ |
| 275 NS_IMETHODIMP nsRequest::IsPending(PRBool *_retval) |
| 276 { |
| 277 return NS_ERROR_NOT_IMPLEMENTED; |
| 278 } |
| 279 |
| 280 /* readonly attribute nsresult status; */ |
| 281 NS_IMETHODIMP nsRequest::GetStatus(nsresult *aStatus) |
| 282 { |
| 283 return NS_ERROR_NOT_IMPLEMENTED; |
| 284 } |
| 285 |
| 286 /* void cancel (in nsresult aStatus); */ |
| 287 NS_IMETHODIMP nsRequest::Cancel(nsresult aStatus) |
| 288 { |
| 289 return NS_ERROR_NOT_IMPLEMENTED; |
| 290 } |
| 291 |
| 292 /* void suspend (); */ |
| 293 NS_IMETHODIMP nsRequest::Suspend() |
| 294 { |
| 295 return NS_ERROR_NOT_IMPLEMENTED; |
| 296 } |
| 297 |
| 298 /* void resume (); */ |
| 299 NS_IMETHODIMP nsRequest::Resume() |
| 300 { |
| 301 return NS_ERROR_NOT_IMPLEMENTED; |
| 302 } |
| 303 |
| 304 /* attribute nsILoadGroup loadGroup; */ |
| 305 NS_IMETHODIMP nsRequest::GetLoadGroup(nsILoadGroup * *aLoadGroup) |
| 306 { |
| 307 return NS_ERROR_NOT_IMPLEMENTED; |
| 308 } |
| 309 NS_IMETHODIMP nsRequest::SetLoadGroup(nsILoadGroup * aLoadGroup) |
| 310 { |
| 311 return NS_ERROR_NOT_IMPLEMENTED; |
| 312 } |
| 313 |
| 314 /* attribute nsLoadFlags loadFlags; */ |
| 315 NS_IMETHODIMP nsRequest::GetLoadFlags(nsLoadFlags *aLoadFlags) |
| 316 { |
| 317 return NS_ERROR_NOT_IMPLEMENTED; |
| 318 } |
| 319 NS_IMETHODIMP nsRequest::SetLoadFlags(nsLoadFlags aLoadFlags) |
| 320 { |
| 321 return NS_ERROR_NOT_IMPLEMENTED; |
| 322 } |
| 323 |
| 324 /* End of implementation class template. */ |
| 325 #endif |
| 326 |
| 327 |
| 328 #endif /* __gen_nsIRequest_h__ */ |
OLD | NEW |