2
Copyright (C) 2013 Cable Developers
4
This program or library is free software; you can redistribute it
5
and/or modify it under the terms of the GNU Lesser General Public
6
License as published by the Free Software Foundation; either
7
version 3 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Lesser General Public License for more details.
14
You should have received a copy of the GNU Lesser General
15
Public License along with this library; if not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301 USA.
21
* This is a dbus interface to the maki daemon from the SushiIRC project.
22
* Use the methods to send requests or messages to the server and the
23
* signals to react to the server's replies.
25
* TODO document each function or take the actual documentation, if it exists
26
* TODO rename some of these, some names are not really descriptive
28
[DBus (name = "de.ikkoku.sushi", timeout = 120000)]
29
public interface Cable.Backend.Maki : GLib.Object {
32
[DBus (name = "action")]
33
public abstract void action (string server, string channel, string message) throws GLib.IOError;
35
// set user as away and set an away message
36
[DBus (name = "away")]
37
public abstract void away (string server, string message) throws GLib.IOError;
40
[DBus (name = "back")]
41
public abstract void back (string server) throws GLib.IOError;
43
[DBus (name = "channel_nicks")]
44
public abstract void channel_nicks (string server, string channel, out string[] nicks, out string[] prefixes) throws GLib.IOError;
46
[DBus (name = "channel_topic")]
47
public abstract string channel_topic (string server, string channel) throws GLib.IOError;
49
[DBus (name = "channels")]
50
public abstract string[] channels (string server) throws GLib.IOError;
52
[DBus (name = "config_get")]
53
public abstract string config_get (string group, string key) throws GLib.IOError;
55
[DBus (name = "config_set")]
56
public abstract void config_set (string group, string key, string value) throws GLib.IOError;
58
// connect to a server known to maki
59
[DBus (name = "connect")]
60
public abstract void connect (string server) throws GLib.IOError;
62
[DBus (name = "ctcp")]
63
public abstract void ctcp (string server, string target, string message) throws GLib.IOError;
65
[DBus (name = "dcc_send")]
66
public abstract void dcc_send(string server, string target, string path) throws GLib.IOError;
68
[DBus (name = "dcc_sends")]
69
public abstract void dcc_sends (out uint64[] ids, out string[] servers, out string[] froms, out string[] filenames, out uint64[] sizes, out uint64[] progresses, out uint64[] speeds, out uint64[] statuses) throws GLib.IOError;
71
[DBus (name = "dcc_send_accept")]
72
public abstract void dcc_send_accept (uint64 id) throws GLib.IOError;
74
[DBus (name = "dcc_send_get")]
75
public abstract string dcc_send_get (uint64 id, string key) throws GLib.IOError;
77
[DBus (name = "dcc_send_remove")]
78
public abstract void dcc_send_remove (uint64 id) throws GLib.IOError;
80
[DBus (name = "dcc_send_resume")]
81
public abstract void dcc_send_resume (uint64 id) throws GLib.IOError;
83
[DBus (name = "dcc_send_set")]
84
public abstract void dcc_send_set (uint64 id, string key, string value) throws GLib.IOError;
86
[DBus (name = "ignore")]
87
public abstract void ignore (string server, string pattern) throws GLib.IOError;
89
[DBus (name = "ignores")]
90
public abstract string[] ignores (string server) throws GLib.IOError;
92
[DBus (name = "invite")]
93
public abstract void invite (string server, string channel, string who) throws GLib.IOError;
95
[DBus (name = "join")]
96
public abstract void join (string server, string channel, string key) throws GLib.IOError;
98
[DBus (name = "kick")]
99
public abstract void kick (string server, string channel, string who, string message) throws GLib.IOError;
101
[DBus (name = "list")]
102
public abstract void list (string server, string channel) throws GLib.IOError;
104
[DBus (name = "log")]
105
public abstract string[] log (string server, string target, uint64 lines) throws GLib.IOError;
107
[DBus (name = "message")]
108
public abstract void message (string server, string target, string message) throws GLib.IOError;
110
[DBus (name = "mode")]
111
public abstract void mode (string server, string target, string mode) throws GLib.IOError;
113
[DBus (name = "names")]
114
public abstract void names (string server, string channel) throws GLib.IOError;
116
[DBus (name = "nick")]
117
public abstract void nick (string server, string nick) throws GLib.IOError;
119
[DBus (name = "nickserv")]
120
public abstract void nickserv (string server) throws GLib.IOError;
122
[DBus (name = "notice")]
123
public abstract void notice (string server, string target, string message) throws GLib.IOError;
125
[DBus (name = "oper")]
126
public abstract void oper (string server, string name, string password) throws GLib.IOError;
128
[DBus (name = "part")]
129
public abstract void part (string server, string channel, string message) throws GLib.IOError;
131
[DBus (name = "quit")]
132
public abstract void quit (string server, string message) throws GLib.IOError;
134
[DBus (name = "raw")]
135
public abstract void raw (string server, string command) throws GLib.IOError;
137
[DBus (name = "server_get")]
138
public abstract string server_get (string server, string group, string key) throws GLib.IOError;
140
[DBus (name = "server_get_list")]
141
public abstract string[] server_get_list (string server, string group, string key) throws GLib.IOError;
143
// server_list ("", "") gives a list of servers known to maki
144
[DBus (name = "server_list")]
145
public abstract string[] server_list (string server, string group) throws GLib.IOError;
147
[DBus (name = "server_remove")]
148
public abstract void server_remove (string server, string group, string key) throws GLib.IOError;
150
[DBus (name = "server_rename")]
151
public abstract void server_rename (string old, string new_) throws GLib.IOError;
153
// change server config (keys: address, port, nick, name)
154
[DBus (name = "server_set")]
155
public abstract void server_set (string server, string group, string key, string value) throws GLib.IOError;
157
[DBus (name = "server_set_list")]
158
public abstract void server_set_list (string server, string group, string key, string[] list) throws GLib.IOError;
160
[DBus (name = "servers")]
161
public abstract string[] servers () throws GLib.IOError;
163
[DBus (name = "shutdown")]
164
public abstract void shutdown (string message) throws GLib.IOError;
166
[DBus (name = "support_chantypes")]
167
public abstract string support_chantypes (string server) throws GLib.IOError;
169
[DBus (name = "support_prefix")]
170
public abstract string[] support_prefix (string server) throws GLib.IOError;
172
[DBus (name = "topic")]
173
public abstract void topic (string server, string channel, string topic) throws GLib.IOError;
175
[DBus (name = "unignore")]
176
public abstract void unignore (string server, string pattern) throws GLib.IOError;
178
[DBus (name = "user_away")]
179
public abstract bool user_away (string server, string nick) throws GLib.IOError;
181
[DBus (name = "user_channel_mode")]
182
public abstract string user_channel_mode (string server, string channel, string nick) throws GLib.IOError;
184
[DBus (name = "user_channel_prefix")]
185
public abstract string user_channel_prefix (string server, string channel, string nick) throws GLib.IOError;
187
[DBus (name = "user_from")]
188
public abstract string user_from (string server, string nick) throws GLib.IOError;
190
[DBus (name = "version")]
191
public abstract uint64[] version () throws GLib.IOError;
193
[DBus (name = "who")]
194
public abstract void who (string server, string mask, bool operators_only) throws GLib.IOError;
196
[DBus (name = "whois")]
197
public abstract void whois (string server, string mask) throws GLib.IOError;
199
[DBus (name = "action")]
200
public signal void event_action (int64 time, string server, string from, string target, string message);
202
[DBus (name = "away")]
203
public signal void event_away (int64 time, string server);
205
[DBus (name = "away_message")]
206
public signal void event_away_message (int64 time, string server, string nick, string message);
208
[DBus (name = "back")]
209
public signal void event_back (int64 time, string server);
211
[DBus (name = "banlist")]
212
public signal void event_banlist (int64 time, string server, string channel, string mask, string who, int64 when);
214
[DBus (name = "cannot_join")]
215
public signal void event_cannot_join (int64 time, string server, string channel, string reason);
217
[DBus (name = "connect")]
218
public signal void event_connect (int64 time, string server);
220
[DBus (name = "connected")]
221
public signal void event_connected (int64 time, string server);
223
[DBus (name = "ctcp")]
224
public signal void event_ctcp (int64 time, string server, string from, string target, string message);
226
[DBus (name = "dcc_send")]
227
public signal void event_dcc_send (int64 time, string server, uint64 id, string from, string filename, uint64 size, uint64 progress, uint64 speed, uint64 status);
229
[DBus (name = "error")]
230
public signal void event_error (int64 time, string server, string domain, string reason, string[] arguments);
232
[DBus (name = "invite")]
233
public signal void event_invite (int64 time, string server, string from, string channel, string who);
235
[DBus (name = "join")]
236
public signal void event_join (int64 time, string server, string from, string channel);
238
[DBus (name = "kick")]
239
public signal void event_kick (int64 time, string server, string from, string channel, string who, string message);
241
[DBus (name = "list")]
242
public signal void event_list (int64 time, string server, string channel, int64 users, string topic);
244
[DBus (name = "message")]
245
public signal void event_message (int64 time, string server, string from, string target, string message);
247
[DBus (name = "mode")]
248
public signal void event_mode (int64 time, string server, string from, string target, string mode, string parameter);
250
[DBus (name = "motd")]
251
public signal void event_motd (int64 time, string server, string message);
253
[DBus (name = "names")]
254
public signal void event_names (int64 time, string server, string channel, string[] nicks, string[] prefixes);
256
[DBus (name = "nick")]
257
public signal void event_nick (int64 time, string server, string from, string new_nick);
259
[DBus (name = "no_such")]
260
public signal void event_no_such (int64 time, string server, string target, string type);
262
[DBus (name = "notice")]
263
public signal void event_notice (int64 time, string server, string from, string target, string message);
265
[DBus (name = "oper")]
266
public signal void event_oper (int64 time, string server);
268
[DBus (name = "part")]
269
public signal void event_part (int64 time, string server, string from, string channel, string message);
271
[DBus (name = "quit")]
272
public signal void event_quit (int64 time, string server, string from, string message);
274
[DBus (name = "shutdown")]
275
public signal void event_shutdown (int64 time);
277
[DBus (name = "topic")]
278
public signal void event_topic (int64 time, string server, string from, string channel, string topic);
280
[DBus (name = "user_away")]
281
public signal void event_user_away (int64 time, string server, string from, bool away);
283
[DBus (name = "whois")]
284
public signal void event_whois (int64 time, string server, string nick, string message);