meanwhile  1.0.2
mw_srvc_aware.h
Go to the documentation of this file.
1 
2 /*
3  Meanwhile - Unofficial Lotus Sametime Community Client Library
4  Copyright (C) 2004 Christopher (siege) O'Brien
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 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  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public
17  License along with this library; if not, write to the Free
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 
21 #ifndef _MW_SRVC_AWARE_H
22 #define _MW_SRVC_AWARE_H
23 
24 
37 #include "mw_common.h"
38 
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 
46 #define mwService_AWARE 0x00000011
47 
48 
57 
58 
68 struct mwAwareList;
69 
70 
75 struct mwAwareAttribute;
76 
77 
86 };
87 
88 
89 typedef void (*mwAwareAttributeHandler)
90  (struct mwServiceAware *srvc,
91  struct mwAwareAttribute *attrib);
92 
93 
96  void (*clear)(struct mwServiceAware *srvc);
97 };
98 
99 
106 typedef void (*mwAwareSnapshotHandler)
107  (struct mwAwareList *list,
108  struct mwAwareSnapshot *id);
109 
110 
119 typedef void (*mwAwareIdAttributeHandler)
120  (struct mwAwareList *list,
121  struct mwAwareIdBlock *id,
122  struct mwAwareAttribute *attrib);
123 
124 
128 
131 
133  void (*clear)(struct mwAwareList *list);
134 };
135 
136 
137 struct mwServiceAware *
139  struct mwAwareHandler *handler);
140 
141 
144  guint32 key, struct mwOpaque *opaque);
145 
146 
148  guint32 key, gboolean val);
149 
150 
152  guint32 key, guint32 val);
153 
154 
156  guint32 key, const char *str);
157 
158 
161  guint32 key);
162 
163 
164 guint32 mwAwareAttribute_getKey(const struct mwAwareAttribute *attrib);
165 
166 
167 gboolean mwAwareAttribute_asBoolean(const struct mwAwareAttribute *attrib);
168 
169 
170 guint32 mwAwareAttribute_asInteger(const struct mwAwareAttribute *attrib);
171 
172 
175 char *mwAwareAttribute_asString(const struct mwAwareAttribute *attrib);
176 
177 
179 const struct mwOpaque *
180 mwAwareAttribute_asOpaque(const struct mwAwareAttribute *attrib);
181 
182 
184 struct mwAwareList *
185 mwAwareList_new(struct mwServiceAware *srvc,
186  struct mwAwareListHandler *handler);
187 
188 
190 void mwAwareList_free(struct mwAwareList *list);
191 
192 
194 
195 
201 int mwAwareList_addAware(struct mwAwareList *list, GList *id_list);
202 
203 
209 int mwAwareList_removeAware(struct mwAwareList *list, GList *id_list);
210 
211 
212 int mwAwareList_removeAllAware(struct mwAwareList *list);
213 
214 
217  guint32 *keys);
218 
219 
222  guint32 key, ...);
223 
224 
227  guint32 *keys);
228 
229 
232  guint32 key, ...);
233 
234 
237 
238 
239 guint32 *mwAwareList_getWatchedAttributes(struct mwAwareList *list);
240 
241 
242 void mwAwareList_setClientData(struct mwAwareList *list,
243  gpointer data, GDestroyNotify cleanup);
244 
245 
246 void mwAwareList_removeClientData(struct mwAwareList *list);
247 
248 
249 gpointer mwAwareList_getClientData(struct mwAwareList *list);
250 
251 
255 void mwServiceAware_setStatus(struct mwServiceAware *srvc,
256  struct mwAwareIdBlock *user,
257  struct mwUserStatus *stat);
258 
259 
261 const char *mwServiceAware_getText(struct mwServiceAware *srvc,
262  struct mwAwareIdBlock *user);
263 
264 
267 const struct mwAwareAttribute *
269  struct mwAwareIdBlock *user,
270  guint32 key);
271 
272 
273 #ifdef __cplusplus
274 }
275 #endif
276 
277 
278 #endif /* _MW_SRVC_AWARE_H */
279 
mwServiceAware_getText
const char * mwServiceAware_getText(struct mwServiceAware *srvc, struct mwAwareIdBlock *user)
look up the status description for a user
mwAwareAttributeKeys
mwAwareAttributeKeys
Predefined keys appropriate for a mwAwareAttribute.
Definition: mw_srvc_aware.h:80
mwServiceAware_new
struct mwServiceAware * mwServiceAware_new(struct mwSession *session, struct mwAwareHandler *handler)
mwAwareListHandler::on_aware
mwAwareSnapshotHandler on_aware
handle aware updates
Definition: mw_srvc_aware.h:127
mwAwareList_addAware
int mwAwareList_addAware(struct mwAwareList *list, GList *id_list)
Add a collection of user IDs to an aware list.
mwAwareList_new
struct mwAwareList * mwAwareList_new(struct mwServiceAware *srvc, struct mwAwareListHandler *handler)
Allocate and initialize an aware list.
mwAttribute_FILE_TRANSFER
@ mwAttribute_FILE_TRANSFER
supports file transfers, gboolean
Definition: mw_srvc_aware.h:85
mwAwareAttribute_asString
char * mwAwareAttribute_asString(const struct mwAwareAttribute *attrib)
Copy of attribute string, must be g_free'd.
mwServiceAware_setAttributeInteger
int mwServiceAware_setAttributeInteger(struct mwServiceAware *srvc, guint32 key, guint32 val)
mwAwareAttribute_asBoolean
gboolean mwAwareAttribute_asBoolean(const struct mwAwareAttribute *attrib)
mwAwareHandler::clear
void(* clear)(struct mwServiceAware *srvc)
Definition: mw_srvc_aware.h:96
mw_common.h
mwServiceAware_setAttribute
int mwServiceAware_setAttribute(struct mwServiceAware *srvc, guint32 key, struct mwOpaque *opaque)
Set an attribute value for this session.
mwAwareList_removeAllAware
int mwAwareList_removeAllAware(struct mwAwareList *list)
mwAwareListHandler::on_attrib
mwAwareIdAttributeHandler on_attrib
handle attribute updates
Definition: mw_srvc_aware.h:130
mwAttribute_MICROPHONE
@ mwAttribute_MICROPHONE
has a microphone, gboolean
Definition: mw_srvc_aware.h:82
mwUserStatus
Definition: mw_common.h:165
mwAwareList
Definition: mw_srvc_aware.h:56
mwAwareList_getClientData
gpointer mwAwareList_getClientData(struct mwAwareList *list)
mwAwareList_removeAware
int mwAwareList_removeAware(struct mwAwareList *list, GList *id_list)
Remove a collection of user IDs from an aware list.
mwAwareList_unwatchAllAttributes
int mwAwareList_unwatchAllAttributes(struct mwAwareList *list)
remove all watched attributes
mwAwareHandler
Definition: mw_srvc_aware.h:94
mwAwareHandler::on_attrib
mwAwareAttributeHandler on_attrib
Definition: mw_srvc_aware.h:95
mwAwareList_free
void mwAwareList_free(struct mwAwareList *list)
Clean and free an aware list.
mwServiceAware
mwServiceAware_setAttributeBoolean
int mwServiceAware_setAttributeBoolean(struct mwServiceAware *srvc, guint32 key, gboolean val)
mwAwareList_watchAttributes
int mwAwareList_watchAttributes(struct mwAwareList *list, guint32 key,...)
watch a NULL terminated list of keys
mwSession
mwAwareList_getHandler
struct mwAwareListHandler * mwAwareList_getHandler(struct mwAwareList *list)
mwAttribute_AV_PREFS_SET
@ mwAttribute_AV_PREFS_SET
A/V prefs specified, gboolean.
Definition: mw_srvc_aware.h:81
mwAwareList_unwatchAttributeArray
int mwAwareList_unwatchAttributeArray(struct mwAwareList *list, guint32 *keys)
stop watching a NULL terminated array of keys
mwAwareAttribute_asOpaque
const struct mwOpaque * mwAwareAttribute_asOpaque(const struct mwAwareAttribute *attrib)
Direct access to an attribute's underlying opaque.
mwServiceAware_setStatus
void mwServiceAware_setStatus(struct mwServiceAware *srvc, struct mwAwareIdBlock *user, struct mwUserStatus *stat)
trigger a got_aware event constructed from the passed user and status information.
mwServiceAware_getAttribute
const struct mwAwareAttribute * mwServiceAware_getAttribute(struct mwServiceAware *srvc, struct mwAwareIdBlock *user, guint32 key)
look up the last known copy of an attribute for a user by the attribute's key
mwAwareListHandler::clear
void(* clear)(struct mwAwareList *list)
optional.
Definition: mw_srvc_aware.h:133
mwService::session
struct mwSession * session
session this service is attached to.
Definition: mw_service.h:139
mwAwareList_setClientData
void mwAwareList_setClientData(struct mwAwareList *list, gpointer data, GDestroyNotify cleanup)
mwServiceAware_unsetAttribute
int mwServiceAware_unsetAttribute(struct mwServiceAware *srvc, guint32 key)
Unset an attribute for this session.
mwAttribute_SPEAKERS
@ mwAttribute_SPEAKERS
has speakers, gboolean
Definition: mw_srvc_aware.h:83
mwAwareListHandler
Definition: mw_srvc_aware.h:125
mwAwareList_watchAttributeArray
int mwAwareList_watchAttributeArray(struct mwAwareList *list, guint32 *keys)
watch an NULL terminated array of keys
mwAwareList_removeClientData
void mwAwareList_removeClientData(struct mwAwareList *list)
mwAwareSnapshot::id
struct mwAwareIdBlock id
Definition: mw_common.h:206
mwAwareSnapshotHandler
void(* mwAwareSnapshotHandler)(struct mwAwareList *list, struct mwAwareSnapshot *id)
Appropriate function type for the on-aware signal.
Definition: mw_srvc_aware.h:107
mwOpaque
A length of binary data, not null-terminated.
Definition: mw_common.h:79
mwAwareAttribute
Definition: mw_srvc_aware.h:68
mwAwareAttribute_getKey
guint32 mwAwareAttribute_getKey(const struct mwAwareAttribute *attrib)
mwAwareAttributeHandler
void(* mwAwareAttributeHandler)(struct mwServiceAware *srvc, struct mwAwareAttribute *attrib)
Definition: mw_srvc_aware.h:90
mwAwareIdAttributeHandler
void(* mwAwareIdAttributeHandler)(struct mwAwareList *list, struct mwAwareIdBlock *id, struct mwAwareAttribute *attrib)
Appropriate function type for the on-option signal.
Definition: mw_srvc_aware.h:120
mwServiceAware_setAttributeString
int mwServiceAware_setAttributeString(struct mwServiceAware *srvc, guint32 key, const char *str)
mwAwareList_unwatchAttributes
int mwAwareList_unwatchAttributes(struct mwAwareList *list, guint32 key,...)
stop watching a NULL terminated list of keys
mwAwareList_getWatchedAttributes
guint32 * mwAwareList_getWatchedAttributes(struct mwAwareList *list)
mwAwareAttribute_asInteger
guint32 mwAwareAttribute_asInteger(const struct mwAwareAttribute *attrib)
mwAwareSnapshot
Definition: mw_common.h:205
mwAwareIdBlock
Definition: mw_common.h:196
mwAttribute_VIDEO_CAMERA
@ mwAttribute_VIDEO_CAMERA
has a video camera, gboolean
Definition: mw_srvc_aware.h:84