2008-12-04 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / xml / org.freedesktop.atspi.StreamableContent.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <node xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" name="/node">
3 <interface name="org.freedesktop.atspi.ContentStream">
4   <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
5     <p>An interface by which the requested data from a StreamableContent object
6             may be read by the client.</p>
7   </tp:docstring>
8 </interface>
9 <tp:enum name="SeekType" type="u">
10   <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
11     <p>Specifies the meaning of a seek 'offset'.  Not all SeekTypes are 
12       supported by all StreamableContent data sources, for instance 
13       some streams may not support seeking from the beginning or other
14       types of 'backwards' seeks.</p>
15   </tp:docstring>
16   <tp:enumvalue suffix="SEEK_SET">
17   <tp:docstring>
18     Seek from the start of the stream or data source.
19   </tp:docstring>
20   </tp:enumvalue>
21   <tp:enumvalue suffix="SEEK_CURRENT" value="1">
22   <tp:docstring>
23     Seek relative to the current position. 
24   </tp:docstring>
25   </tp:enumvalue>
26   <tp:enumvalue suffix="SEEK_END" value="2">
27   <tp:docstring>
28     Seek from the end of the file, stream, or data source. 
29   </tp:docstring>
30   </tp:enumvalue>
31 </tp:enum>
32 <tp:errors xmlns="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" namespace="org.freedesktop.atspi.error">
33   <tp:error name="IOError">
34   <tp:docstring>
35     Indicates that a transmission error has occurred while reading or seeking the stream or data source. 
36   </tp:docstring>
37   </tp:error>
38   <tp:error name="NotSupported">
39   <tp:docstring>
40     Indicates that the requested operation is not supported by the stream instance.
41   </tp:docstring>
42   </tp:error>
43   <tp:error name="NoPermission">
44   <tp:docstring>
45     The operation is supported, but the current requestor does not havepermission to t the request, for instance does not have permission to read the stream.
46   </tp:docstring>
47   </tp:error>
48 </tp:errors>
49 <method name="seek">
50   <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
51           <p>Seek to a specified position in the Stream.</p>
52   </tp:docstring>
53   <arg direction="in" name="offset" type="i">
54           <tp:docstring>
55       An offset specifying the requested position in the stream,
56       relative to the SeekType specified in <code>whence.</code>
57           </tp:docstring>
58   </arg>
59   <arg direction="in" name="whence" type="u" tp:type="SeekType">
60           <tp:docstring>
61       A SeekType specifying the reference point from which the 
62       seek offset is calculated.  Some forms of seek are not supported by certain
63       implementations of Stream, in which case a NotSupported exception will be raised.
64           </tp:docstring>
65   </arg>
66   <arg direction="out" type="i">
67   <tp:docstring>
68     The actual resulting offset, if no exception was raised.
69   </tp:docstring>
70   </arg>
71   <tp:possible-errors>
72     <tp:error name="org.freedesktop.atspi.error.(NoPermission"/>
73     <tp:error name="org.freedesktop.atspi.error.IOError"/>
74     <tp:error name="org.freedesktop.atspi.error.NotSupported"/>
75   </tp:possible-errors>
76 </method>
77 <method name="read">
78   <tp:docstring>
79     Request/read a specified amount of data from a Stream.
80   </tp:docstring>
81   <arg direction="in" name="count" type="i"/>
82   <arg direction="out" name="buffer" type="ay" tp:type="iobuf"/>
83   <arg direction="out" type="i">
84   <tp:docstring>
85     The number of bytes actually read into the client buffer.
86   </tp:docstring>
87   </arg>
88   <tp:possible-errors>
89     <tp:error name="org.freedesktop.atspi.error.(NoPermission"/>
90     <tp:error name="org.freedesktop.atspi.error.IOError"/>
91   </tp:possible-errors>
92 </method>
93 <method name="close">
94   <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
95     <p>close the stream and release associated resources.  
96       A client should not perform further operations on a 
97       StreamableContent.Stream object after closing it.</p>
98   </tp:docstring>
99 </method>
100 <interface name="org.freedesktop.atspi.StreamableContent">
101   <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
102     <p>An interface whereby an object allows its backing content
103       to be streamed to clients.  Negotiation of content type
104       is allowed.  Clients may examine the backing data and
105       transform, convert, or parse the content in order to
106       present it in an alternate form to end-users.  </p>
107
108     <p>The StreamableContent interface is particularly useful for saving, 
109       printing, or post-processing entire documents, or for persisting 
110       alternate views of a document.
111       If document content itself is being serialized, stored, or converted,
112       then use of the StreamableContent interface can help address performance
113       issues. Unlike most AT-SPI/Accessibility interfaces, this interface
114       is not strongly tied to the current user-agent view of the
115       a particular document, but may in some cases give access to the 
116       underlying model data.</p>
117   </tp:docstring>
118   <method name="getContentTypes">
119     <arg direction="out" type="as" tp:type="StringSeq">
120     <tp:docstring>
121       The list of available mimetypes for this object's content.
122     </tp:docstring>
123     </arg>
124   </method>
125   <method name="getContent">
126     <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
127       <p>DEPRECATED, use getStream instead.
128         getContent:
129         Retrieve this object's content, in a format appropriate to a
130         requested mimetype.    </p>
131     </tp:docstring>
132     <arg direction="in" name="contentType" type="s">
133     </arg>
134   </method>
135   <method name="getStream">
136     <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
137       <p>Retrieve this object's content, in a format appropriate to a
138         requested mimetype, as a ::ContentStream instance.    </p>
139
140     </tp:docstring>
141     <arg direction="in" name="contentType" type="s">
142             <tp:docstring>
143       <p>A string specifying the desired mimetype for the content stream.</p>
144             </tp:docstring>
145     </arg>
146     <arg direction="out" type="FIXME" tp:type="ContentStream">
147     <tp:docstring>
148       A Stream whose mimetype matches contentType,if available, or NIL.
149     </tp:docstring>
150     </arg>
151   </method>
152   <method name="getURI">
153     <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
154       <p>Get a URI pointing to the content of the specified type, if such a URI
155         can be obtained.  Not all streamable content providers have URI representations.    </p>
156     </tp:docstring>
157     <arg direction="in" name="contentType" type="s">
158             <tp:docstring>
159       <p>A string specifying the desired mimetype for the content stream.
160         If NULL, then a URI for the default content type will be returned, if available.    </p>
161             </tp:docstring>
162     </arg>
163     <arg direction="out" type="s">
164     <tp:docstring>
165       A string which constitutes a URI for a stream of the specifiedcontent type, or NULL if no such URI can be obtained.
166     </tp:docstring>
167     </arg>
168   </method>
169 </interface>
170 </node>