Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

mw_srvc_store.h

Go to the documentation of this file.
00001 
00002 /*
00003   Meanwhile - Unofficial Lotus Sametime Community Client Library
00004   Copyright (C) 2004  Christopher (siege) O'Brien
00005   
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010   
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015   
00016   You should have received a copy of the GNU Library General Public
00017   License along with this library; if not, write to the Free
00018   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 */
00020 
00021 #ifndef _MW_SRVC_STORE_H
00022 #define _MW_SRVC_STORE_H
00023 
00024 
00025 #include <glib.h>
00026 #include "mw_common.h"
00027 
00028 
00030 #define mwService_STORAGE  0x00000018
00031 
00032 
00037 struct mwServiceStorage;
00038 
00039 
00044 struct mwStorageUnit;
00045 
00046 
00048 #define LOTUS_RESERVED_LIMIT  0x186a0
00049 
00050 
00052 #define KEY_IS_LOTUS_RESERVED(key) \
00053   (((guint32) key) <= (LOTUS_RESERVED_LIMIT))
00054 
00055 
00059 enum mwStorageKey {
00060 
00062   mwStore_AWARE_LIST      = 0x00000000,
00063 
00065   mwStore_INVITE_CHAT     = 0x00000006,
00066 
00068   mwStore_INVITE_MEETING  = 0x0000000e,
00069 
00071   mwStore_AWAY_MESSAGES   = 0x00000050,
00072 
00074   mwStore_BUSY_MESSAGES   = 0x0000005a,
00075 
00077   mwStore_ACTIVE_MESSAGES = 0x00000064,
00078 };
00079 
00080 
00087 typedef void (*mwStorageCallback)
00088      (struct mwServiceStorage *srvc,
00089       guint32 result, struct mwStorageUnit *item,
00090       gpointer data);
00091 
00092 
00095 struct mwServiceStorage *mwServiceStorage_new(struct mwSession *);
00096 
00097 
00099 struct mwStorageUnit *mwStorageUnit_new(guint32 key);
00100 
00101 
00103 struct mwStorageUnit *mwStorageUnit_newOpaque(guint32 key,
00104                                               struct mwOpaque *data);
00105 
00106 
00109 struct mwStorageUnit *mwStorageUnit_newBoolean(guint32 key,
00110                                                gboolean val);
00111 
00112 
00113 struct mwStorageUnit *mwStorageUnit_newInteger(guint32 key,
00114                                                guint32 val);
00115 
00116 
00119 struct mwStorageUnit *mwStorageUnit_newString(guint32 key,
00120                                               const char *str);
00121 
00122 
00124 guint32 mwStorageUnit_getKey(struct mwStorageUnit *);
00125 
00126 
00130 gboolean mwStorageUnit_asBoolean(struct mwStorageUnit *, gboolean val);
00131 
00132 
00136 guint32 mwStorageUnit_asInteger(struct mwStorageUnit *, guint32 val);
00137 
00138 
00143 char *mwStorageUnit_asString(struct mwStorageUnit *);
00144 
00145 
00147 struct mwOpaque *mwStorageUnit_asOpaque(struct mwStorageUnit *);
00148 
00149 
00151 void mwStorageUnit_free(struct mwStorageUnit *);
00152 
00153       
00164 void mwServiceStorage_load(struct mwServiceStorage *srvc,
00165                            struct mwStorageUnit *item,
00166                            mwStorageCallback cb,
00167                            gpointer data, GDestroyNotify data_free);
00168 
00169 
00180 void mwServiceStorage_save(struct mwServiceStorage *srvc,
00181                            struct mwStorageUnit *item,
00182                            mwStorageCallback cb,
00183                            gpointer data, GDestroyNotify data_free);
00184 
00185 
00186 #endif

Generated on Tue May 30 11:20:14 2006 for meanwhile by  doxygen 1.3.9.1