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
00030 #define mwService_RESOLVE 0x00000015
00031
00032
00034 #define SEARCH_ERROR 0x00
00035
00036
00039 struct mwServiceResolve;
00040
00041
00042 enum mwResolveFlag {
00044 mwResolveFlag_UNIQUE = 0x00000001,
00045
00047 mwResolveFlag_FIRST = 0x00000002,
00048
00050 mwResolveFlag_ALL_DIRS = 0x00000004,
00051
00053 mwResolveFlag_USERS = 0x00000008,
00054
00056 mwResolveFlag_GROUPS = 0x00000010,
00057 };
00058
00059
00061 enum mwResolveCode {
00063 mwResolveCode_SUCCESS = 0x00000000,
00064
00066 mwResolveCode_PARTIAL = 0x00010000,
00067
00070 mwResolveCode_MULTIPLE = 0x80020000,
00071
00073 mwResolveCode_BAD_FORMAT = 0x80030000,
00074 };
00075
00076
00077 enum mwResolveMatchType {
00078 mwResolveMatch_USER = 0x00000001,
00079 mwResolveMatch_GROUP = 0x00000002,
00080 };
00081
00082
00083 struct mwResolveMatch {
00084 char *id;
00085 char *name;
00086 char *desc;
00087 guint32 type;
00088 };
00089
00090
00091 struct mwResolveResult {
00092 guint32 code;
00093 char *name;
00094 GList *matches;
00095 };
00096
00097
00108 typedef void (*mwResolveHandler)
00109 (struct mwServiceResolve *srvc,
00110 guint32 id, guint32 code, GList *results,
00111 gpointer data);
00112
00113
00115 struct mwServiceResolve *mwServiceResolve_new(struct mwSession *);
00116
00117
00128 guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc,
00129 GList *queries, enum mwResolveFlag flags,
00130 mwResolveHandler handler,
00131 gpointer data, GDestroyNotify cleanup);
00132
00133
00137 void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32);
00138
00139
00140 #endif