mw_srvc_aware.h
Go to the documentation of this file.
/*
Meanwhile - Unofficial Lotus Sametime Community Client Library
Copyright (C) 2004 Christopher (siege) O'Brien
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _MW_SRVC_AWARE_H
#define _MW_SRVC_AWARE_H
#include "mw_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mwService_AWARE 0x00000011
struct mwServiceAware;
struct mwAwareList;
struct mwAwareAttribute;
enum mwAwareAttributeKeys {
mwAttribute_AV_PREFS_SET = 0x01,
mwAttribute_MICROPHONE = 0x02,
mwAttribute_SPEAKERS = 0x03,
mwAttribute_VIDEO_CAMERA = 0x04,
mwAttribute_FILE_TRANSFER = 0x06,
};
typedef void (*mwAwareAttributeHandler)
(struct mwServiceAware *srvc,
struct mwAwareAttribute *attrib);
struct mwAwareHandler {
mwAwareAttributeHandler on_attrib;
void (*clear)(struct mwServiceAware *srvc);
};
typedef void (*mwAwareSnapshotHandler)
(struct mwAwareList *list,
struct mwAwareSnapshot *id);
typedef void (*mwAwareIdAttributeHandler)
(struct mwAwareList *list,
struct mwAwareIdBlock *id,
struct mwAwareAttribute *attrib);
struct mwAwareListHandler {
mwAwareSnapshotHandler on_aware;
mwAwareIdAttributeHandler on_attrib;
void (*clear)(struct mwAwareList *list);
};
struct mwServiceAware *
mwServiceAware_new(struct mwSession *session,
struct mwAwareHandler *handler);
int mwServiceAware_setAttribute(struct mwServiceAware *srvc,
guint32 key, struct mwOpaque *opaque);
int mwServiceAware_setAttributeBoolean(struct mwServiceAware *srvc,
guint32 key, gboolean val);
int mwServiceAware_setAttributeInteger(struct mwServiceAware *srvc,
guint32 key, guint32 val);
int mwServiceAware_setAttributeString(struct mwServiceAware *srvc,
guint32 key, const char *str);
int mwServiceAware_unsetAttribute(struct mwServiceAware *srvc,
guint32 key);
guint32 mwAwareAttribute_getKey(const struct mwAwareAttribute *attrib);
gboolean mwAwareAttribute_asBoolean(const struct mwAwareAttribute *attrib);
guint32 mwAwareAttribute_asInteger(const struct mwAwareAttribute *attrib);
char *mwAwareAttribute_asString(const struct mwAwareAttribute *attrib);
const struct mwOpaque *
mwAwareAttribute_asOpaque(const struct mwAwareAttribute *attrib);
struct mwAwareList *
mwAwareList_new(struct mwServiceAware *srvc,
struct mwAwareListHandler *handler);
void mwAwareList_free(struct mwAwareList *list);
struct mwAwareListHandler *mwAwareList_getHandler(struct mwAwareList *list);
int mwAwareList_addAware(struct mwAwareList *list, GList *id_list);
int mwAwareList_removeAware(struct mwAwareList *list, GList *id_list);
int mwAwareList_removeAllAware(struct mwAwareList *list);
int mwAwareList_watchAttributeArray(struct mwAwareList *list,
guint32 *keys);
int mwAwareList_watchAttributes(struct mwAwareList *list,
guint32 key, ...);
int mwAwareList_unwatchAttributeArray(struct mwAwareList *list,
guint32 *keys);
int mwAwareList_unwatchAttributes(struct mwAwareList *list,
guint32 key, ...);
int mwAwareList_unwatchAllAttributes(struct mwAwareList *list);
guint32 *mwAwareList_getWatchedAttributes(struct mwAwareList *list);
void mwAwareList_setClientData(struct mwAwareList *list,
gpointer data, GDestroyNotify cleanup);
void mwAwareList_removeClientData(struct mwAwareList *list);
gpointer mwAwareList_getClientData(struct mwAwareList *list);
void mwServiceAware_setStatus(struct mwServiceAware *srvc,
struct mwAwareIdBlock *user,
struct mwUserStatus *stat);
const char *mwServiceAware_getText(struct mwServiceAware *srvc,
struct mwAwareIdBlock *user);
const struct mwAwareAttribute *
mwServiceAware_getAttribute(struct mwServiceAware *srvc,
struct mwAwareIdBlock *user,
guint32 key);
#ifdef __cplusplus
}
#endif
#endif /* _MW_SRVC_AWARE_H */
mw_common.h
Common data types and functions for handling those types.
mwAwareList_unwatchAttributeArray
int mwAwareList_unwatchAttributeArray(struct mwAwareList *list, guint32 *keys)
stop watching a NULL terminated array of keys
mwAwareList_watchAttributes
int mwAwareList_watchAttributes(struct mwAwareList *list, guint32 key,...)
watch a NULL terminated list of keys
mwAwareAttribute_asInteger
guint32 mwAwareAttribute_asInteger(const struct mwAwareAttribute *attrib)
mwAwareList_removeAware
int mwAwareList_removeAware(struct mwAwareList *list, GList *id_list)
Remove a collection of user IDs from an aware list.
mwAwareList_setClientData
void mwAwareList_setClientData(struct mwAwareList *list, gpointer data, GDestroyNotify cleanup)
mwAwareSnapshotHandler
void(* mwAwareSnapshotHandler)(struct mwAwareList *list, struct mwAwareSnapshot *id)
Appropriate function type for the on-aware signal.
Definition mw_srvc_aware.h:107
mwAwareList_unwatchAllAttributes
int mwAwareList_unwatchAllAttributes(struct mwAwareList *list)
remove all watched attributes
mwAwareList_getWatchedAttributes
guint32 * mwAwareList_getWatchedAttributes(struct mwAwareList *list)
mwAwareList_watchAttributeArray
int mwAwareList_watchAttributeArray(struct mwAwareList *list, guint32 *keys)
watch an NULL terminated array of keys
mwAwareList_free
void mwAwareList_free(struct mwAwareList *list)
Clean and free an aware list.
mwServiceAware_new
struct mwServiceAware * mwServiceAware_new(struct mwSession *session, struct mwAwareHandler *handler)
mwServiceAware_getText
const char * mwServiceAware_getText(struct mwServiceAware *srvc, struct mwAwareIdBlock *user)
look up the status description for a user
mwServiceAware_unsetAttribute
int mwServiceAware_unsetAttribute(struct mwServiceAware *srvc, guint32 key)
Unset an attribute for this session.
mwServiceAware_setAttributeBoolean
int mwServiceAware_setAttributeBoolean(struct mwServiceAware *srvc, guint32 key, gboolean val)
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.
mwAwareAttribute_getKey
guint32 mwAwareAttribute_getKey(const struct mwAwareAttribute *attrib)
mwAwareList_addAware
int mwAwareList_addAware(struct mwAwareList *list, GList *id_list)
Add a collection of user IDs to an aware list.
mwServiceAware_setAttributeInteger
int mwServiceAware_setAttributeInteger(struct mwServiceAware *srvc, guint32 key, guint32 val)
mwAwareList_unwatchAttributes
int mwAwareList_unwatchAttributes(struct mwAwareList *list, guint32 key,...)
stop watching a NULL terminated list of keys
mwServiceAware_setAttribute
int mwServiceAware_setAttribute(struct mwServiceAware *srvc, guint32 key, struct mwOpaque *opaque)
Set an attribute value for this session.
mwAwareList_new
struct mwAwareList * mwAwareList_new(struct mwServiceAware *srvc, struct mwAwareListHandler *handler)
Allocate and initialize an aware list.
mwAwareAttribute_asString
char * mwAwareAttribute_asString(const struct mwAwareAttribute *attrib)
Copy of attribute string, must be g_free'd.
mwAwareAttributeHandler
void(* mwAwareAttributeHandler)(struct mwServiceAware *srvc, struct mwAwareAttribute *attrib)
Definition mw_srvc_aware.h:90
mwAwareList_removeClientData
void mwAwareList_removeClientData(struct mwAwareList *list)
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
mwAwareList_getClientData
gpointer mwAwareList_getClientData(struct mwAwareList *list)
mwServiceAware_setAttributeString
int mwServiceAware_setAttributeString(struct mwServiceAware *srvc, guint32 key, const char *str)
mwAwareAttributeKeys
mwAwareAttributeKeys
Predefined keys appropriate for a mwAwareAttribute.
Definition mw_srvc_aware.h:80
mwAttribute_FILE_TRANSFER
@ mwAttribute_FILE_TRANSFER
supports file transfers, gboolean
Definition mw_srvc_aware.h:85
mwAttribute_AV_PREFS_SET
@ mwAttribute_AV_PREFS_SET
A/V prefs specified, gboolean.
Definition mw_srvc_aware.h:81
mwAttribute_SPEAKERS
@ mwAttribute_SPEAKERS
has speakers, gboolean
Definition mw_srvc_aware.h:83
mwAttribute_VIDEO_CAMERA
@ mwAttribute_VIDEO_CAMERA
has a video camera, gboolean
Definition mw_srvc_aware.h:84
mwAttribute_MICROPHONE
@ mwAttribute_MICROPHONE
has a microphone, gboolean
Definition mw_srvc_aware.h:82
mwAwareList_getHandler
struct mwAwareListHandler * mwAwareList_getHandler(struct mwAwareList *list)
mwAwareAttribute_asBoolean
gboolean mwAwareAttribute_asBoolean(const struct mwAwareAttribute *attrib)
mwAwareList_removeAllAware
int mwAwareList_removeAllAware(struct mwAwareList *list)
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
mwAwareAttribute
Key/Opaque pair indicating an identity's attribute.
mwAwareHandler
Definition mw_srvc_aware.h:94
mwAwareHandler::on_attrib
mwAwareAttributeHandler on_attrib
Definition mw_srvc_aware.h:95
mwAwareHandler::clear
void(* clear)(struct mwServiceAware *srvc)
Definition mw_srvc_aware.h:96
mwAwareIdBlock
Definition mw_common.h:200
mwAwareListHandler
Definition mw_srvc_aware.h:125
mwAwareListHandler::on_aware
mwAwareSnapshotHandler on_aware
handle aware updates
Definition mw_srvc_aware.h:127
mwAwareListHandler::clear
void(* clear)(struct mwAwareList *list)
optional.
Definition mw_srvc_aware.h:133
mwAwareListHandler::on_attrib
mwAwareIdAttributeHandler on_attrib
handle attribute updates
Definition mw_srvc_aware.h:130
mwAwareList
Instance of an Aware List.
mwAwareSnapshot
Definition mw_common.h:209
mwAwareSnapshot::id
struct mwAwareIdBlock id
Definition mw_common.h:210
mwOpaque
A length of binary data, not null-terminated.
Definition mw_common.h:79
mwServiceAware
Instance of an Aware Service.
mwSession
Represents a Sametime client session.
mwUserStatus
Definition mw_common.h:169