00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MW_SRVC_AWARE_H
00022 #define _MW_SRVC_AWARE_H
00023
00024
00025 #include "mw_common.h"
00026
00027
00041 #define mwService_AWARE 0x00000011
00042
00043
00051 struct mwServiceAware;
00052
00053
00063 struct mwAwareList;
00064
00065
00070 struct mwAwareAttribute;
00071
00072
00075 enum mwAwareAttributeKeys {
00076 mwAttribute_AV_PREFS_SET = 0x01,
00077 mwAttribute_MICROPHONE = 0x02,
00078 mwAttribute_SPEAKERS = 0x03,
00079 mwAttribute_VIDEO_CAMERA = 0x04,
00080 mwAttribute_FILE_TRANSFER = 0x06,
00081 };
00082
00083
00084 typedef void (*mwAwareAttributeHandler)
00085 (struct mwServiceAware *srvc,
00086 struct mwAwareAttribute *attrib);
00087
00088
00089 struct mwAwareHandler {
00090 mwAwareAttributeHandler on_attrib;
00091 void (*clear)(struct mwServiceAware *srvc);
00092 };
00093
00094
00101 typedef void (*mwAwareSnapshotHandler)
00102 (struct mwAwareList *list,
00103 struct mwAwareSnapshot *id);
00104
00105
00114 typedef void (*mwAwareIdAttributeHandler)
00115 (struct mwAwareList *list,
00116 struct mwAwareIdBlock *id,
00117 struct mwAwareAttribute *attrib);
00118
00119
00120 struct mwAwareListHandler {
00122 mwAwareSnapshotHandler on_aware;
00123
00125 mwAwareIdAttributeHandler on_attrib;
00126
00128 void (*clear)(struct mwAwareList *list);
00129 };
00130
00131
00132 struct mwServiceAware *
00133 mwServiceAware_new(struct mwSession *session,
00134 struct mwAwareHandler *handler);
00135
00136
00138 int mwServiceAware_setAttribute(struct mwServiceAware *srvc,
00139 guint32 key, struct mwOpaque *opaque);
00140
00141
00142 int mwServiceAware_setAttributeBoolean(struct mwServiceAware *srvc,
00143 guint32 key, gboolean val);
00144
00145
00146 int mwServiceAware_setAttributeInteger(struct mwServiceAware *srvc,
00147 guint32 key, guint32 val);
00148
00149
00150 int mwServiceAware_setAttributeString(struct mwServiceAware *srvc,
00151 guint32 key, const char *str);
00152
00153
00155 int mwServiceAware_unsetAttribute(struct mwServiceAware *srvc,
00156 guint32 key);
00157
00158
00159 guint32 mwAwareAttribute_getKey(const struct mwAwareAttribute *attrib);
00160
00161
00162 gboolean mwAwareAttribute_asBoolean(const struct mwAwareAttribute *attrib);
00163
00164
00165 guint32 mwAwareAttribute_asInteger(const struct mwAwareAttribute *attrib);
00166
00167
00170 char *mwAwareAttribute_asString(const struct mwAwareAttribute *attrib);
00171
00172
00174 const struct mwOpaque *
00175 mwAwareAttribute_asOpaque(const struct mwAwareAttribute *attrib);
00176
00177
00179 struct mwAwareList *
00180 mwAwareList_new(struct mwServiceAware *srvc,
00181 struct mwAwareListHandler *handler);
00182
00183
00185 void mwAwareList_free(struct mwAwareList *list);
00186
00187
00188 struct mwAwareListHandler *mwAwareList_getHandler(struct mwAwareList *list);
00189
00190
00196 int mwAwareList_addAware(struct mwAwareList *list, GList *id_list);
00197
00198
00204 int mwAwareList_removeAware(struct mwAwareList *list, GList *id_list);
00205
00206
00207 int mwAwareList_removeAllAware(struct mwAwareList *list);
00208
00209
00211 int mwAwareList_watchAttributeArray(struct mwAwareList *list,
00212 guint32 *keys);
00213
00214
00216 int mwAwareList_watchAttributes(struct mwAwareList *list,
00217 guint32 key, ...);
00218
00219
00221 int mwAwareList_unwatchAttributeArray(struct mwAwareList *list,
00222 guint32 *keys);
00223
00224
00226 int mwAwareList_unwatchAttributes(struct mwAwareList *list,
00227 guint32 key, ...);
00228
00229
00231 int mwAwareList_unwatchAllAttributes(struct mwAwareList *list);
00232
00233
00234 guint32 *mwAwareList_getWatchedAttributes(struct mwAwareList *list);
00235
00236
00237 void mwAwareList_setClientData(struct mwAwareList *list,
00238 gpointer data, GDestroyNotify cleanup);
00239
00240
00241 void mwAwareList_removeClientData(struct mwAwareList *list);
00242
00243
00244 gpointer mwAwareList_getClientData(struct mwAwareList *list);
00245
00246
00250 void mwServiceAware_setStatus(struct mwServiceAware *srvc,
00251 struct mwAwareIdBlock *user,
00252 struct mwUserStatus *stat);
00253
00254
00256 const char *mwServiceAware_getText(struct mwServiceAware *srvc,
00257 struct mwAwareIdBlock *user);
00258
00259
00262 const struct mwAwareAttribute *
00263 mwServiceAware_getAttribute(struct mwServiceAware *srvc,
00264 struct mwAwareIdBlock *user,
00265 guint32 key);
00266
00267
00268 #endif
00269
00270