# Accessibility::StreamableContent Interface Reference

`import "Accessibility_StreamableContent.idl";`

## Public Member Functions

StringSeq | getContentTypes ()
Bonobo::Stream | getContent (in string contentType)
ContentStream | getStream (in string contentType)
string | getURI (in string contentType)

## Detailed Description

An interface whereby an object allows its backing content to be streamed to clients. Negotiation of content type is allowed. Clients may examine the backing data and transform, convert, or parse the content in order to present it in an alternate form to end-users.

Note:
  The StreamableContent interface is particularly useful for saving, printing, or post-processing entire documents, or for persisting alternate views of a document. If document content itself is being serialized, stored, or converted, then use of the StreamableContent interface can help address performance issues. Unlike most AT-SPI/Accessibility interfaces, this interface is not strongly tied to the current user-agent view of the a particular document, but may in some cases give access to the underlying model data.

## Member Function Documentation

Bonobo::Stream Accessibility::StreamableContent::getContent | ( | in string | contentType | ) |

DEPRECATED, use getStream instead. getContent: Retrieve this object's content, in a format appropriate to a requested mimetype.

Note:
  the data is returned as an object of type Bonobo::Stream. The primary methods which are supported on Bonobo::Streams for the purposes of the StreamableContent API are `seek` and `read`. `seek` may not be supported for all mimetypes or all implementors.

            long Bonobo::Stream:seek (in long offset, in SeekType whence)
                    raises (NoPermission, IOError)
            void Bonobo::Stream:read (in long count, out iobuf buffer)
                    raises (NoPermission, IOError)

See also:
  Bonobo::Stream

Returns:
  a Bonobo::Stream whose mimetype matches contentType, if available, or `NIL`.

StringSeq Accessibility::StreamableContent::getContentTypes | ( |  | ) |

getContentTypes:

Returns:
  the list of available mimetypes for this object's content.

ContentStream Accessibility::StreamableContent::getStream | ( | in string | contentType | ) |

Retrieve this object's content, in a format appropriate to a requested mimetype, as a ContentStream instance.

Note:
  This method supercedes the older getContent method, which relied on the Bonobo::Stream API. `seek` may not be supported for all mimetypes or all implementors.

Parameters:

  | contentType | a string specifying the desired mimetype for the content stream.

Returns:
  a Stream whose mimetype matches contentType, if available, or `NIL`.

Since:
  AT-SPI 1.8.0

string Accessibility::StreamableContent::getURI | ( | in string | contentType | ) |

Get a URI pointing to the content of the specified type, if such a URI can be obtained. Not all streamable content providers have URI representations.

Parameters:

  | contentType | a string specifying the desired mimetype for the content stream. If NULL, then a URI for the default content type will be returned, if available.

Returns:
  a string which constitutes a URI for a stream of the specified content type, or NULL if no such URI can be obtained.

The documentation for this interface was generated from the following file:

- /home/liyuan/src/at-spi/idl/Accessibility_StreamableContent.idl