Atk.StreamableContent

g Atk.StreamableContent Atk.StreamableContent GObject.GInterface GObject.GInterface GObject.GInterface->Atk.StreamableContent

Implementations:

None

Methods

get_mime_type (i)

get_n_mime_types ()

get_stream (mime_type)

get_uri (mime_type)

Virtual Methods

do_get_mime_type (i)

do_get_n_mime_types ()

do_get_stream (mime_type)

do_get_uri (mime_type)

Properties

None

Signals

None

Fields

None

Class Details

class Atk.StreamableContent
Bases:

GObject.GInterface

Structure:

Atk.StreamableContentIface

The ATK interface which provides access to streamable content.

An interface whereby an object allows its backing content to be streamed to clients. Typical implementors would be images or icons, HTML content, or multimedia display/rendering widgets.

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.

The Atk.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 Atk.StreamableContent interface can help address performance issues. Unlike most ATK 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.

get_mime_type(i)[source]
Parameters:

i (int) – a int representing the position of the mime type starting from 0

Returns:

a str representing the specified mime type; the caller should not free the character string.

Return type:

str

Gets the character string of the specified mime type. The first mime type is at position 0, the second at position 1, and so on.

get_n_mime_types()[source]
Returns:

a int which is the number of mime types supported by the object.

Return type:

int

Gets the number of mime types supported by this object.

get_stream(mime_type)[source]
Parameters:

mime_type (str) – a str representing the mime type

Returns:

A GLib.IOChannel which contains the content in the specified mime type.

Return type:

GLib.IOChannel

Gets the content in the specified mime type.

get_uri(mime_type)[source]
Parameters:

mime_type (str) – a str representing the mime type, or None to request a URI for the default mime type.

Returns:

Returns a string representing a URI, or None if no corresponding URI can be constructed.

Return type:

str or None

Get a string representing a URI in IETF standard format (see http://www.ietf.org/rfc/rfc2396.txt) from which the object’s content may be streamed in the specified mime-type, if one is available. If mime_type is None, the URI for the default (and possibly only) mime-type is returned.

Note that it is possible for get_uri to return None but for get_stream to work nonetheless, since not all GIOChannels connect to URIs.

New in version 1.12.

do_get_mime_type(i) virtual
Parameters:

i (int) – a int representing the position of the mime type starting from 0

Returns:

a str representing the specified mime type; the caller should not free the character string.

Return type:

str

Gets the character string of the specified mime type. The first mime type is at position 0, the second at position 1, and so on.

do_get_n_mime_types() virtual
Returns:

a int which is the number of mime types supported by the object.

Return type:

int

Gets the number of mime types supported by this object.

do_get_stream(mime_type) virtual
Parameters:

mime_type (str) – a str representing the mime type

Returns:

A GLib.IOChannel which contains the content in the specified mime type.

Return type:

GLib.IOChannel

Gets the content in the specified mime type.

do_get_uri(mime_type) virtual
Parameters:

mime_type (str) – a str representing the mime type, or None to request a URI for the default mime type.

Returns:

Returns a string representing a URI, or None if no corresponding URI can be constructed.

Return type:

str or None

Get a string representing a URI in IETF standard format (see http://www.ietf.org/rfc/rfc2396.txt) from which the object’s content may be streamed in the specified mime-type, if one is available. If mime_type is None, the URI for the default (and possibly only) mime-type is returned.

Note that it is possible for get_uri to return None but for get_stream to work nonetheless, since not all GIOChannels connect to URIs.

New in version 1.12.