2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
5 * Copyright 2001 Sun Microsystems, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #include <Bonobo_Storage.idl>
25 module Accessibility {
27 typedef sequence<string> StringSeq;
30 * An interface by which the requested data from a StreamableContent object
31 * may be read by the client.
32 * @note this interface supercedes the use of BonoboStream by previous
33 * versions of StreamableContent.
37 interface ContentStream {
39 typedef sequence<octet> iobuf;
42 * Indicates that a transmission error has occurred while
43 * reading or seeking the stream or data source.
49 * Indicates that the requested operation is not supported by the stream instance.
51 exception NotSupported {
56 * The operation is supported, but the current requestor does not have
57 * permission to t the request, for instance does not have permission to read
60 exception NoPermission {
65 * Specifies the meaning of a seek 'offset'. Not all SeekTypes are
66 * supported by all StreamableContent data sources, for instance
67 * some streams may not support seeking from the beginning or other
68 * types of 'backwards' seeks.
71 SEEK_SET, /**< Seek from the start of the stream or data source.*/
72 SEEK_CURRENT, /**< Seek relative to the current position. */
73 SEEK_END /**< Seek from the end of the file, stream, or data source. */
77 * Seek to a specified position in the Stream.
78 * @param offset an offset specifying the requested position in the stream,
79 * relative to the SeekType specified in \c whence.
80 * @param whence a SeekType specifying the reference point from which the
81 * seek offset is calculated. Some forms of seek are not supported by certain
82 * implementations of Stream, in which case a NotSupported exception will be raised.
83 * @returns the actual resulting offset, if no exception was raised.
85 long seek (in long offset, in SeekType whence)
86 raises (NoPermission, IOError, NotSupported);
88 * Request/read a specified amount of data from a Stream.
89 * @returns the number of bytes actually read into the client buffer.
91 long read (in long count, out iobuf buffer)
92 raises (NoPermission, IOError);
94 * close the stream and release associated resources.
95 * A client should not perform further operations on a
96 * StreamableContent::Stream object after closing it.
101 void unimplemented ();
102 void unimplemented2 ();
108 * An interface whereby an object allows its backing content
109 * to be streamed to clients. Negotiation of content type
110 * is allowed. Clients may examine the backing data and
111 * transform, convert, or parse the content in order to
112 * present it in an alternate form to end-users.
114 * @note The StreamableContent interface is particularly useful for saving,
115 * printing, or post-processing entire documents, or for persisting
116 * alternate views of a document.
117 * If document content itself is being serialized, stored, or converted,
118 * then use of the StreamableContent interface can help address performance
119 * issues. Unlike most AT-SPI/Accessibility interfaces, this interface
120 * is not strongly tied to the current user-agent view of the
121 * a particular document, but may in some cases give access to the
122 * underlying model data.
124 interface StreamableContent {
128 * @returns the list of available mimetypes for this object's content.
130 StringSeq getContentTypes ();
132 * \n DEPRECATED, use getStream instead.
134 * Retrieve this object's content, in a format appropriate to a
135 * requested mimetype.
137 * @note the data is returned as an object of type ::Bonobo::Stream.
138 * The primary methods which are supported on Bonobo::Streams for the
139 * purposes of the ::StreamableContent API are \c seek and \c read.
140 * \c seek may not be supported for all mimetypes or
144 long Bonobo::Stream:seek (in long offset, in SeekType whence)
145 raises (NoPermission, IOError)
146 void Bonobo::Stream:read (in long count, out iobuf buffer)
147 raises (NoPermission, IOError)
150 * @see ::Bonobo::Stream
152 * @returns a ::Bonobo::Stream whose mimetype matches \a contentType,
153 * if available, or \c NIL.
155 Bonobo::Stream getContent (in string contentType);
158 * Retrieve this object's content, in a format appropriate to a
159 * requested mimetype, as a ::ContentStream instance.
161 * @note This method supercedes the older getContent method, which
162 * relied on the Bonobo::Stream API.
163 * \c seek may not be supported for all mimetypes or
166 * @param contentType a string specifying the desired mimetype for the content stream.
167 * @returns a Stream whose mimetype matches \a contentType,
168 * if available, or \c NIL.
169 * @since AT-SPI 1.8.0
171 ContentStream getStream (in string contentType);
174 * Get a URI pointing to the content of the specified type, if such a URI
175 * can be obtained. Not all streamable content providers have URI representations.
177 * @param contentType a string specifying the desired mimetype for the content stream.
178 * If NULL, then a URI for the default content type will be returned, if available.
180 * @returns a string which constitutes a URI for a stream of the specified
181 * content type, or NULL if no such URI can be obtained.
183 string getURI (in string contentType);
188 * placeholders for future expansion.
190 void unImplemented ();
191 void unImplemented2 ();