meanwhile 1.1.0
mw_srvc_resolve.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_RESOLVE_H
00022 #define _MW_SRVC_RESOLVE_H
00023 
00024 
00025 #include <glib.h>
00026 
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 
00034 #define mwService_RESOLVE  0x00000015
00035 
00036 
00038 #define SEARCH_ERROR  0x00
00039 
00040 
00043 struct mwServiceResolve;
00044 
00045 
00046 enum mwResolveFlag {
00048   mwResolveFlag_UNIQUE    = 0x00000001,
00049 
00051   mwResolveFlag_FIRST     = 0x00000002,
00052 
00054   mwResolveFlag_ALL_DIRS  = 0x00000004,
00055 
00057   mwResolveFlag_USERS     = 0x00000008,
00058 
00060   mwResolveFlag_GROUPS    = 0x00000010,
00061 };
00062 
00063 
00065 enum mwResolveCode {
00067   mwResolveCode_SUCCESS     = 0x00000000,
00068 
00070   mwResolveCode_PARTIAL     = 0x00010000,
00071 
00074   mwResolveCode_MULTIPLE    = 0x80020000,
00075 
00077   mwResolveCode_BAD_FORMAT  = 0x80030000,
00078 };
00079 
00080 
00081 enum mwResolveMatchType {
00082   mwResolveMatch_USER   = 0x00000001,
00083   mwResolveMatch_GROUP  = 0x00000002,
00084 };
00085 
00086 
00087 struct mwResolveMatch {
00088   char *id;      
00089   char *name;    
00090   char *desc;    
00091   guint32 type;  
00092 };
00093 
00094 
00095 struct mwResolveResult {
00096   guint32 code;    
00097   char *name;      
00098   GList *matches;  
00099 };
00100 
00101 
00112 typedef void (*mwResolveHandler)
00113      (struct mwServiceResolve *srvc,
00114       guint32 id, guint32 code, GList *results,
00115       gpointer data);
00116 
00117 
00119 struct mwServiceResolve *mwServiceResolve_new(struct mwSession *);
00120 
00121 
00132 guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc,
00133                                  GList *queries, enum mwResolveFlag flags,
00134                                  mwResolveHandler handler,
00135                                  gpointer data, GDestroyNotify cleanup);
00136 
00137 
00141 void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32);
00142 
00143 
00144 #ifdef __cplusplus
00145 }
00146 #endif
00147 
00148 
00149 #endif /* _MW_SRVC_RESOLVE_H */