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 [CCode (has_construct_function = false)]
11 public Connection (string server);
12 public bool authenticate (string username, string password, string resource, Lm.ResultFunction function, GLib.DestroyNotify? notify) throws GLib.Error;
13 public bool authenticate_and_block (string username, string password, string resource) throws GLib.Error;
14 public void cancel_open ();
15 public bool close () throws GLib.Error;
16 public unowned string get_full_jid ();
17 public unowned string get_jid ();
18 public uint get_keep_alive_rate ();
19 public string get_local_host ();
20 public uint get_port ();
21 public unowned Lm.Proxy get_proxy ();
22 public unowned string get_server ();
23 public unowned Lm.SSL get_ssl ();
24 public Lm.ConnectionState get_state ();
25 public bool is_authenticated ();
26 public bool is_open ();
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 [CCode (has_construct_function = false)]
50 public Message (string? to, Lm.MessageType type);
51 public unowned Lm.MessageNode get_node ();
52 public Lm.MessageSubType get_sub_type ();
53 public Lm.MessageType get_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 [CCode (has_construct_function = false)]
61 public MessageHandler (Lm.HandleMessageFunction function, GLib.DestroyNotify? notify);
62 public void invalidate ();
63 public bool is_valid ();
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 unowned Lm.MessageNode add_child (string name, string? value);
76 public unowned Lm.MessageNode? find_child (string child_name);
77 public unowned string get_attribute (string name);
78 public unowned Lm.MessageNode? get_child (string child_name);
79 public bool get_raw_mode ();
80 public unowned 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 [CCode (has_construct_function = false)]
91 public Proxy (Lm.ProxyType type);
92 public unowned string get_password ();
93 public uint get_port ();
94 public unowned string get_server ();
95 public unowned string get_username ();
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 [CCode (has_construct_function = false)]
108 public SSL (string expected_fingerprint, Lm.SSLFunction ssl_function, GLib.DestroyNotify? notify);
109 public unowned string get_fingerprint ();
110 public bool get_require_starttls ();
111 public bool get_use_starttls ();
112 public static bool is_supported ();
113 public void use_starttls (bool use_starttls, bool require);
115 [CCode (cprefix = "LM_CERT_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
116 public enum CertificateStatus {
121 [CCode (cprefix = "LM_CONNECTION_STATE_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
122 public enum ConnectionState {
129 [CCode (cprefix = "LM_DISCONNECT_REASON_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
130 public enum DisconnectReason {
139 [CCode (cprefix = "LM_ERROR_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
146 [CCode (cprefix = "LM_HANDLER_PRIORITY_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
147 public enum HandlerPriority {
152 [CCode (cprefix = "LM_HANDLER_RESULT_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
153 public enum HandlerResult {
157 [CCode (cprefix = "LM_MESSAGE_SUB_TYPE_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
158 public enum MessageSubType {
176 [CCode (cprefix = "LM_MESSAGE_TYPE_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
177 public enum MessageType {
193 [CCode (cprefix = "LM_PROXY_TYPE_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
194 public enum ProxyType {
198 [CCode (cprefix = "LM_SSL_RESPONSE_", has_type_id = false, cheader_filename = "loudmouth/loudmouth.h")]
199 public enum SSLResponse {
203 [CCode (cprefix = "LM_SSL_STATUS_", has_type_id = false, 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 ();