Release 0.41.92
[vala-gnome.git] / vapi / loudmouth-1.0.vapi
blob596d95cfd89d633b2a43f512d1fc5fd1f867a75c
1 /* loudmouth-1.0.vapi generated by vapigen, do not modify. */
3 namespace Lm {
4         [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_connection_ref", unref_function = "lm_connection_unref")]
5         [Compact]
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);
43         }
44         [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_message_ref", unref_function = "lm_message_unref")]
45         [Compact]
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);
55         }
56         [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_message_handler_ref", unref_function = "lm_message_handler_unref")]
57         [Compact]
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 ();
63         }
64         [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_message_node_ref", unref_function = "lm_message_node_unref")]
65         [Compact]
66         public class MessageNode {
67                 public Lm.MessageNode children;
68                 public string name;
69                 public weak Lm.MessageNode next;
70                 public weak Lm.MessageNode parent;
71                 public weak Lm.MessageNode prev;
72                 public bool raw_mode;
73                 public string value;
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 ();
85         }
86         [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_proxy_ref", unref_function = "lm_proxy_unref")]
87         [Compact]
88         public class Proxy {
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);
102         }
103         [CCode (cheader_filename = "loudmouth/loudmouth.h", ref_function = "lm_ssl_ref", unref_function = "lm_ssl_unref")]
104         [Compact]
105         public class SSL {
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);
113         }
114         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_CERT_", has_type_id = false)]
115         public enum CertificateStatus {
116                 INVALID,
117                 ISSUER_NOT_FOUND,
118                 REVOKED
119         }
120         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_CONNECTION_STATE_", has_type_id = false)]
121         public enum ConnectionState {
122                 CLOSED,
123                 OPENING,
124                 OPEN,
125                 AUTHENTICATING,
126                 AUTHENTICATED
127         }
128         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_DISCONNECT_REASON_", has_type_id = false)]
129         public enum DisconnectReason {
130                 OK,
131                 PING_TIME_OUT,
132                 HUP,
133                 ERROR,
134                 RESOURCE_CONFLICT,
135                 INVALID_XML,
136                 UNKNOWN
137         }
138         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_ERROR_", has_type_id = false)]
139         public enum Error {
140                 CONNECTION_NOT_OPEN,
141                 CONNECTION_OPEN,
142                 AUTH_FAILED,
143                 CONNECTION_FAILED
144         }
145         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_HANDLER_PRIORITY_", has_type_id = false)]
146         public enum HandlerPriority {
147                 LAST,
148                 NORMAL,
149                 FIRST
150         }
151         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_HANDLER_RESULT_", has_type_id = false)]
152         public enum HandlerResult {
153                 REMOVE_MESSAGE,
154                 ALLOW_MORE_HANDLERS
155         }
156         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_MESSAGE_SUB_TYPE_", has_type_id = false)]
157         public enum MessageSubType {
158                 NOT_SET,
159                 AVAILABLE,
160                 NORMAL,
161                 CHAT,
162                 GROUPCHAT,
163                 HEADLINE,
164                 UNAVAILABLE,
165                 PROBE,
166                 SUBSCRIBE,
167                 UNSUBSCRIBE,
168                 SUBSCRIBED,
169                 UNSUBSCRIBED,
170                 GET,
171                 SET,
172                 RESULT,
173                 ERROR
174         }
175         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_MESSAGE_TYPE_", has_type_id = false)]
176         public enum MessageType {
177                 MESSAGE,
178                 PRESENCE,
179                 IQ,
180                 STREAM,
181                 STREAM_ERROR,
182                 STREAM_FEATURES,
183                 AUTH,
184                 CHALLENGE,
185                 RESPONSE,
186                 SUCCESS,
187                 FAILURE,
188                 PROCEED,
189                 STARTTLS,
190                 UNKNOWN
191         }
192         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_PROXY_TYPE_", has_type_id = false)]
193         public enum ProxyType {
194                 NONE,
195                 HTTP
196         }
197         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_SSL_RESPONSE_", has_type_id = false)]
198         public enum SSLResponse {
199                 CONTINUE,
200                 STOP
201         }
202         [CCode (cheader_filename = "loudmouth/loudmouth.h", cprefix = "LM_SSL_STATUS_", has_type_id = false)]
203         public enum SSLStatus {
204                 NO_CERT_FOUND,
205                 UNTRUSTED_CERT,
206                 CERT_EXPIRED,
207                 CERT_NOT_ACTIVATED,
208                 CERT_HOSTNAME_MISMATCH,
209                 CERT_FINGERPRINT_MISMATCH,
210                 GENERIC_ERROR
211         }
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 ();