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