meanwhile 1.0.2
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 #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 /* _MW_SRVC_RESOLVE_H */