1 /* loudmouth-1.0.vapi generated by vapigen, do not modify. */
4 [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_connection_ref", unref_function = "lm_connection_unref")]
6 public class Connection {
7 public const int DEFAULT_PORT;
8 public const int DEFAULT_PORT_SSL;
9 [CCode (has_construct_function = false)]
10 public Connection (string server);
11 public bool authenticate (string username, string password, string resource, Lm.ResultFunction function, GLib.DestroyNotify? notify) throws GLib.Error;
12 public bool authenticate_and_block (string username, string password, string resource) throws GLib.Error;
13 public void cancel_open ();
14 public bool close () throws GLib.Error;
15 public unowned string get_full_jid ();
16 public unowned string get_jid ();
17 public uint get_keep_alive_rate ();
18 public string get_local_host ();
19 public uint get_port ();
20 public unowned Lm.Proxy get_proxy ();
21 public unowned string get_server ();
22 public unowned Lm.SSL get_ssl ();
23 public Lm.ConnectionState get_state ();
24 public bool is_authenticated ();
25 public bool is_open ();
26 public bool open (Lm.ResultFunction function, GLib.DestroyNotify? notify) throws GLib.Error;
27 public bool open_and_block () throws GLib.Error;
28 public void register_message_handler (Lm.MessageHandler handler, Lm.MessageType type, Lm.HandlerPriority priority);
29 public bool send (Lm.Message message) throws GLib.Error;
30 public bool send_raw (string str) throws GLib.Error;
31 public bool send_with_reply (Lm.Message message, Lm.MessageHandler handler) throws GLib.Error;
32 public Lm.Message send_with_reply_and_block (Lm.Message message) throws GLib.Error;
33 public void set_disconnect_function (Lm.DisconnectFunction function, GLib.DestroyNotify? notify);
34 public void set_jid (string jid);
35 public void set_keep_alive_rate (uint rate);
36 public void set_port (uint port);
37 public void set_proxy (Lm.Proxy proxy);
38 public void set_server (string server);
39 public void set_ssl (Lm.SSL ssl);
40 public void unregister_message_handler (Lm.MessageHandler handler, Lm.MessageType type);
41 [CCode (has_construct_function = false)]
42 public Connection.with_context (string server, GLib.MainContext context);
44 [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_message_ref", unref_function = "lm_message_unref")]
46 public class Message {
47 public Lm.MessageNode node;
48 [CCode (has_construct_function = false)]
49 public Message (string? to, Lm.MessageType type);
50 public unowned Lm.MessageNode get_node ();
51 public Lm.MessageSubType get_sub_type ();
52 public Lm.MessageType get_type ();
53 [CCode (has_construct_function = false)]
54 public Message.with_sub_type (string? to, Lm.MessageType type, Lm.MessageSubType sub_type);
56 [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_message_handler_ref", unref_function = "lm_message_handler_unref")]
58 public class MessageHandler {
59 [CCode (has_construct_function = false)]
60 public MessageHandler (Lm.HandleMessageFunction function, GLib.DestroyNotify? notify);
61 public void invalidate ();
62 public bool is_valid ();
64 [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_message_node_ref", unref_function = "lm_message_node_unref")]
66 public class MessageNode {
67 public Lm.MessageNode children;
69 public weak Lm.MessageNode next;
70 public weak Lm.MessageNode parent;
71 public weak Lm.MessageNode prev;
74 public unowned Lm.MessageNode add_child (string name, string? value);
75 public unowned Lm.MessageNode? find_child (string child_name);
76 public unowned string get_attribute (string name);
77 public unowned Lm.MessageNode? get_child (string child_name);
78 public bool get_raw_mode ();
79 public unowned string get_value ();
80 public void set_attribute (string name, string value);
81 public void set_attributes (string name, ...);
82 public void set_raw_mode (bool raw_mode);
83 public void set_value (string value);
84 public string to_string ();
86 [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_proxy_ref", unref_function = "lm_proxy_unref")]
89 [CCode (has_construct_function = false)]
90 public Proxy (Lm.ProxyType type);
91 public unowned string get_password ();
92 public uint get_port ();
93 public unowned string get_server ();
94 public unowned string get_username ();
95 public void set_password (string password);
96 public void set_port (uint port);
97 public void set_server (string server);
98 public void set_type (Lm.ProxyType type);
99 public void set_username (string username);
100 [CCode (has_construct_function = false)]
101 public Proxy.with_server (Lm.ProxyType type, string server, uint port);
103 [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_ssl_ref", unref_function = "lm_ssl_unref")]
106 [CCode (has_construct_function = false)]
107 public SSL (string expected_fingerprint, Lm.SSLFunction ssl_function, GLib.DestroyNotify? notify);
108 public unowned string get_fingerprint ();
109 public bool get_require_starttls ();
110 public bool get_use_starttls ();
111 public static bool is_supported ();
112 public void use_starttls (bool use_starttls, bool require);
114 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_CERT_", has_type_id = false)]
115 public enum CertificateStatus {
120 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_CONNECTION_STATE_", has_type_id = false)]
121 public enum ConnectionState {
128 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_DISCONNECT_REASON_", has_type_id = false)]
129 public enum DisconnectReason {
138 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_ERROR_", has_type_id = false)]
145 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_HANDLER_PRIORITY_", has_type_id = false)]
146 public enum HandlerPriority {
151 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_HANDLER_RESULT_", has_type_id = false)]
152 public enum HandlerResult {
156 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_MESSAGE_SUB_TYPE_", has_type_id = false)]
157 public enum MessageSubType {
175 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_MESSAGE_TYPE_", has_type_id = false)]
176 public enum MessageType {
192 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_PROXY_TYPE_", has_type_id = false)]
193 public enum ProxyType {
197 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_SSL_RESPONSE_", has_type_id = false)]
198 public enum SSLResponse {
202 [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_SSL_STATUS_", has_type_id = false)]
203 public enum SSLStatus {
208 CERT_HOSTNAME_MISMATCH,
209 CERT_FINGERPRINT_MISMATCH,
212 [CCode (cheader_filename = "loudmouth/loudmouth.h")]
213 public delegate void DisconnectFunction (Lm.Connection connection, Lm.DisconnectReason reason);
214 [CCode (cheader_filename = "loudmouth/loudmouth.h")]
215 public delegate Lm.HandlerResult HandleMessageFunction (Lm.MessageHandler handler, Lm.Connection connection, Lm.Message message);
216 [CCode (cheader_filename = "loudmouth/loudmouth.h")]
217 public delegate void ResultFunction (Lm.Connection connection, bool success);
218 [CCode (cheader_filename = "loudmouth/loudmouth.h")]
219 public delegate Lm.SSLResponse SSLFunction (Lm.SSL ssl, Lm.SSLStatus status);
220 [CCode (cheader_filename = "loudmouth/loudmouth.h")]
221 public static GLib.Quark error_quark ();