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 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GDataDownloadStream</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GData Reference Manual">
<link rel="up" href="ch02.html" title="Core API">
<link rel="prev" href="GDataParsable.html" title="GDataParsable">
<link rel="next" href="GDataUploadStream.html" title="GDataUploadStream">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GDataParsable.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GData Reference Manual</th>
<td><a accesskey="n" href="GDataUploadStream.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GDataDownloadStream.synopsis" class="shortcut">Top</a>
|
<a href="#GDataDownloadStream.description" class="shortcut">Description</a>
|
<a href="#GDataDownloadStream.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GDataDownloadStream.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
|
<a href="#GDataDownloadStream.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="GDataDownloadStream">
<a name="GDataDownloadStream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GDataDownloadStream.top_of_page"></a>GDataDownloadStream</span></h2>
<p>GDataDownloadStream — GData download stream object</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="GDataDownloadStream.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="GDataDownloadStream.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gdata/gdata-download-stream.h>
<a class="link" href="GDataDownloadStream.html#GDataDownloadStream-struct" title="GDataDownloadStream">GDataDownloadStream</a>;
<a class="link" href="GDataDownloadStream.html#GDataDownloadStreamClass" title="GDataDownloadStreamClass">GDataDownloadStreamClass</a>;
<a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="returnvalue">GInputStream</span></a> * <a class="link" href="GDataDownloadStream.html#gdata-download-stream-new" title="gdata_download_stream_new ()">gdata_download_stream_new</a> (<em class="parameter"><code><a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *service</code></em>,
<em class="parameter"><code>const <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *download_uri</code></em>);
<a class="link" href="GDataService.html" title="GDataService"><span class="returnvalue">GDataService</span></a> * <a class="link" href="GDataDownloadStream.html#gdata-download-stream-get-service" title="gdata_download_stream_get_service ()">gdata_download_stream_get_service</a> (<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);
const <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataDownloadStream.html#gdata-download-stream-get-download-uri" title="gdata_download_stream_get_download_uri ()">gdata_download_stream_get_download_uri</a>
(<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);
const <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="GDataDownloadStream.html#gdata-download-stream-get-content-type" title="gdata_download_stream_get_content_type ()">gdata_download_stream_get_content_type</a>
(<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);
<a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a> <a class="link" href="GDataDownloadStream.html#gdata-download-stream-get-content-length" title="gdata_download_stream_get_content_length ()">gdata_download_stream_get_content_length</a>
(<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="GDataDownloadStream.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="/opt/gnome2/build/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html">GInputStream</a>
+----GDataDownloadStream
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="GDataDownloadStream.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GDataDownloadStream implements
<a href="/opt/gnome2/build/share/gtk-doc/html/gio/GSeekable.html">GSeekable</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="GDataDownloadStream.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GDataDownloadStream.html#GDataDownloadStream--content-length" title='The "content-length" property'>content-length</a>" <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#glong"><span class="type">glong</span></a> : Read
"<a class="link" href="GDataDownloadStream.html#GDataDownloadStream--content-type" title='The "content-type" property'>content-type</a>" <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read
"<a class="link" href="GDataDownloadStream.html#GDataDownloadStream--download-uri" title='The "download-uri" property'>download-uri</a>" <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
"<a class="link" href="GDataDownloadStream.html#GDataDownloadStream--service" title='The "service" property'>service</a>" <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>* : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" title="Description">
<a name="GDataDownloadStream.description"></a><h2>Description</h2>
<p>
<a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> is a <a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="type">GInputStream</span></a> subclass to allow downloading of files from GData services with authentication from a <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>.
</p>
<p>
Once a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> is instantiated with <a class="link" href="GDataDownloadStream.html#gdata-download-stream-new" title="gdata_download_stream_new ()"><code class="function">gdata_download_stream_new()</code></a>, the standard <a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="type">GInputStream</span></a> API can be used on the stream to download
the file. Network communication may not actually begin until the first call to <a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html#g-input-stream-read"><code class="function">g_input_stream_read()</code></a>, so having a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> around is no
guarantee that the file is being downloaded.
</p>
<p>
The content type and length of the file being downloaded are made available through <a class="link" href="GDataDownloadStream.html#GDataDownloadStream--content-type" title='The "content-type" property'><span class="type">"content-type"</span></a> and
<a class="link" href="GDataDownloadStream.html#GDataDownloadStream--content-length" title='The "content-length" property'><span class="type">"content-length"</span></a> as soon as the appropriate data is received from the server. Connect to the
<a href="/opt/gnome2/build/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-notify"><span class="type">"notify"</span></a> <code class="code">content-type</code> and <code class="code">content-length</code> details to be notified as
soon as the data is available.
</p>
</div>
<div class="refsect1" title="Details">
<a name="GDataDownloadStream.details"></a><h2>Details</h2>
<div class="refsect2" title="GDataDownloadStream">
<a name="GDataDownloadStream-struct"></a><h3>GDataDownloadStream</h3>
<pre class="programlisting">typedef struct _GDataDownloadStream GDataDownloadStream;</pre>
<p>
All the fields in the <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> structure are private and should never be accessed directly.
</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title="GDataDownloadStreamClass">
<a name="GDataDownloadStreamClass"></a><h3>GDataDownloadStreamClass</h3>
<pre class="programlisting">typedef struct {
} GDataDownloadStreamClass;
</pre>
<p>
All the fields in the <a class="link" href="GDataDownloadStream.html#GDataDownloadStreamClass" title="GDataDownloadStreamClass"><span class="type">GDataDownloadStreamClass</span></a> structure are private and should never be accessed directly.
</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title="gdata_download_stream_new ()">
<a name="gdata-download-stream-new"></a><h3>gdata_download_stream_new ()</h3>
<pre class="programlisting"><a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="returnvalue">GInputStream</span></a> * gdata_download_stream_new (<em class="parameter"><code><a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *service</code></em>,
<em class="parameter"><code>const <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *download_uri</code></em>);</pre>
<p>
Creates a new <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a>, allowing a file to be downloaded from a GData service using standard <a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="type">GInputStream</span></a> API.
</p>
<p>
As well as the standard GIO errors, calls to the <a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="type">GInputStream</span></a> API on a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> can also return any relevant specific error from
<a class="link" href="GDataService.html#GDataServiceError" title="enum GDataServiceError"><span class="type">GDataServiceError</span></a>, or <a class="link" href="GDataService.html#GDATA-SERVICE-ERROR-PROTOCOL-ERROR:CAPS"><code class="literal">GDATA_SERVICE_ERROR_PROTOCOL_ERROR</code></a> in the general case.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td>a <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>download_uri</code></em> :</span></p></td>
<td>the URI to download
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a href="/opt/gnome2/build/share/gtk-doc/html/gio/GInputStream.html"><span class="type">GInputStream</span></a>, or <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; unref with <a href="/opt/gnome2/build/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title="gdata_download_stream_get_service ()">
<a name="gdata-download-stream-get-service"></a><h3>gdata_download_stream_get_service ()</h3>
<pre class="programlisting"><a class="link" href="GDataService.html" title="GDataService"><span class="returnvalue">GDataService</span></a> * gdata_download_stream_get_service (<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);</pre>
<p>
Gets the service used to authenticate the download, as passed to <a class="link" href="GDataDownloadStream.html#gdata-download-stream-new" title="gdata_download_stream_new ()"><code class="function">gdata_download_stream_new()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> used to authenticate the download
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title="gdata_download_stream_get_download_uri ()">
<a name="gdata-download-stream-get-download-uri"></a><h3>gdata_download_stream_get_download_uri ()</h3>
<pre class="programlisting">const <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_download_stream_get_download_uri
(<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);</pre>
<p>
Gets the URI of the file being downloaded, as passed to <a class="link" href="GDataDownloadStream.html#gdata-download-stream-new" title="gdata_download_stream_new ()"><code class="function">gdata_download_stream_new()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the URI of the file being downloaded
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title="gdata_download_stream_get_content_type ()">
<a name="gdata-download-stream-get-content-type"></a><h3>gdata_download_stream_get_content_type ()</h3>
<pre class="programlisting">const <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gdata_download_stream_get_content_type
(<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);</pre>
<p>
Gets the content type of the file being downloaded. If the <code class="literal">Content-Type</code> header has not yet
been received, <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> will be returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the content type of the file being downloaded, or <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title="gdata_download_stream_get_content_length ()">
<a name="gdata-download-stream-get-content-length"></a><h3>gdata_download_stream_get_content_length ()</h3>
<pre class="programlisting"><a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a> gdata_download_stream_get_content_length
(<em class="parameter"><code><a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a> *self</code></em>);</pre>
<p>
Gets the length (in bytes) of the file being downloaded. If the <code class="literal">Content-Length</code> header has not yet
been received from the server, <code class="code">-1</code> will be returned.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
<td>a <a class="link" href="GDataDownloadStream.html" title="GDataDownloadStream"><span class="type">GDataDownloadStream</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the content length of the file being downloaded, or <code class="code">-1</code>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 0.5.0</p>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="GDataDownloadStream.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "content-length" property'>
<a name="GDataDownloadStream--content-length"></a><h3>The <code class="literal">"content-length"</code> property</h3>
<pre class="programlisting"> "content-length" <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#glong"><span class="type">glong</span></a> : Read</pre>
<p>
The length (in bytes) of the file being downloaded.
</p>
<p>Allowed values: >= -1</p>
<p>Default value: -1</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title='The "content-type" property'>
<a name="GDataDownloadStream--content-type"></a><h3>The <code class="literal">"content-type"</code> property</h3>
<pre class="programlisting"> "content-type" <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read</pre>
<p>
The content type of the file being downloaded.
</p>
<p>Default value: NULL</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title='The "download-uri" property'>
<a name="GDataDownloadStream--download-uri"></a><h3>The <code class="literal">"download-uri"</code> property</h3>
<pre class="programlisting"> "download-uri" <a href="/opt/gnome2/build/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>
The URI of the file to download.
</p>
<p>Default value: NULL</p>
<p class="since">Since 0.5.0</p>
</div>
<hr>
<div class="refsect2" title='The "service" property'>
<a name="GDataDownloadStream--service"></a><h3>The <code class="literal">"service"</code> property</h3>
<pre class="programlisting"> "service" <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a>* : Read / Write / Construct Only</pre>
<p>
The service which is used to authenticate the download, and to which the download relates.
</p>
<p class="since">Since 0.5.0</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.14</div>
</body>
</html>
|