matrix-glib-sdk/Matrix-0.0-MatrixClient.html

665 lines
34 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Matrix-0.0 Reference Manual: MatrixClient</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Matrix-0.0 Reference Manual">
<link rel="up" href="ch01.html" title="Matrix-0.0 API Reference">
<link rel="prev" href="Matrix-0.0-MatrixRoomMemberEvent.html" title="MatrixRoomMemberEvent">
<link rel="next" href="Matrix-0.0-MatrixJsonCompact.html" title="MatrixJsonCompact">
<meta name="generator" content="GTK-Doc V1.20 (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="10"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 
<a href="#Matrix-0.0-MatrixClient.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 
<a href="#Matrix-0.0-MatrixClient.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="Matrix-0.0-MatrixRoomMemberEvent.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="Matrix-0.0-MatrixJsonCompact.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="Matrix-0.0-MatrixClient"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="Matrix-0.0-MatrixClient.top_of_page"></a>MatrixClient</span></h2>
<p>MatrixClient — Base interface for client communication with a Matrix.org homeserver</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="Matrix-0.0-MatrixClient.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-login-with-password" title="matrix_client_login_with_password ()">matrix_client_login_with_password</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-register-with-password" title="matrix_client_register_with_password ()">matrix_client_register_with_password</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-logout" title="matrix_client_logout ()">matrix_client_logout</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-begin-polling" title="matrix_client_begin_polling ()">matrix_client_begin_polling</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-stop-polling" title="matrix_client_stop_polling ()">matrix_client_stop_polling</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-emit-login-finished" title="matrix_client_emit_login_finished ()">matrix_client_emit_login_finished</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-incoming-event" title="matrix_client_incoming_event ()">matrix_client_incoming_event</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-connect-event" title="matrix_client_connect_event ()">matrix_client_connect_event</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClientEventCallback" title="MatrixClientEventCallback ()">*MatrixClientEventCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="Matrix-0.0-MatrixClient.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient">MatrixClient</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClientIface" title="struct MatrixClientIface">MatrixClientIface</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="Matrix-0.0-MatrixClient.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">
</pre>
</div>
<div class="refsect1">
<a name="Matrix-0.0-MatrixClient.description"></a><h2>Description</h2>
</div>
<div class="refsect1">
<a name="Matrix-0.0-MatrixClient.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="matrix-client-login-with-password"></a><h3>matrix_client_login_with_password ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_login_with_password (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *username</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *password</code></em>,
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Authenticate with the Matrix.org server with a username and password.</p>
<div class="refsect3">
<a name="id-1.2.7.7.2.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>username</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the username to login with </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>password</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the password to use </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Typed errors. Similar to throws in Java."><span class="acronym">error-domains</span></acronym> MatrixError]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-register-with-password"></a><h3>matrix_client_register_with_password ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_register_with_password (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *username</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *password</code></em>,
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Register <em class="parameter"><code>username</code></em>
with the homeserver as a normal user.</p>
<p>Upon success, the user is registered and authenticated.</p>
<p>Implementations must emit the login-finished signal when a response arrives.</p>
<p>This method registers a normal user account. If you want to register a different kind of user, use <a class="link" href="Matrix-0.0-MatrixAPI.html#matrix-api-register-account" title="matrix_api_register_account ()"><code class="function">matrix_api_register_account()</code></a>.</p>
<div class="refsect3">
<a name="id-1.2.7.7.3.8"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>username</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the username to register. If omitted, the server will generate one </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>password</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the password to use with the registration </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Typed errors. Similar to throws in Java."><span class="acronym">error-domains</span></acronym> MatrixError]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-logout"></a><h3>matrix_client_logout ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_logout (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Logout from the homeserver. As Matrix.org doesnt have such a concept, this cancels all ongoing requests and clears the authentication data (e.g. tokens).</p>
<div class="refsect3">
<a name="id-1.2.7.7.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Typed errors. Similar to throws in Java."><span class="acronym">error-domains</span></acronym> MatrixError]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-begin-polling"></a><h3>matrix_client_begin_polling ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_begin_polling (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Begin polling the event stream.</p>
<div class="refsect3">
<a name="id-1.2.7.7.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Typed errors. Similar to throws in Java."><span class="acronym">error-domains</span></acronym> MatrixError]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-stop-polling"></a><h3>matrix_client_stop_polling ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_stop_polling (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> cancel_ongoing</code></em>,
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Stop polling the event stream. If <em class="parameter"><code>param</code></em>
cancel_ongoing is </p>
<div class="informalexample"><pre class="programlisting">
true
</pre></div>
<p>
, ongoing requests will be cancelled, too.</p>
<div class="refsect3">
<a name="id-1.2.7.7.6.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancel_ongoing</p></td>
<td class="parameter_description">
<p>  . </p>
<p>if </p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
true
</pre></div>
<p>
</p>
<p>
, ongoing requests will be cancelled, too </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p> location to store the error occuring, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Typed errors. Similar to throws in Java."><span class="acronym">error-domains</span></acronym> MatrixError]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-emit-login-finished"></a><h3>matrix_client_emit_login_finished ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_emit_login_finished (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> success</code></em>);</pre>
<p>Convenience function to emits the login-finished signal.</p>
<div class="refsect3">
<a name="id-1.2.7.7.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>success</p></td>
<td class="parameter_description">
<p>  . </p>
<p>set to </p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
true
</pre></div>
<p>
</p>
<p>
if login was successful </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-incoming-event"></a><h3>matrix_client_incoming_event ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_incoming_event (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *room_id</code></em>,
<em class="parameter"><code><a href="../json-glib/json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *raw_event</code></em>,
<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixEvent.html#MatrixEvent" title="struct MatrixEvent"><span class="type">MatrixEvent</span></a> *matrix_event</code></em>);</pre>
<p>Emits the <span class="type">“event”</span> signal.</p>
<div class="refsect3">
<a name="id-1.2.7.7.8.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>room_id</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the room this event is associated with </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>raw_event</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the raw event </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>matrix_event</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the event as a Matrix.Event </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="matrix-client-connect-event"></a><h3>matrix_client_connect_event ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
matrix_client_connect_event (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *self</code></em>,
<em class="parameter"><code><a href="../gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> event_gtype</code></em>,
<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClientEventCallback" title="MatrixClientEventCallback ()"><span class="type">MatrixClientEventCallback</span></a> event_callback</code></em>,
<em class="parameter"><code><span class="type">void</span> *event_callback_target</code></em>,
<em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> event_callback_target_destroy_notify</code></em>);</pre>
<p>Connect a handler for events. If <em class="parameter"><code>param</code></em>
event_gtype is Matrix.Event, all events will be sent to the callback function, otherwise only events that match the specified event type.</p>
<p>If <em class="parameter"><code>event_gtype</code></em> is not derived from <a class="link" href="Matrix-0.0-MatrixEvent.html#MatrixEvent" title="struct MatrixEvent"><span class="type">MatrixEvent</span></a>, <em class="parameter"><code>param</code></em> callback wont get connected.</p>
<div class="refsect3">
<a name="id-1.2.7.7.9.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>the allback function to connect </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> instance</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>event_gtype</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the <a href="../gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of a <a class="link" href="Matrix-0.0-MatrixEvent.html#MatrixEvent" title="struct MatrixEvent"><span class="type">MatrixEvent</span></a> derivative </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>event_callback_target</p></td>
<td class="parameter_description"><p> user data to pass to <em class="parameter"><code>event_callback</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>event_callback_target_destroy_notify</p></td>
<td class="parameter_description"><p> function to call when <em class="parameter"><code>event_callback_target</code></em>
is no longer needed. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>event_callback</p></td>
<td class="parameter_description"><p> </p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="MatrixClientEventCallback"></a><h3>MatrixClientEventCallback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*MatrixClientEventCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> *client</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *room_id</code></em>,
<em class="parameter"><code><a href="../json-glib/json-glib-JSON-Node.html#JsonNode"><span class="type">JsonNode</span></a> *raw_event</code></em>,
<em class="parameter"><code><a class="link" href="Matrix-0.0-MatrixEvent.html#MatrixEvent" title="struct MatrixEvent"><span class="type">MatrixEvent</span></a> *matrix_event</code></em>,
<em class="parameter"><code><span class="type">void</span> *user_data</code></em>);</pre>
<p>Callback function delegate for the event signal.</p>
<div class="refsect3">
<a name="id-1.2.7.7.10.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>room_id</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the room the event associated with </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>raw_event</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the event as a raw JSON object </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>matrix_event</p></td>
<td class="parameter_description">
<p>  . </p>
<p>the event as a Matrix.Event object </p>
<p>. </p>
</td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>client</p></td>
<td class="parameter_description"><p> </p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p> data to pass to the delegate function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="Matrix-0.0-MatrixClient.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="MatrixClient"></a><h3>MatrixClient</h3>
<pre class="programlisting">typedef struct _MatrixClient MatrixClient;</pre>
<p>Base interface for client communication with a Matrix.org homeserver</p>
</div>
<hr>
<div class="refsect2">
<a name="MatrixClientIface"></a><h3>struct MatrixClientIface</h3>
<pre class="programlisting">struct MatrixClientIface {
GTypeInterface parent_iface;
void (*login_with_password) (MatrixClient* self, const gchar* username, const gchar* password, GError** error);
void (*register_with_password) (MatrixClient* self, const gchar* username, const gchar* password, GError** error);
void (*logout) (MatrixClient* self, GError** error);
void (*begin_polling) (MatrixClient* self, GError** error);
void (*stop_polling) (MatrixClient* self, gboolean cancel_ongoing, GError** error);
void (*login_finished) (MatrixClient* self, gboolean success);
void (*event) (MatrixClient* self, const gchar* room_id, JsonNode* raw_event, MatrixEvent* matrix_event);
};
</pre>
<p>Interface for creating <a class="link" href="Matrix-0.0-MatrixClient.html#MatrixClient" title="MatrixClient"><span class="type">MatrixClient</span></a> implementations.</p>
<div class="refsect3">
<a name="id-1.2.7.8.3.5"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><a href="../gobject/gobject-Type-Information.html#GTypeInterface"><span class="type">GTypeInterface</span></a> <em class="structfield"><code><a name="MatrixClientIface.parent-iface"></a>parent_iface</code></em>;</p></td>
<td class="struct_member_description"><p>the parent interface structure</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.login-with-password"></a>login_with_password</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual method called by <a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-login-with-password" title="matrix_client_login_with_password ()"><code class="function">matrix_client_login_with_password()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.register-with-password"></a>register_with_password</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual method called by <a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-register-with-password" title="matrix_client_register_with_password ()"><code class="function">matrix_client_register_with_password()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.logout"></a>logout</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual method called by <a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-logout" title="matrix_client_logout ()"><code class="function">matrix_client_logout()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.begin-polling"></a>begin_polling</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual method called by <a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-begin-polling" title="matrix_client_begin_polling ()"><code class="function">matrix_client_begin_polling()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.stop-polling"></a>stop_polling</code></em> ()</p></td>
<td class="struct_member_description"><p>virtual method called by <a class="link" href="Matrix-0.0-MatrixClient.html#matrix-client-stop-polling" title="matrix_client_stop_polling ()"><code class="function">matrix_client_stop_polling()</code></a></p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.login-finished"></a>login_finished</code></em> ()</p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="MatrixClientIface.event"></a>event</code></em> ()</p></td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.20</div>
</body>
</html>