meanwhile 1.1.0
|
00001 00002 /* 00003 Meanwhile - Unofficial Lotus Sametime Community Client Library 00004 Copyright (C) 2004 Christopher (siege) O'Brien 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the Free 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 #ifndef _MW_SRVC_AWARE_H 00022 #define _MW_SRVC_AWARE_H 00023 00024 00037 #include "mw_common.h" 00038 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 00046 #define mwService_AWARE 0x00000011 00047 00048 00056 struct mwServiceAware; 00057 00058 00068 struct mwAwareList; 00069 00070 00075 struct mwAwareAttribute; 00076 00077 00080 enum mwAwareAttributeKeys { 00081 mwAttribute_AV_PREFS_SET = 0x01, 00082 mwAttribute_MICROPHONE = 0x02, 00083 mwAttribute_SPEAKERS = 0x03, 00084 mwAttribute_VIDEO_CAMERA = 0x04, 00085 mwAttribute_FILE_TRANSFER = 0x06, 00086 }; 00087 00088 00089 typedef void (*mwAwareAttributeHandler) 00090 (struct mwServiceAware *srvc, 00091 struct mwAwareAttribute *attrib); 00092 00093 00094 struct mwAwareHandler { 00095 mwAwareAttributeHandler on_attrib; 00096 void (*clear)(struct mwServiceAware *srvc); 00097 }; 00098 00099 00106 typedef void (*mwAwareSnapshotHandler) 00107 (struct mwAwareList *list, 00108 struct mwAwareSnapshot *id); 00109 00110 00119 typedef void (*mwAwareIdAttributeHandler) 00120 (struct mwAwareList *list, 00121 struct mwAwareIdBlock *id, 00122 struct mwAwareAttribute *attrib); 00123 00124 00125 struct mwAwareListHandler { 00127 mwAwareSnapshotHandler on_aware; 00128 00130 mwAwareIdAttributeHandler on_attrib; 00131 00133 void (*clear)(struct mwAwareList *list); 00134 }; 00135 00136 00137 struct mwServiceAware * 00138 mwServiceAware_new(struct mwSession *session, 00139 struct mwAwareHandler *handler); 00140 00141 00143 int mwServiceAware_setAttribute(struct mwServiceAware *srvc, 00144 guint32 key, struct mwOpaque *opaque); 00145 00146 00147 int mwServiceAware_setAttributeBoolean(struct mwServiceAware *srvc, 00148 guint32 key, gboolean val); 00149 00150 00151 int mwServiceAware_setAttributeInteger(struct mwServiceAware *srvc, 00152 guint32 key, guint32 val); 00153 00154 00155 int mwServiceAware_setAttributeString(struct mwServiceAware *srvc, 00156 guint32 key, const char *str); 00157 00158 00160 int mwServiceAware_unsetAttribute(struct mwServiceAware *srvc, 00161 guint32 key); 00162 00163 00164 guint32 mwAwareAttribute_getKey(const struct mwAwareAttribute *attrib); 00165 00166 00167 gboolean mwAwareAttribute_asBoolean(const struct mwAwareAttribute *attrib); 00168 00169 00170 guint32 mwAwareAttribute_asInteger(const struct mwAwareAttribute *attrib); 00171 00172 00175 char *mwAwareAttribute_asString(const struct mwAwareAttribute *attrib); 00176 00177 00179 const struct mwOpaque * 00180 mwAwareAttribute_asOpaque(const struct mwAwareAttribute *attrib); 00181 00182 00184 struct mwAwareList * 00185 mwAwareList_new(struct mwServiceAware *srvc, 00186 struct mwAwareListHandler *handler); 00187 00188 00190 void mwAwareList_free(struct mwAwareList *list); 00191 00192 00193 struct mwAwareListHandler *mwAwareList_getHandler(struct mwAwareList *list); 00194 00195 00201 int mwAwareList_addAware(struct mwAwareList *list, GList *id_list); 00202 00203 00209 int mwAwareList_removeAware(struct mwAwareList *list, GList *id_list); 00210 00211 00212 int mwAwareList_removeAllAware(struct mwAwareList *list); 00213 00214 00216 int mwAwareList_watchAttributeArray(struct mwAwareList *list, 00217 guint32 *keys); 00218 00219 00221 int mwAwareList_watchAttributes(struct mwAwareList *list, 00222 guint32 key, ...); 00223 00224 00226 int mwAwareList_unwatchAttributeArray(struct mwAwareList *list, 00227 guint32 *keys); 00228 00229 00231 int mwAwareList_unwatchAttributes(struct mwAwareList *list, 00232 guint32 key, ...); 00233 00234 00236 int mwAwareList_unwatchAllAttributes(struct mwAwareList *list); 00237 00238 00239 guint32 *mwAwareList_getWatchedAttributes(struct mwAwareList *list); 00240 00241 00242 void mwAwareList_setClientData(struct mwAwareList *list, 00243 gpointer data, GDestroyNotify cleanup); 00244 00245 00246 void mwAwareList_removeClientData(struct mwAwareList *list); 00247 00248 00249 gpointer mwAwareList_getClientData(struct mwAwareList *list); 00250 00251 00255 void mwServiceAware_setStatus(struct mwServiceAware *srvc, 00256 struct mwAwareIdBlock *user, 00257 struct mwUserStatus *stat); 00258 00259 00261 const char *mwServiceAware_getText(struct mwServiceAware *srvc, 00262 struct mwAwareIdBlock *user); 00263 00264 00267 const struct mwAwareAttribute * 00268 mwServiceAware_getAttribute(struct mwServiceAware *srvc, 00269 struct mwAwareIdBlock *user, 00270 guint32 key); 00271 00272 00273 #ifdef __cplusplus 00274 } 00275 #endif 00276 00277 00278 #endif /* _MW_SRVC_AWARE_H */ 00279