![]() |
![]() |
![]() |
wocky Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
WockyPorterWockyPorter — Wrapper around a WockyXmppConnection providing a higher level API. |
enum WockyPorterError; GQuark wocky_porter_error_quark (void); #define WOCKY_PORTER_HANDLER_PRIORITY_MIN #define WOCKY_PORTER_HANDLER_PRIORITY_NORMAL #define WOCKY_PORTER_HANDLER_PRIORITY_MAX #define WOCKY_PORTER_ERROR WockyPorter; WockyPorterClass; WockyPorter * wocky_porter_new (WockyXmppConnection *connection); void wocky_porter_send_async (WockyPorter *porter, WockyXmppStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_porter_send_finish (WockyPorter *porter, GAsyncResult *result, GError **error); void wocky_porter_send (WockyPorter *porter, WockyXmppStanza *stanza); void wocky_porter_start (WockyPorter *porter); gboolean (*WockyPorterHandlerFunc) (WockyPorter *porter, WockyXmppStanza *stanza, gpointer user_data); guint wocky_porter_register_handler (WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyBuildTag spec, ...); void wocky_porter_unregister_handler (WockyPorter *porter, guint id); void wocky_porter_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_porter_close_finish (WockyPorter *porter, GAsyncResult *result, GError **error); void wocky_porter_send_iq_async (WockyPorter *porter, WockyXmppStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); WockyXmppStanza * wocky_porter_send_iq_finish (WockyPorter *porter, GAsyncResult *result, GError **error); void wocky_porter_force_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean wocky_porter_force_close_finish (WockyPorter *porter, GAsyncResult *result, GError **error);
typedef enum { WOCKY_PORTER_ERROR_NOT_STARTED, WOCKY_PORTER_ERROR_CLOSING, WOCKY_PORTER_ERROR_CLOSED, WOCKY_PORTER_ERROR_NOT_IQ, WOCKY_PORTER_ERROR_FORCIBLY_CLOSED, } WockyPorterError;
GQuark wocky_porter_error_quark (void);
Get the error quark used by the porter.
Returns : |
the quark for porter errors. |
#define WOCKY_PORTER_HANDLER_PRIORITY_NORMAL (guint) (G_MAXUINT / 2)
#define WOCKY_PORTER_ERROR (wocky_porter_error_quark ())
Get access to the error quark of the xmpp porter.
WockyPorter * wocky_porter_new (WockyXmppConnection *connection);
Convenience function to create a new WockyPorter.
|
WockyXmppConnection which will be used to receive and send WockyXmppStanza |
Returns : |
a new WockyPorter. |
void wocky_porter_send_async (WockyPorter *porter, WockyXmppStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
gboolean wocky_porter_send_finish (WockyPorter *porter, GAsyncResult *result, GError **error);
|
|
|
|
|
|
Returns : |
void wocky_porter_send (WockyPorter *porter, WockyXmppStanza *stanza);
|
|
|
gboolean (*WockyPorterHandlerFunc) (WockyPorter *porter, WockyXmppStanza *stanza, gpointer user_data);
|
|
|
|
|
|
Returns : |
guint wocky_porter_register_handler (WockyPorter *porter, WockyStanzaType type, WockyStanzaSubType sub_type, const gchar *from, guint priority, WockyPorterHandlerFunc callback, gpointer user_data, WockyBuildTag spec, ...);
spec
should be WOCKY_STANZA_END to specify no XMPP node matching details.
If from
is a bare JID, then the resource of the JID in the from attribute
will be ignored: In other words, a handler registered against a bare JID
will match _all_ stanzas from a JID with the same node and domain:
"foo@bar.org" will match:
"foo@bar.org", "foo@bar.org/moose" and so forth.
|
|
|
A WockyStanzaSubType value, stanza type to be handled WOCKY_STANZA_TYPE_NONE for all. |
|
A WockyStanzaSubType value, stanza sub type to be handled, WOCKY_STANZA_SUB_TYPE_NONE for all. |
|
the JID whose messages this handler is intended for (or NULL for any).
|
|
a priority between WOCKY_PORTER_HANDLER_PRIORITY_MIN and WOCKY_PORTER_HANDLER_PRIORITY_MAX (often WOCKY_PORTER_HANDLER_PRIORITY_NORMAL ).
|
|
A WockyPorterHandlerFunc, should return FALSE to decline the stanza and TRUE to stop further processing and free the stanza.
|
|
Passed to callback .
|
|
the start of a wocky_xmpp_stanza_build() specification. The handler will be a candidate only if the stanza received is a superset of the one built with spec and its subsequent arguments, as per wocky_xmpp_node_is_superset() .
|
|
the rest of the args to wocky_xmpp_stanza_build() .
|
Returns : |
a non-zero guint id for use with wocky_porter_unregister_handler() .
|
void wocky_porter_unregister_handler (WockyPorter *porter, guint id);
|
|
|
void wocky_porter_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
gboolean wocky_porter_close_finish (WockyPorter *porter, GAsyncResult *result, GError **error);
|
|
|
|
|
|
Returns : |
void wocky_porter_send_iq_async (WockyPorter *porter, WockyXmppStanza *stanza, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
|
|
WockyXmppStanza * wocky_porter_send_iq_finish (WockyPorter *porter, GAsyncResult *result, GError **error);
|
|
|
|
|
|
Returns : |
void wocky_porter_force_close_async (WockyPorter *porter, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
|
|
|
|
|
|
|
gboolean wocky_porter_force_close_finish (WockyPorter *porter, GAsyncResult *result, GError **error);
|
|
|
|
|
|
Returns : |
"connection"
property"connection" WockyXmppConnection* : Read / Write / Construct Only
the XMPP connection used by this porter.
"closing"
signalvoid user_function (WockyPorter *wockyporter, gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"remote-closed"
signalvoid user_function (WockyPorter *wockyporter, gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"remote-error"
signalvoid user_function (WockyPorter *wockyporter, guint arg1, gint arg2, gchar *arg3, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
|
|
|
|
user data set when the signal handler was connected. |