1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
/*
* AT-SPI - Assistive Technology Service Provider Interface
* (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
*
* Copyright 2001 Sun Microsystems, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <Bonobo_Storage.idl>
module Accessibility {
typedef sequence<string> StringSeq;
/**
* An interface by which the requested data from a StreamableContent object
* may be read by the client.
* @note this interface supercedes the use of BonoboStream by previous
* versions of StreamableContent.
*
* @since AT-SPI 1.7.0
*/
interface ContentStream : Bonobo::Unknown {
typedef sequence<octet> iobuf;
/**
* Indicates that a transmission error has occurred while
* reading or seeking the stream or data source.
*/
exception IOError {
string reason;
};
/**
* Indicates that the requested operation is not supported by the stream instance.
*/
exception NotSupported {
string reason;
};
/**
* The operation is supported, but the current requestor does not have
* permission to t the request, for instance does not have permission to read
* the stream.
*/
exception NoPermission {
string reason;
};
/**
* Specifies the meaning of a seek 'offset'. Not all SeekTypes are
* supported by all StreamableContent data sources, for instance
* some streams may not support seeking from the beginning or other
* types of 'backwards' seeks.
*/
enum SeekType {
SEEK_SET, /**< Seek from the start of the stream or data source.*/
SEEK_CURRENT, /**< Seek relative to the current position. */
SEEK_END /**< Seek from the end of the file, stream, or data source. */
};
/**
* Seek to a specified position in the Stream.
* @param offset an offset specifying the requested position in the stream,
* relative to the SeekType specified in \c whence.
* @param whence a SeekType specifying the reference point from which the
* seek offset is calculated. Some forms of seek are not supported by certain
* implementations of Stream, in which case a NotSupported exception will be raised.
* @returns the actual resulting offset, if no exception was raised.
**/
long seek (in long offset, in SeekType whence)
raises (NoPermission, IOError, NotSupported);
/**
* Request/read a specified amount of data from a Stream.
* @returns the number of bytes actually read into the client buffer.
**/
long read (in long count, out iobuf buffer)
raises (NoPermission, IOError);
/**
* close the stream and release associated resources.
* A client should not perform further operations on a
* StreamableContent::Stream object after closing it.
**/
void close ();
/** /cond */
void unimplemented ();
void unimplemented2 ();
/** /endcond */
};
/**
* 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.
*/
interface StreamableContent : Bonobo::Unknown {
/**
* getContentTypes:
* @returns the list of available mimetypes for this object's content.
*/
StringSeq getContentTypes ();
/**
* \n 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 \c seek and \c read.
* \c seek may not be supported for all mimetypes or
* all implementors.
*
\verbatim
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)
\endverbatim
*
* @see ::Bonobo::Stream
*
* @returns a ::Bonobo::Stream whose mimetype matches \a contentType,
* if available, or \c NIL.
*/
Bonobo::Stream getContent (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.
* \c seek may not be supported for all mimetypes or
* all implementors.
*
* @param contentType a string specifying the desired mimetype for the content stream.
* @returns a Stream whose mimetype matches \a contentType,
* if available, or \c NIL.
* @since AT-SPI 1.8.0
*/
ContentStream getStream (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.
*
* @param 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.
*/
string getURI (in string contentType);
/**
* \cond
* unImplemented:
*
* placeholders for future expansion.
*/
void unImplemented ();
void unImplemented2 ();
/** \endcond */
};
};
|