Mercurial > hg
annotate mcabber/mcabber/hooks.h @ 1852:057b514b1f12
Fix 3 minor warnings
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 01 Apr 2010 21:12:56 +0200 |
parents | 6ac5718f8d25 |
children | 5d37cee8c6c6 |
rev | line source |
---|---|
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
1 #ifndef __MCABBER_HOOKS_H__ |
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
2 #define __MCABBER_HOOKS_H__ 1 |
113 | 3 |
4 #include <time.h> | |
1598 | 5 #include <loudmouth/loudmouth.h> |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
6 #include <mcabber/xmpp.h> |
113 | 7 |
1484
7b36b91a4388
New UI message flag (O) when OTR is used
Mikael Berthe <mikael@lilotux.net>
parents:
1425
diff
changeset
|
8 // These two defines are used by hk_message_{in,out} arguments |
7b36b91a4388
New UI message flag (O) when OTR is used
Mikael Berthe <mikael@lilotux.net>
parents:
1425
diff
changeset
|
9 #define ENCRYPTED_PGP 1 |
7b36b91a4388
New UI message flag (O) when OTR is used
Mikael Berthe <mikael@lilotux.net>
parents:
1425
diff
changeset
|
10 #define ENCRYPTED_OTR 2 |
113 | 11 |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
12 #include <mcabber/config.h> |
1607 | 13 #ifdef MODULES_ENABLE |
14 #include <glib.h> | |
15 | |
1795 | 16 // Core hooks |
1797
246c5d359c97
Add "hook-pre-message-in" hook
Mikael Berthe <mikael@lilotux.net>
parents:
1796
diff
changeset
|
17 #define HOOK_PRE_MESSAGE_IN "hook-pre-message-in" |
1796
5e2db25fdb17
Rename "hook-message-in" to "hook-post-message-in"
Mikael Berthe <mikael@lilotux.net>
parents:
1795
diff
changeset
|
18 #define HOOK_POST_MESSAGE_IN "hook-post-message-in" |
1795 | 19 #define HOOK_MESSAGE_OUT "hook-message-out" |
20 #define HOOK_STATUS_CHANGE "hook-status-change" | |
21 #define HOOK_MY_STATUS_CHANGE "hook-my-status-change" | |
22 #define HOOK_POST_CONNECT "hook-post-connect" | |
23 #define HOOK_PRE_DISCONNECT "hook-pre-disconnect" | |
1806
9daf6b3f30d6
Add hook-unread-list-change
Mikael Berthe <mikael@lilotux.net>
parents:
1797
diff
changeset
|
24 #define HOOK_UNREAD_LIST_CHANGE "hook-unread-list-change" |
1795 | 25 |
26 typedef enum { | |
1813
1c3efa9bc422
s/HOOK_HANDLER_RESULT_ALLOW_MORE_HOOKS/HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS
Mikael Berthe <mikael@lilotux.net>
parents:
1812
diff
changeset
|
27 HOOK_HANDLER_RESULT_ALLOW_MORE_HANDLERS = 0, |
1816
6ac5718f8d25
Update handler return code defines (take #2)
Mikael Berthe <mikael@lilotux.net>
parents:
1813
diff
changeset
|
28 HOOK_HANDLER_RESULT_NO_MORE_HANDLER, |
6ac5718f8d25
Update handler return code defines (take #2)
Mikael Berthe <mikael@lilotux.net>
parents:
1813
diff
changeset
|
29 HOOK_HANDLER_RESULT_NO_MORE_HANDLER_DROP_DATA, |
1795 | 30 } hk_handler_result; |
1623
b008ac166b91
Flags for hook handlers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1607
diff
changeset
|
31 |
1607 | 32 typedef struct { |
33 const char *name; | |
34 const char *value; | |
35 } hk_arg_t; | |
36 | |
1795 | 37 typedef guint (*hk_handler_t) (const gchar *hookname, hk_arg_t *args, |
38 gpointer userdata); | |
1607 | 39 |
1795 | 40 guint hk_add_handler(hk_handler_t handler, const gchar *hookname, |
41 gint priority, gpointer userdata); | |
42 void hk_del_handler(const gchar *hookname, guint hid); | |
43 guint hk_run_handlers(const gchar *hookname, hk_arg_t *args); | |
1607 | 44 #endif |
45 | |
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
46 void hk_message_in(const char *bjid, const char *resname, |
1598 | 47 time_t timestamp, const char *msg, LmMessageSubType type, |
48 guint encrypted); | |
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
49 void hk_message_out(const char *bjid, const char *nickname, |
1602 | 50 time_t timestamp, const char *msg, |
51 guint encrypted, gpointer xep184); | |
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
52 void hk_statuschange(const char *bjid, const char *resname, gchar prio, |
1598 | 53 time_t timestamp, enum imstatus status, |
54 char const *status_msg); | |
1398
f8321420ed7a
Remove useless inline's
Mikael Berthe <mikael@lilotux.net>
parents:
1352
diff
changeset
|
55 void hk_mystatuschange(time_t timestamp, |
1784
250ad919f03f
Small code cleanup in hooks.[ch]
Mikael Berthe <mikael@lilotux.net>
parents:
1683
diff
changeset
|
56 enum imstatus old_status, enum imstatus new_status, |
250ad919f03f
Small code cleanup in hooks.[ch]
Mikael Berthe <mikael@lilotux.net>
parents:
1683
diff
changeset
|
57 const char *msg); |
113 | 58 |
1683
b09f82f61745
Split HOOK_INTERNAL
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1668
diff
changeset
|
59 void hk_postconnect(void); |
b09f82f61745
Split HOOK_INTERNAL
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1668
diff
changeset
|
60 void hk_predisconnect(void); |
1352
61a54e172010
Add internal hooks support
Mikael Berthe <mikael@lilotux.net>
parents:
1058
diff
changeset
|
61 |
1812
5dbb3ebbc466
Add hk_unread_list_change()
Mikael Berthe <mikael@lilotux.net>
parents:
1811
diff
changeset
|
62 void hk_unread_list_change(guint unread_count, guint attention_count, |
5dbb3ebbc466
Add hk_unread_list_change()
Mikael Berthe <mikael@lilotux.net>
parents:
1811
diff
changeset
|
63 guint muc_unread, guint muc_attention); |
5dbb3ebbc466
Add hk_unread_list_change()
Mikael Berthe <mikael@lilotux.net>
parents:
1811
diff
changeset
|
64 |
281
f562b9af2de7
Add "const" specifier in prototypes
Mikael Berthe <mikael@lilotux.net>
parents:
221
diff
changeset
|
65 void hk_ext_cmd_init(const char *command); |
1058 | 66 void hk_ext_cmd(const char *bjid, guchar type, guchar info, const char *data); |
160 | 67 |
1668
41c26b7d2890
Install mcabber headers
Myhailo Danylenko <isbear@ukrpost.net>
parents:
1658
diff
changeset
|
68 #endif /* __MCABBER_HOOKS_H__ */ |
576 | 69 |
1811 | 70 /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2: For Vim users... */ |