Carbon


Data Transfer Event Mask Constants

Header: URLAccess.h

Represent a mask that identifies the data transfer events occurring during a data transfer operation that your application wants notification of.

enum {
    kURLInitiatedEventMask = 1,
    kURLResourceFoundEventMask = 8,
    kURLDownloadingMask = 16,
    kURLUploadingMask = 512,
    kURLAbortInitiatedMask = 128,
    kURLCompletedEventMask = 256,
    kURLErrorOccurredEventMask = 64,
    kURLDataAvailableEventMask = 1048576,
    kURLTransactionCompleteEventMask = 32,
    kURLSystemEventMask = 268435456,
    kURLPercentEventMask = 536870912,
    kURLPeriodicEventMask = 1073741824,
    kURLPropertyChangedEventMask = -2147483648,
    kURLAllBufferEventsMask = 1048608,
    kURLAllNonBufferEventsMask = -536869935,
    kURLAllEventsMask = -1
};

Constant descriptions

kURLInitiatedEventMask

If the bit specified by this mask is set, your notification callback function will be notified when the function URLOpen has been called but the location specified by the URL reference has not yet been accessed.

kURLResourceFoundEventMask

If the bit specified by this mask is set, your notification callback function will be notified when the location specified by a URL reference has been accessed and is valid.

kURLDownloadingMask

If the bit specified by this mask is set, your notification callback function will be notified when a download operation is in progress.

kURLUploadingMask

If the bit specified by this mask is set, your notification callback function will be notified when an upload operation is in progress.

kURLAbortInitiatedMask

If the bit specified by this mask is set, your notification callback function will be notified when a download or upload operation has been aborted. When your application calls the function URLAbort, the URL Access Manager changes the state returned by the function URLGetCurrentState to kURLAbortingState and passes the constant kURLAbortInitiatedEvent to your notification callback function. When data transfer is terminated, the URL Access Manager changes the state returned by URLGetCurrentState to kURLCompletedState and passes the constant kURLCompletedEvent in the event parameter of your notification callback function.

kURLCompletedEventMask

If the bit specified by this mask is set, your notification callback function will be notified when all operations associated with a call to the function URLOpen have been completed. This indicates either the successful completion of an operation or the completion of cleanup work after aborting the operation. For example, when a data transfer operation is aborted, the URL Access Manager changes the state returned by the function URLGetCurrentState to kURLCompletedState and passes the constant kURLCompletedEvent in the event parameter of your notification callback function.

kURLErrorOccurredEventMask

If the bit specified by this mask is set, your notification callback function will be notified when an error has occurred. If you receive this event, you may wish to call the function URLGetError to determine the nature of the error.

kURLDataAvailableEventMask

If the bit specified by this mask is set, your notification callback function will be notified when data is available in buffers. If you receive this event, you may wish to call the function URLGetDataAvailable to determine the amount of data available for retrieval in a download operation. Note that if you pass a valid file specification in the fileSpec parameter of the function URLOpen, your notification callback function will not be called for data available events.

kURLTransactionCompleteEventMask

If the bit specified by this mask is set, your notification callback function will be notified when the operation is complete because there is no more data to retrieve from buffers. Note that if you pass a valid file specification in the fileSpec parameter of the function URLOpen, your notification callback function will not be called for transaction completed events.

kURLSystemEventMask
kURLPercentEventMask

If the bit specified by this mask is set, your notification callback function will be notified when an increment of one percent of the data has been transferred into buffers. This occurs only when the size of the data being transferred is known. This information is useful if you want the URL Access Manager to display a progress indicator.

kURLPeriodicEventMask

If the bit specified by this mask is set, your notification callback function will be notified when a time interval of approximately one quarter of a second has passed. You can use this event to report the progress of the download operation when the size of the data is unknown or for other processing that you wish to perform at regular intervals.

kURLPropertyChangedEventMask

If the bit specified by this mask is set, your notification callback function will be notified when the value of a URL property, such as a filename or user name, has become known or changes.

kURLAllBufferEventsMask

If the bit specified by this mask is set, your notification callback function will be notified when a buffer-related event indicated by the event constants kURLDataAvailableEvent or kURLTransactionCompleteEvent occurred. If you pass a file specification in the fileSpec parameter of the function URLOpen, your notification callback function will not be called for buffer-related events.

kURLAllNonBufferEventsMask

If the bit specified by this mask is set, your notification callback function will be notified when an event unrelated to a buffer occurred. This includes all events except those represented by the constants kURLDataAvailableEvent and kURLTransactionCompleteEvent.

kURLAllEventsMask

If the bit specified by this mask is set, your notification callback function will be notified when any of the above data transfer events occur. If you pass a file specification in the fileSpec parameter of the function URLOpen, your notification callback function will not be called for buffer-related events.

The URLEventMask enumeration defines masks that identify the data transfer events occurring during a call to the function URLOpen that your application wants notification of. For a description of data transfer events, see “Data Transfer Event Constants”. You can define an event notification function and the events for which you want to receive notification only if you do not specify a file in which to store the data for downloads. You can indicate which events you want to receive notification of via a bitmask in the eventRegister parameter of URLOpen.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)