00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MW_SRVC_PLACE_H
00022 #define _MW_SRVC_PLACE_H
00023
00024
00025 #include <glib/glist.h>
00026 #include "mw_common.h"
00027
00028
00030 #define mwService_PLACE 0x80000022
00031
00032
00034 struct mwServicePlace;
00035
00036
00038 struct mwPlace;
00039
00040
00041 struct mwPlaceHandler {
00042 void (*opened)(struct mwPlace *place);
00043 void (*closed)(struct mwPlace *place, guint32 code);
00044
00045 void (*peerJoined)(struct mwPlace *place,
00046 const struct mwIdBlock *peer);
00047
00048 void (*peerParted)(struct mwPlace *place,
00049 const struct mwIdBlock *peer);
00050
00051 void (*peerSetAttribute)(struct mwPlace *place,
00052 const struct mwIdBlock *peer,
00053 guint32 attr, struct mwOpaque *o);
00054
00055 void (*peerUnsetAttribute)(struct mwPlace *place,
00056 const struct mwIdBlock *peer,
00057 guint32 attr);
00058
00059 void (*message)(struct mwPlace *place,
00060 const struct mwIdBlock *who,
00061 const char *msg);
00062
00063 void (*clear)(struct mwServicePlace *srvc);
00064 };
00065
00066
00067 enum mwPlacePeerAttribute {
00068 mwPlacePeer_TYPING = 0x00000008,
00069 };
00070
00071
00072 struct mwServicePlace *
00073 mwServicePlace_new(struct mwSession *session,
00074 struct mwPlaceHandler *handler);
00075
00076
00077 struct mwPlaceHandler *
00078 mwServicePlace_getHandler(struct mwServicePlace *srvc);
00079
00080
00081 const GList *mwServicePlace_getPlaces(struct mwServicePlace *srvc);
00082
00083
00084 struct mwPlace *mwPlace_new(struct mwServicePlace *srvc,
00085 const char *name, const char *title);
00086
00087
00088 struct mwServicePlace *mwPlace_getService(struct mwPlace *place);
00089
00090
00091 const char *mwPlace_getName(struct mwPlace *place);
00092
00093
00094 const char *mwPlace_getTitle(struct mwPlace *place);
00095
00096
00097 int mwPlace_open(struct mwPlace *place);
00098
00099
00100 int mwPlace_destroy(struct mwPlace *place, guint32 code);
00101
00102
00106 GList *mwPlace_getMembers(struct mwPlace *place);
00107
00108
00109 int mwPlace_sendText(struct mwPlace *place, const char *msg);
00110
00111
00112 int mwPlace_setAttribute(struct mwPlace *place, guint32 attrib,
00113 struct mwOpaque *data);
00114
00115
00116 int mwPlace_unsetAttribute(struct mwPlace *place, guint32 attrib);
00117
00118
00119 void mwPlace_setClientData(struct mwPlace *place,
00120 gpointer data, GDestroyNotify clean);
00121
00122
00123 gpointer mwPlace_getClientData(struct mwPlace *place);
00124
00125
00126 void mwPlace_removeClientData(struct mwPlace *place);
00127
00128
00129 #endif