00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _MW_SRVC_RESOLVE_H
00022 #define _MW_SRVC_RESOLVE_H
00023
00024
00025 #include <glib.h>
00026 #include <glib/glist.h>
00027
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033
00035 #define mwService_RESOLVE 0x00000015
00036
00037
00039 #define SEARCH_ERROR 0x00
00040
00041
00044 struct mwServiceResolve;
00045
00046
00047 enum mwResolveFlag {
00049 mwResolveFlag_UNIQUE = 0x00000001,
00050
00052 mwResolveFlag_FIRST = 0x00000002,
00053
00055 mwResolveFlag_ALL_DIRS = 0x00000004,
00056
00058 mwResolveFlag_USERS = 0x00000008,
00059
00061 mwResolveFlag_GROUPS = 0x00000010,
00062 };
00063
00064
00066 enum mwResolveCode {
00068 mwResolveCode_SUCCESS = 0x00000000,
00069
00071 mwResolveCode_PARTIAL = 0x00010000,
00072
00075 mwResolveCode_MULTIPLE = 0x80020000,
00076
00078 mwResolveCode_BAD_FORMAT = 0x80030000,
00079 };
00080
00081
00082 enum mwResolveMatchType {
00083 mwResolveMatch_USER = 0x00000001,
00084 mwResolveMatch_GROUP = 0x00000002,
00085 };
00086
00087
00088 struct mwResolveMatch {
00089 char *id;
00090 char *name;
00091 char *desc;
00092 guint32 type;
00093 };
00094
00095
00096 struct mwResolveResult {
00097 guint32 code;
00098 char *name;
00099 GList *matches;
00100 };
00101
00102
00113 typedef void (*mwResolveHandler)
00114 (struct mwServiceResolve *srvc,
00115 guint32 id, guint32 code, GList *results,
00116 gpointer data);
00117
00118
00120 struct mwServiceResolve *mwServiceResolve_new(struct mwSession *);
00121
00122
00133 guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc,
00134 GList *queries, enum mwResolveFlag flags,
00135 mwResolveHandler handler,
00136 gpointer data, GDestroyNotify cleanup);
00137
00138
00142 void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32);
00143
00144
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148
00149
00150 #endif