Codebase list telepathy-idle / 43f8629
Hide IdleServerConnectionState Will Thompson 11 years ago
2 changed file(s) with 11 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
5151 PROP_TLS_MANAGER
5252 };
5353
54 typedef enum {
55 SERVER_CONNECTION_STATE_NOT_CONNECTED,
56 SERVER_CONNECTION_STATE_CONNECTING,
57 SERVER_CONNECTION_STATE_CONNECTED
58 } IdleServerConnectionState;
59
5460 struct _IdleServerConnectionPrivate {
5561 gchar *host;
5662 guint16 port;
598604 return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT(result), error);
599605 }
600606
601 IdleServerConnectionState idle_server_connection_get_state(IdleServerConnection *conn) {
602 IdleServerConnectionPrivate *priv = IDLE_SERVER_CONNECTION_GET_PRIVATE(conn);
603 return priv->state;
607 gboolean idle_server_connection_is_connected(IdleServerConnection *conn) {
608 IdleServerConnectionPrivate *priv = IDLE_SERVER_CONNECTION_GET_PRIVATE(conn);
609
610 return priv->state == SERVER_CONNECTION_STATE_CONNECTED;
604611 }
605612
606613 void idle_server_connection_set_tls(IdleServerConnection *conn, gboolean tls) {
2828
2929 typedef struct _IdleServerConnection IdleServerConnection;
3030 typedef struct _IdleServerConnectionClass IdleServerConnectionClass;
31
32 typedef enum {
33 SERVER_CONNECTION_STATE_NOT_CONNECTED,
34 SERVER_CONNECTION_STATE_CONNECTING,
35 SERVER_CONNECTION_STATE_CONNECTED
36 } IdleServerConnectionState;
3731
3832 typedef enum {
3933 SERVER_CONNECTION_STATE_REASON_ERROR,
7670 gboolean idle_server_connection_disconnect_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error);
7771 void idle_server_connection_send_async(IdleServerConnection *conn, const gchar *cmd, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
7872 gboolean idle_server_connection_send_finish(IdleServerConnection *conn, GAsyncResult *result, GError **error);
79 IdleServerConnectionState idle_server_connection_get_state(IdleServerConnection *conn);
73 gboolean idle_server_connection_is_connected(IdleServerConnection *conn);
8074 void idle_server_connection_set_tls(IdleServerConnection *conn, gboolean tls);
8175
8276 G_END_DECLS