00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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