mw_st_list.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_ST_LIST_H
#define _MW_ST_LIST_H
#include <glib.h>
#include "mw_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ST_LIST_MAJOR 3
#define ST_LIST_MINOR 1
#define ST_LIST_MICRO 3
enum mwSametimeGroupType {
mwSametimeGroup_NORMAL = 1,
mwSametimeGroup_DYNAMIC = 2,
mwSametimeGroup_UNKNOWN = 0,
};
enum mwSametimeUserType {
mwSametimeUser_NORMAL = 1,
mwSametimeUser_EXTERNAL = 2,
mwSametimeUser_UNKNOWN = 0,
};
struct mwSametimeList;
struct mwSametimeGroup;
struct mwSametimeUser;
struct mwSametimeList *mwSametimeList_new(void);
void mwSametimeList_free(struct mwSametimeList *l);
void mwSametimeList_get(struct mwGetBuffer *b, struct mwSametimeList *l);
void mwSametimeList_put(struct mwPutBuffer *b, struct mwSametimeList *l);
struct mwSametimeList *mwSametimeList_load(const char *str);
char *mwSametimeList_store(struct mwSametimeList *l);
void mwSametimeList_setMajor(struct mwSametimeList *l, guint v);
guint mwSametimeList_getMajor(struct mwSametimeList *l);
void mwSametimeList_setMinor(struct mwSametimeList *l, guint v);
guint mwSametimeList_getMinor(struct mwSametimeList *l);
void mwSametimeList_setMicro(struct mwSametimeList *l, guint v);
guint mwSametimeList_getMicro(struct mwSametimeList *l);
GList *mwSametimeList_getGroups(struct mwSametimeList *l);
struct mwSametimeGroup *
mwSametimeList_findGroup(struct mwSametimeList *l,
const char *name);
struct mwSametimeGroup *
mwSametimeGroup_new(struct mwSametimeList *l,
enum mwSametimeGroupType type,
const char *name);
void mwSametimeGroup_free(struct mwSametimeGroup *g);
enum mwSametimeGroupType mwSametimeGroup_getType(struct mwSametimeGroup *g);
const char *mwSametimeGroup_getName(struct mwSametimeGroup *g);
void mwSametimeGroup_setAlias(struct mwSametimeGroup *g,
const char *alias);
const char *mwSametimeGroup_getAlias(struct mwSametimeGroup *g);
void mwSametimeGroup_setOpen(struct mwSametimeGroup *g, gboolean open);
gboolean mwSametimeGroup_isOpen(struct mwSametimeGroup *g);
struct mwSametimeList *mwSametimeGroup_getList(struct mwSametimeGroup *g);
GList *mwSametimeGroup_getUsers(struct mwSametimeGroup *g);
struct mwSametimeUser *
mwSametimeGroup_findUser(struct mwSametimeGroup *g,
struct mwIdBlock *user);
struct mwSametimeUser *
mwSametimeUser_new(struct mwSametimeGroup *g,
enum mwSametimeUserType type,
struct mwIdBlock *user);
void mwSametimeUser_free(struct mwSametimeUser *u);
struct mwSametimeGroup *mwSametimeUser_getGroup(struct mwSametimeUser *u);
enum mwSametimeUserType mwSametimeUser_getType(struct mwSametimeUser *u);
const char *mwSametimeUser_getUser(struct mwSametimeUser *u);
const char *mwSametimeUser_getCommunity(struct mwSametimeUser *u);
void mwSametimeUser_setShortName(struct mwSametimeUser *u, const char *name);
const char *mwSametimeUser_getShortName(struct mwSametimeUser *u);
void mwSametimeUser_setAlias(struct mwSametimeUser *u, const char *alias);
const char *mwSametimeUser_getAlias(struct mwSametimeUser *u);
#ifdef __cplusplus
}
#endif
#endif /* _MW_ST_LIST_H */
mw_common.h
Common data types and functions for handling those types.
mwSametimeGroup_getName
const char * mwSametimeGroup_getName(struct mwSametimeGroup *g)
mwSametimeUser_setShortName
void mwSametimeUser_setShortName(struct mwSametimeUser *u, const char *name)
mwSametimeList_put
void mwSametimeList_put(struct mwPutBuffer *b, struct mwSametimeList *l)
Write a sametime list onto a buffer.
mwSametimeGroup_getType
enum mwSametimeGroupType mwSametimeGroup_getType(struct mwSametimeGroup *g)
mwSametimeGroup_new
struct mwSametimeGroup * mwSametimeGroup_new(struct mwSametimeList *l, enum mwSametimeGroupType type, const char *name)
Create a new group in a list.
mwSametimeList_free
void mwSametimeList_free(struct mwSametimeList *l)
Free the list, all of its groups, and all of the groups' members.
mwSametimeGroup_free
void mwSametimeGroup_free(struct mwSametimeGroup *g)
Remove a group from its list, and free it.
mwSametimeList_getMajor
guint mwSametimeList_getMajor(struct mwSametimeList *l)
mwSametimeUser_free
void mwSametimeUser_free(struct mwSametimeUser *u)
Remove user from its group, and free it.
mwSametimeGroup_getAlias
const char * mwSametimeGroup_getAlias(struct mwSametimeGroup *g)
mwSametimeUser_getType
enum mwSametimeUserType mwSametimeUser_getType(struct mwSametimeUser *u)
mwSametimeList_load
struct mwSametimeList * mwSametimeList_load(const char *str)
convert a plain string into a sametime list
mwSametimeList_getGroups
GList * mwSametimeList_getGroups(struct mwSametimeList *l)
Get a GList snapshot of the groups in a list.
mwSametimeGroup_setAlias
void mwSametimeGroup_setAlias(struct mwSametimeGroup *g, const char *alias)
mwSametimeList_getMicro
guint mwSametimeList_getMicro(struct mwSametimeList *l)
mwSametimeUser_getGroup
struct mwSametimeGroup * mwSametimeUser_getGroup(struct mwSametimeUser *u)
mwSametimeGroup_getList
struct mwSametimeList * mwSametimeGroup_getList(struct mwSametimeGroup *g)
mwSametimeList_findGroup
struct mwSametimeGroup * mwSametimeList_findGroup(struct mwSametimeList *l, const char *name)
mwSametimeGroup_findUser
struct mwSametimeUser * mwSametimeGroup_findUser(struct mwSametimeGroup *g, struct mwIdBlock *user)
mwSametimeList_setMinor
void mwSametimeList_setMinor(struct mwSametimeList *l, guint v)
mwSametimeList_get
void mwSametimeList_get(struct mwGetBuffer *b, struct mwSametimeList *l)
Load a sametime list from a buffer.
mwSametimeList_getMinor
guint mwSametimeList_getMinor(struct mwSametimeList *l)
mwSametimeList_setMicro
void mwSametimeList_setMicro(struct mwSametimeList *l, guint v)
mwSametimeList_setMajor
void mwSametimeList_setMajor(struct mwSametimeList *l, guint v)
mwSametimeGroup_setOpen
void mwSametimeGroup_setOpen(struct mwSametimeGroup *g, gboolean open)
mwSametimeGroup_getUsers
GList * mwSametimeGroup_getUsers(struct mwSametimeGroup *g)
Get a GList snapshot of the users in a list.
mwSametimeUser_getUser
const char * mwSametimeUser_getUser(struct mwSametimeUser *u)
mwSametimeUser_getCommunity
const char * mwSametimeUser_getCommunity(struct mwSametimeUser *u)
mwSametimeUser_getAlias
const char * mwSametimeUser_getAlias(struct mwSametimeUser *u)
mwSametimeList_store
char * mwSametimeList_store(struct mwSametimeList *l)
convert a sametime list into a string
mwSametimeGroupType
mwSametimeGroupType
Definition mw_st_list.h:46
mwSametimeGroup_NORMAL
@ mwSametimeGroup_NORMAL
a normal group of users
Definition mw_st_list.h:47
mwSametimeGroup_UNKNOWN
@ mwSametimeGroup_UNKNOWN
error determining group type
Definition mw_st_list.h:49
mwSametimeGroup_DYNAMIC
@ mwSametimeGroup_DYNAMIC
a server-side group
Definition mw_st_list.h:48
mwSametimeUserType
mwSametimeUserType
Definition mw_st_list.h:53
mwSametimeUser_EXTERNAL
@ mwSametimeUser_EXTERNAL
external user
Definition mw_st_list.h:55
mwSametimeUser_NORMAL
@ mwSametimeUser_NORMAL
user on same community
Definition mw_st_list.h:54
mwSametimeUser_UNKNOWN
@ mwSametimeUser_UNKNOWN
error determining user type
Definition mw_st_list.h:56
mwSametimeUser_setAlias
void mwSametimeUser_setAlias(struct mwSametimeUser *u, const char *alias)
mwSametimeUser_getShortName
const char * mwSametimeUser_getShortName(struct mwSametimeUser *u)
mwSametimeGroup_isOpen
gboolean mwSametimeGroup_isOpen(struct mwSametimeGroup *g)
mwSametimeList_new
struct mwSametimeList * mwSametimeList_new(void)
Create a new list.
mwSametimeUser_new
struct mwSametimeUser * mwSametimeUser_new(struct mwSametimeGroup *g, enum mwSametimeUserType type, struct mwIdBlock *user)
Create a user in a group.
mwGetBuffer
buffer to be read from
mwIdBlock
Definition mw_common.h:178
mwPutBuffer
buffer to be written to
mwSametimeGroup
Represents a group in a buddy list.
mwSametimeList
Represents a group-based buddy list.
mwSametimeUser
Represents a user in a group in a buddy list.