Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

mw_srvc_dir.h

Go to the documentation of this file.
00001 /*
00002   Meanwhile - Unofficial Lotus Sametime Community Client Library
00003   Copyright (C) 2004  Christopher (siege) O'Brien
00004   
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Library General Public
00007   License as published by the Free Software Foundation; either
00008   version 2 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Library General Public License for more details.
00014   
00015   You should have received a copy of the GNU Library General Public
00016   License along with this library; if not, write to the Free
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 #ifndef _MW_SRVC_DIR_H
00021 #define _MW_SERV_DIR_H
00022 
00023 
00024 #include <glib.h>
00025 #include <glib/glist.h>
00026 
00027 
00028 struct mwSession;
00029 
00030 
00031 #define SERVICE_DIRECTORY  0x0000001a
00032 
00033 
00037 struct mwServiceDirectory;
00038 
00039 
00044 struct mwAddressBook;
00045 
00046 
00050 struct mwDirectory;
00051 
00052 
00053 enum mwDirectoryState {
00054   mwDirectory_NEW,      
00055   mwDirectory_PENDING,  
00056   mwDirectory_OPEN,     
00057   mwDirectory_ERROR,    
00058   mwDirectory_UNKNOWN,  
00059 };
00060 
00061 
00063 #define DIR_SEARCH_ERROR  0x00000000
00064 
00065 
00066 #define MW_DIRECTORY_IS_STATE(dir, state) \
00067   (mwDirectory_getState(dir) == (state))
00068 
00069 #define MW_DIRECTORY_IS_NEW(dir) \
00070   MW_DIRECTORY_IS_STATE((dir), mwDirectory_NEW)
00071 
00072 #define MW_DIRECTORY_IS_PENDING(dir) \
00073   MW_DIRECTORY_IS_STATE((dir), mwDirectory_PENDING)
00074 
00075 #define MW_DIRECTORY_IS_OPEN(dir) \
00076   MW_DIRECTORY_IS_STATE((dir), mwDirectory_OPEN)
00077 
00078 
00079 enum mwDirectoryMemberType {
00080   mwDirectoryMember_USER   = 0x0000,
00081   mwDirectoryMember_GROUP  = 0x0001,
00082 };
00083 
00084 
00085 struct mwDirectoryMember {
00086   guint16 type;      
00087   char *id;          
00088   char *long_name;   
00089   char *short_name;  
00090   guint16 foo;       
00091 };
00092 
00093 
00095 typedef void (*mwSearchHandler)
00096      (struct mwDirectory *dir,
00097       guint32 code, guint32 offset, GList *members);
00098 
00099 
00101 struct mwDirectoryHandler {
00102 
00106   void (*on_book_list)(struct mwServiceDirectory *srvc, GList *books);
00107 
00109   void (*dir_opened)(struct mwDirectory *dir);
00110 
00112   void (*dir_closed)(struct mwDirectory *dir, guint32 reason);
00113 
00115   void (*clear)(struct mwServiceDirectory *srvc);
00116 };
00117 
00118 
00120 struct mwServiceDirectory *
00121 mwServiceDirectory_new(struct mwSession *session,
00122                        struct mwDirectoryHandler *handler);
00123 
00124 
00126 struct mwDirectoryHandler *
00127 mwServiceDirectory_getHandler(struct mwServiceDirectory *srvc);
00128 
00129 
00131 GList *mwServiceDirectory_getAddressBooks(struct mwServiceDirectory *srvc);
00132 
00133 
00136 int mwServiceDirectory_refreshAddressBooks(struct mwServiceDirectory *srvc);
00137 
00138 
00140 GList *mwServiceDirectory_getDirectories(struct mwServiceDirectory *srvc);
00141 
00142 
00145 GList *mwAddressBook_getDirectories(struct mwAddressBook *book);
00146 
00147 
00149 const char *mwAddressBook_getName(struct mwAddressBook *book);
00150 
00151 
00153 struct mwDirectory *mwDirectory_new(struct mwAddressBook *book);
00154 
00155 
00156 enum mwDirectoryState mwDirectory_getState(struct mwDirectory *dir);
00157 
00158 
00161 void mwDirectory_setClientData(struct mwDirectory *dir,
00162                                gpointer data, GDestroyNotify clear);
00163 
00164 
00166 gpointer mwDirectory_getClientData(struct mwDirectory *dir);
00167 
00168 
00170 void mwDirectory_removeClientData(struct mwDirectory *dir);
00171 
00172 
00174 struct mwServiceDirectory *mwDirectory_getService(struct mwDirectory *dir);
00175 
00176 
00178 struct mwAddressBook *mwDirectory_getAddressBook(struct mwDirectory *dir);
00179 
00180 
00182 int mwDirectory_open(struct mwDirectory *dir, mwSearchHandler cb);
00183 
00184 
00186 int mwDirectory_next(struct mwDirectory *dir);
00187 
00188 
00190 int mwDirectory_previous(struct mwDirectory *dir);
00191 
00192 
00194 int mwDirectory_search(struct mwDirectory *dir, const char *query);
00195 
00196 
00199 int mwDirectory_destroy(struct mwDirectory *dir);
00200 
00201 
00202 #endif

Generated on Tue Nov 1 15:51:53 2005 for meanwhile by  doxygen 1.4.4