1 /* |
|
2 * gabble-presence-cache.h - Headers for Gabble's contact presence cache |
|
3 * Copyright (C) 2005 Collabora Ltd. |
|
4 * |
|
5 * |
|
6 * This library is free software; you can redistribute it and/or |
|
7 * modify it under the terms of the GNU Lesser General Public |
|
8 * License as published by the Free Software Foundation; either |
|
9 * version 2.1 of the License, or (at your option) any later version. |
|
10 * |
|
11 * This library is distributed in the hope that it will be useful, |
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 * Lesser General Public License for more details. |
|
15 * |
|
16 * You should have received a copy of the GNU Lesser General Public |
|
17 * License along with this library; if not, write to the Free Software |
|
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
19 */ |
|
20 |
|
21 #ifndef __GABBLE_PRESENCE_CACHE_H__ |
|
22 #define __GABBLE_PRESENCE_CACHE_H__ |
|
23 |
|
24 #include <glib-object.h> |
|
25 |
|
26 #include "gabble-presence.h" |
|
27 #include "handles.h" |
|
28 |
|
29 G_BEGIN_DECLS |
|
30 |
|
31 #define GABBLE_TYPE_PRESENCE_CACHE gabble_presence_cache_get_type() |
|
32 |
|
33 #define GABBLE_PRESENCE_CACHE(obj) \ |
|
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ |
|
35 GABBLE_TYPE_PRESENCE_CACHE, GabblePresenceCache)) |
|
36 |
|
37 #define GABBLE_PRESENCE_CACHE_CLASS(klass) \ |
|
38 (G_TYPE_CHECK_CLASS_CAST ((klass), \ |
|
39 GABBLE_TYPE_PRESENCE_CACHE, GabblePresenceCacheClass)) |
|
40 |
|
41 #define GABBLE_IS_PRESENCE_CACHE(obj) \ |
|
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ |
|
43 GABBLE_TYPE_PRESENCE_CACHE)) |
|
44 |
|
45 #define GABBLE_IS_PRESENCE_CACHE_CLASS(klass) \ |
|
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), \ |
|
47 GABBLE_TYPE_PRESENCE_CACHE)) |
|
48 |
|
49 #define GABBLE_PRESENCE_CACHE_GET_CLASS(obj) \ |
|
50 (G_TYPE_INSTANCE_GET_CLASS ((obj), \ |
|
51 GABBLE_TYPE_PRESENCE_CACHE, GabblePresenceCacheClass)) |
|
52 |
|
53 #define JABBER_PRESENCE_SHOW_AWAY "away" |
|
54 #define JABBER_PRESENCE_SHOW_CHAT "chat" |
|
55 #define JABBER_PRESENCE_SHOW_DND "dnd" |
|
56 #define JABBER_PRESENCE_SHOW_XA "xa" |
|
57 |
|
58 struct _GabblePresenceCache { |
|
59 GObject parent; |
|
60 gpointer priv; |
|
61 }; |
|
62 |
|
63 typedef struct _GabblePresenceCacheClass GabblePresenceCacheClass; |
|
64 |
|
65 struct _GabblePresenceCacheClass { |
|
66 GObjectClass parent_class; |
|
67 }; |
|
68 |
|
69 IMPORT_C GType gabble_presence_cache_get_type (void); |
|
70 |
|
71 GabblePresenceCache *gabble_presence_cache_new (GabbleConnection *conn); |
|
72 GabblePresence *gabble_presence_cache_get (GabblePresenceCache *cache, |
|
73 GabbleHandle handle); |
|
74 void gabble_presence_cache_update (GabblePresenceCache *cache, |
|
75 GabbleHandle handle, const gchar *resource, GabblePresenceId presence_id, |
|
76 const gchar *status_message, gint8 priority); |
|
77 void gabble_presence_cache_maybe_remove (GabblePresenceCache *cache, |
|
78 GabbleHandle handle); |
|
79 void gabble_presence_cache_add_bundle_caps (GabblePresenceCache *cache, |
|
80 const gchar *node, GabblePresenceCapabilities caps); |
|
81 |
|
82 G_END_DECLS |
|
83 |
|
84 #endif /* __GABBLE_PRESENCE_CACHE_H__ */ |
|
85 |
|