00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MW_SRVC_CONF_H
00022 #define _MW_SRVC_CONF_H
00023
00024
00025 #include <glib/glist.h>
00026 #include "mw_common.h"
00027
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00035 #define mwService_CONFERENCE 0x80000010
00036
00037
00038 enum mwConferenceState {
00039 mwConference_NEW,
00040 mwConference_PENDING,
00041 mwConference_INVITED,
00042 mwConference_OPEN,
00043 mwConference_CLOSING,
00044 mwConference_ERROR,
00045 mwConference_UNKNOWN,
00046 };
00047
00048
00051 struct mwServiceConference;
00052
00053
00056 struct mwConference;
00057
00058
00061 struct mwConferenceHandler {
00062
00071 void (*on_invited)(struct mwConference *conf,
00072 struct mwLoginInfo *inviter, const char *invite);
00073
00080 void (*conf_opened)(struct mwConference *conf, GList *members);
00081
00084 void (*conf_closed)(struct mwConference *, guint32 reason);
00085
00087 void (*on_peer_joined)(struct mwConference *, struct mwLoginInfo *);
00088
00090 void (*on_peer_parted)(struct mwConference *, struct mwLoginInfo *);
00091
00093 void (*on_text)(struct mwConference *conf,
00094 struct mwLoginInfo *who, const char *what);
00095
00097 void (*on_typing)(struct mwConference *conf,
00098 struct mwLoginInfo *who, gboolean typing);
00099
00101 void (*clear)(struct mwServiceConference *srvc);
00102 };
00103
00104
00109 struct mwServiceConference *
00110 mwServiceConference_new(struct mwSession *sess,
00111 struct mwConferenceHandler *handler);
00112
00113
00115 struct mwConferenceHandler *
00116 mwServiceConference_getHandler(struct mwServiceConference *srvc);
00117
00118
00121 GList *mwServiceConference_getConferences(struct mwServiceConference *srvc);
00122
00123
00126 struct mwConference *mwConference_new(struct mwServiceConference *srvc,
00127 const char *title);
00128
00129
00131 struct mwServiceConference *mwConference_getService(struct mwConference *conf);
00132
00133
00135 const char *mwConference_getName(struct mwConference *conf);
00136
00137
00139 const char *mwConference_getTitle(struct mwConference *conf);
00140
00141
00144 GList *mwConference_getMembers(struct mwConference *conf);
00145
00146
00150 int mwConference_open(struct mwConference *conf);
00151
00152
00157 int mwConference_destroy(struct mwConference *conf,
00158 guint32 reason, const char *text);
00159
00160
00161 #define mwConference_reject(c,r,t) \
00162 mwConference_destroy((c),(r),(t))
00163
00164
00167 int mwConference_accept(struct mwConference *conf);
00168
00169
00175 int mwConference_invite(struct mwConference *conf,
00176 struct mwIdBlock *who, const char *text);
00177
00178
00180 int mwConference_sendText(struct mwConference *conf, const char *text);
00181
00182
00184 int mwConference_sendTyping(struct mwConference *conf, gboolean typing);
00185
00186
00190 void mwConference_setClientData(struct mwConference *conf,
00191 gpointer data, GDestroyNotify clear);
00192
00193
00195 gpointer mwConference_getClientData(struct mwConference *conf);
00196
00197
00200 void mwConference_removeClientData(struct mwConference *conf);
00201
00202
00203 #ifdef __cplusplus
00204 }
00205 #endif
00206
00207
00208 #endif
00209