2000-02-28 16:30:00 +00:00
|
|
|
<?xml version="1.0"?>
|
2000-07-04 19:53:39 +00:00
|
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
|
|
|
<gsdoc base="NSURLHandle" prev="NSURL" next="NSUnarchiver" up="Base">
|
2000-02-28 16:30:00 +00:00
|
|
|
<head>
|
|
|
|
<title>NSURLHandle</title>
|
|
|
|
<author name="Richard Frith-Macdonald">
|
|
|
|
<email address="rfm@gnu.org"/>
|
|
|
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
|
|
|
</author>
|
|
|
|
<version>0.1</version>
|
|
|
|
<date>28 February, 2000</date>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<chapter>
|
|
|
|
<heading>NSURLHandle</heading>
|
|
|
|
<class name="NSURLHandle" super="NSObject">
|
|
|
|
<declared>Foundation/NSURLHandle.h</declared>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2000-09-25 04:58:37 +00:00
|
|
|
<p>
|
|
|
|
An NSURLHandle instance is used to manage the resource data
|
|
|
|
corresponding to an NSURL object. A single NSURLHandle can
|
|
|
|
be used to manage multiple NSURL objects as long as those
|
|
|
|
objects all refer to the same resource.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Different NSURLHandle subclasses are used to manage different
|
|
|
|
types of URL (usually based on the scheme of the URL), and you
|
|
|
|
can register new subclasses to extend (or replace) the
|
|
|
|
standard ones.
|
|
|
|
</p>
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="Class" factory="yes">
|
|
|
|
<sel>URLHandleClassForURL:</sel>
|
|
|
|
<arg type="NSURL*">anURL</arg>
|
|
|
|
<desc>
|
2000-09-22 13:45:58 +00:00
|
|
|
Returns the most recently registered NSURLHandle subclass that
|
2000-09-25 06:06:28 +00:00
|
|
|
responds to <ref id="canInitWithURL:">canInitWithURL:</ref>
|
2000-09-25 04:58:37 +00:00
|
|
|
with <code>YES</code>. If there is no such subclass, returns nil.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSURLHandle*" factory="yes">
|
|
|
|
<sel>cachedHandleForURL:</sel>
|
|
|
|
<arg type="NSURL*">anURL</arg>
|
|
|
|
<desc>
|
2000-09-22 13:45:58 +00:00
|
|
|
Returns a previously created object that handles the specified
|
2000-09-25 04:58:37 +00:00
|
|
|
URL (if any exists), otherwise returns nil.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="BOOL" factory="yes" id="canInitWithURL:"
|
|
|
|
override="subclass">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>canInitWithURL:</sel>
|
|
|
|
<arg type="NSURL*">anURL</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Implemented by subclasses to say which URLs they can handle.
|
2000-09-25 04:58:37 +00:00
|
|
|
This method is used to determine which subclasses can be used
|
|
|
|
to handle a particular URL.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void" factory="yes">
|
|
|
|
<sel>registerURLHandleClass:</sel>
|
|
|
|
<arg type="Class">anURLHandleSubclass</arg>
|
|
|
|
<desc>
|
2000-09-22 13:45:58 +00:00
|
|
|
Used to register a subclass as being available to handle URLs.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>addClient:</sel>
|
|
|
|
<arg type="id<NSURLHandleClient>">client</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Adds an object conforming to the
|
|
|
|
<ref id="NSURLHandleClient">NSURLHandleClient protocol</ref>
|
|
|
|
as a client of the URL handle.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSData*">
|
|
|
|
<sel>availableResourceData</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Returns the resource data that is currently available for the
|
|
|
|
handle. This may be a partially loaded resource or may be
|
|
|
|
empty of no data has been loaded yet.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>backgroundLoadDidFailWithReason:</sel>
|
|
|
|
<arg type="NSString*">reason</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
This method should be called when a background load fails.
|
|
|
|
The method passes the failure notification to the clients of
|
|
|
|
the handle - so subclasses should call super's implementation
|
|
|
|
at the end of their implementation of this method.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>beginLoadInBackground</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
This method is called by when a background load begins.
|
|
|
|
Subclasses should call super's implementation at
|
|
|
|
the end of their implementation of this method.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="void" id="cancelLoadInBackground">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>cancelLoadInBackground</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
This method should be called to cancel a load currently in
|
|
|
|
progress. The method calls
|
|
|
|
<ref id="endLoadInBackground">endLoadInBackground</ref>
|
|
|
|
Subclasses should call super's implementation at
|
|
|
|
the end of their implementation of this method.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>didLoadBytes:</sel>
|
|
|
|
<arg type="NSData*">newBytes</arg>
|
|
|
|
<sel>loadComplete:</sel>
|
|
|
|
<arg type="BOOL">yorn</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
This method must be called by subclasses whenever data is
|
|
|
|
loaded.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="void" id="endLoadInBackground">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>endLoadInBackground</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
This method is called to stop any background loading process.
|
|
|
|
<ref id="cancelLoadInBackground">cancelLoadInBackground</ref>
|
|
|
|
uses this method to cancel loading.
|
|
|
|
Subclasses should call super's implementation at
|
|
|
|
the end of their implementation of this method.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSString*">
|
|
|
|
<sel>failureReason</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Returns the failure reason for the last failure to load
|
|
|
|
the resource data.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>flushCachedData</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Flushes any cached resource data.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="init" init="yes" override="subclass">
|
|
|
|
<sel>initWithURL:</sel>
|
|
|
|
<arg type="NSURL*">url</arg>
|
|
|
|
<sel>cached:</sel>
|
|
|
|
<arg type="BOOL">yesno</arg>
|
|
|
|
<desc>
|
|
|
|
Initialises a handle with the specified URL.
|
|
|
|
The flag determines whether the handle will cache resource data
|
|
|
|
and respond to requests from equivalent URLs for the cached data.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="void" override="subclass">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>loadInBackground</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Starts (or queues) loading of the handle's resource data
|
|
|
|
in the background (asynchronously).
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="NSData*" id ="loadInForeground">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>loadInForeground</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Loads the handle's resource data in the foreground (synchronously).
|
|
|
|
This may be implemented by starting a background load and
|
|
|
|
waiting for it to complete.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="id" override="subclass">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>propertyForKey:</sel>
|
|
|
|
<arg type="NSString*">propertyKey</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Returns the property for the specified key, or nil if the
|
|
|
|
key does not exist.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="id" override="subclass">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>propertyForKeyIfAvailable:</sel>
|
|
|
|
<arg type="NSString*">propertyKey</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Returns the property for the specified key, but only if the
|
|
|
|
handle does not need to do any work to retrieve it.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="void">
|
|
|
|
<sel>removeClient:</sel>
|
|
|
|
<arg type="id<NSURLHandleClient>">client</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Removes an object from them list of clients notified of
|
|
|
|
resource loading events by the URL handle.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSData*">
|
|
|
|
<sel>resourceData</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Returns the resource data belonging to the handler.
|
|
|
|
Calls <ref id="loadInForeground">loadInForeground</ref> if
|
|
|
|
necessary.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="NSURLHandleStatus">
|
|
|
|
<sel>status</sel>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Returns the current status of the handle.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="BOOL" override="subclass">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>writeData:</sel>
|
|
|
|
<arg type="NSData*">data</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Writes resource data to the handle. Returns YES on success,
|
|
|
|
NO on failure.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
2000-09-22 13:45:58 +00:00
|
|
|
|
2000-09-25 06:06:28 +00:00
|
|
|
<method type="BOOL" override="subclass">
|
2000-02-29 11:01:41 +00:00
|
|
|
<sel>writeProperty:</sel>
|
|
|
|
<arg type="id">propertyValue</arg>
|
|
|
|
<desc>
|
2000-09-25 06:06:28 +00:00
|
|
|
Attempts to set property for handle.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
2000-02-28 18:30:41 +00:00
|
|
|
</method>
|
2000-09-25 06:06:28 +00:00
|
|
|
|
2000-09-25 04:58:37 +00:00
|
|
|
<standards><MacOS-X/><NotOpenStep/></standards>
|
2000-02-28 16:30:00 +00:00
|
|
|
</class>
|
2000-09-25 04:58:37 +00:00
|
|
|
|
|
|
|
<protocol name="NSURLHandleClient">
|
|
|
|
<declared>Foundation/NSURLHandle.h</declared>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
|
|
|
|
<method type="void">
|
|
|
|
<sel>URLHandleResourceDidBeginLoading:</sel>
|
|
|
|
<arg type="NSURLHandle*">sender</arg>
|
|
|
|
<desc>
|
|
|
|
Sent by the NSURLHandle object when it begins loading
|
|
|
|
resource data.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="void">
|
|
|
|
<sel>URLHandleResourceDidCancelLoading:</sel>
|
|
|
|
<arg type="NSURLHandle*">sender</arg>
|
|
|
|
<desc>
|
|
|
|
Sent by the NSURLHandle object when resource loading is cancelled
|
|
|
|
by programmatic request (rather than by failure).
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="void">
|
|
|
|
<sel>URLHandleResourceDidFinishLoading:</sel>
|
|
|
|
<arg type="NSURLHandle*">sender</arg>
|
|
|
|
<desc>
|
|
|
|
Sent by the NSURLHandle object when it completes loading
|
|
|
|
resource data.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="void">
|
|
|
|
<sel>URLHandle:</sel>
|
|
|
|
<arg type="NSURLHandle*">sender</arg>
|
|
|
|
<sel>resourceDidBecomeAvailable:</sel>
|
|
|
|
<arg type="NSData*">data</arg>
|
|
|
|
<desc>
|
|
|
|
Sent by the NSURLHandle object when some data becomes available
|
|
|
|
from the handle.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<method type="void">
|
|
|
|
<sel>URLHandle:</sel>
|
|
|
|
<arg type="NSURLHandle*">sender</arg>
|
|
|
|
<sel>resourceDidFailLoadingWithReason:</sel>
|
|
|
|
<arg type="NSString*">reason</arg>
|
|
|
|
<desc>
|
|
|
|
Sent by the NSURLHandle object on resource load failure.
|
|
|
|
Supplies a human readable failure reason.
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
|
|
|
|
<standards><MacOS-X/><NotOpenStep/></standards>
|
|
|
|
</protocol>
|
|
|
|
|
|
|
|
<type name="NSURLHandleStatus">
|
|
|
|
<typespec>int</typespec>
|
|
|
|
<declared>Foundation/NSURLHandle.h</declared>
|
|
|
|
<desc>
|
|
|
|
An NSURLHandleStatus is used to report the current state of an
|
|
|
|
NSURLHandle object, it can take the following values -
|
|
|
|
<list>
|
|
|
|
<item>NSURLHandleNotLoaded</item>
|
|
|
|
<item>NSURLHandleLoadSucceeded</item>
|
|
|
|
<item>NSURLHandleLoadInProgress</item>
|
|
|
|
<item>NSURLHandleLoadFailed</item>
|
|
|
|
</list>
|
|
|
|
</desc>
|
|
|
|
<standards><MacOS-X/><NotOpenStep/></standards>
|
|
|
|
</type>
|
2000-02-28 16:30:00 +00:00
|
|
|
</chapter>
|
|
|
|
</body>
|
|
|
|
</gsdoc>
|