updates.
[silc.git] / lib / silccore / silcnotify.h
1 /*
2
3   silcnotify.h
4
5   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
6
7   Copyright (C) 1997 - 2000 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
13   
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20
21 #ifndef SILCNOTIFY_H
22 #define SILCNOTIFY_H
23
24 /* Forward declarations */
25 typedef struct SilcNotifyPayloadStruct *SilcNotifyPayload;
26
27 /* Type definition of notify type */
28 typedef unsigned short SilcNotifyType;
29
30 /* SILC notify types. Server may send these notify types to client to
31    notify of some action. */
32 #define SILC_NOTIFY_TYPE_NONE            0 /* no specific type */
33 #define SILC_NOTIFY_TYPE_INVITE          1 /* invites/invite list change */
34 #define SILC_NOTIFY_TYPE_JOIN            2 /* "has joined channel" */
35 #define SILC_NOTIFY_TYPE_LEAVE           3 /* "has left channel" */
36 #define SILC_NOTIFY_TYPE_SIGNOFF         4 /* "signoff" */
37 #define SILC_NOTIFY_TYPE_TOPIC_SET       5 /* "topic has been changed" */
38 #define SILC_NOTIFY_TYPE_NICK_CHANGE     6 /* "has changed nickname" */
39 #define SILC_NOTIFY_TYPE_CMODE_CHANGE    7 /* "has changed channel mode" */
40 #define SILC_NOTIFY_TYPE_CUMODE_CHANGE   8 /* "has change mode" */
41 #define SILC_NOTIFY_TYPE_MOTD            9 /* message of the day */
42 #define SILC_NOTIFY_TYPE_CHANNEL_CHANGE  10 /* Channel's ID has changed */
43 #define SILC_NOTIFY_TYPE_SERVER_SIGNOFF  11 /* Server quitting SILC */
44 #define SILC_NOTIFY_TYPE_KICKED          12 /* Kicked from channel */
45 #define SILC_NOTIFY_TYPE_KILLED          13 /* Killed from the network */
46 #define SILC_NOTIFY_TYPE_UMODE_CHANGE    14 /* user mode was changed */
47 #define SILC_NOTIFY_TYPE_BAN             15 /* ban list change */
48
49 /* Prototypes */
50 SilcNotifyPayload silc_notify_payload_parse(SilcBuffer buffer);
51 SilcBuffer silc_notify_payload_encode(SilcNotifyType type, unsigned int argc, 
52                                       va_list ap);
53 SilcBuffer silc_notify_payload_encode_args(SilcNotifyType type, 
54                                            unsigned int argc,
55                                            SilcBuffer args);
56 void silc_notify_payload_free(SilcNotifyPayload payload);
57 SilcNotifyType silc_notify_get_type(SilcNotifyPayload payload);
58 unsigned int silc_notify_get_arg_num(SilcNotifyPayload payload);
59 SilcArgumentPayload silc_notify_get_args(SilcNotifyPayload payload);
60
61 #endif