meanwhile  1.1.1
mw_srvc_dir.h
Go to the documentation of this file.
1 /*
2  Meanwhile - Unofficial Lotus Sametime Community Client Library
3  Copyright (C) 2004 Christopher (siege) O'Brien
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public
16  License along with this library; if not, write to the Free
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 #ifndef _MW_SRVC_DIR_H
21 #define _MW_SRVC_DIR_H
22 
23 
24 #include <glib.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 
31 struct mwSession;
32 
33 
34 #define SERVICE_DIRECTORY 0x0000001a
35 
36 
41 
42 
48 
49 
53 struct mwDirectory;
54 
55 
62 };
63 
64 
66 #define DIR_SEARCH_ERROR 0x00000000
67 
68 
69 #define MW_DIRECTORY_IS_STATE(dir, state) \
70  (mwDirectory_getState(dir) == (state))
71 
72 #define MW_DIRECTORY_IS_NEW(dir) \
73  MW_DIRECTORY_IS_STATE((dir), mwDirectory_NEW)
74 
75 #define MW_DIRECTORY_IS_PENDING(dir) \
76  MW_DIRECTORY_IS_STATE((dir), mwDirectory_PENDING)
77 
78 #define MW_DIRECTORY_IS_OPEN(dir) \
79  MW_DIRECTORY_IS_STATE((dir), mwDirectory_OPEN)
80 
81 
85 };
86 
87 
89  guint16 type;
90  char *id;
91  char *long_name;
92  char *short_name;
93  guint16 foo;
94 };
95 
96 
98 typedef void (*mwSearchHandler)
99  (struct mwDirectory *dir,
100  guint32 code, guint32 offset, GList *members);
101 
102 
105 
109  void (*on_book_list)(struct mwServiceDirectory *srvc, GList *books);
110 
112  void (*dir_opened)(struct mwDirectory *dir);
113 
115  void (*dir_closed)(struct mwDirectory *dir, guint32 reason);
116 
118  void (*clear)(struct mwServiceDirectory *srvc);
119 };
120 
121 
123 struct mwServiceDirectory *
125  struct mwDirectoryHandler *handler);
126 
127 
129 struct mwDirectoryHandler *
131 
132 
135 
136 
140 
141 
144 
145 
148 GList *mwAddressBook_getDirectories(struct mwAddressBook *book);
149 
150 
152 const char *mwAddressBook_getName(struct mwAddressBook *book);
153 
154 
156 struct mwDirectory *mwDirectory_new(struct mwAddressBook *book);
157 
158 
160 
161 
164 void mwDirectory_setClientData(struct mwDirectory *dir,
165  gpointer data, GDestroyNotify clear);
166 
167 
169 gpointer mwDirectory_getClientData(struct mwDirectory *dir);
170 
171 
173 void mwDirectory_removeClientData(struct mwDirectory *dir);
174 
175 
178 
179 
182 
183 
185 int mwDirectory_open(struct mwDirectory *dir, mwSearchHandler cb);
186 
187 
189 int mwDirectory_next(struct mwDirectory *dir);
190 
191 
193 int mwDirectory_previous(struct mwDirectory *dir);
194 
195 
197 int mwDirectory_search(struct mwDirectory *dir, const char *query);
198 
199 
202 int mwDirectory_destroy(struct mwDirectory *dir);
203 
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 
210 #endif /* _MW_SRVC_DIR_H */
struct mwServiceDirectory * mwDirectory_getService(struct mwDirectory *dir)
reference owning service
directory has in the process of opening
Definition: mw_srvc_dir.h:58
gpointer mwDirectory_getClientData(struct mwDirectory *dir)
reference associated client data
mwService_funcClear clear
The service&#39;s cleanup handler.
Definition: mw_service.h:195
int mwDirectory_destroy(struct mwDirectory *dir)
close and free the directory, and unassociate it with its owning address book and service ...
char * short_name
short name of member
Definition: mw_srvc_dir.h:92
void(* dir_opened)(struct mwDirectory *dir)
triggered when a directory has been successfully opened
Definition: mw_srvc_dir.h:112
struct mwDirectoryHandler * mwServiceDirectory_getHandler(struct mwServiceDirectory *srvc)
the handler associated with the service at its creation
int mwDirectory_next(struct mwDirectory *dir)
continue a search into its next results
mwDirectoryMemberType
Definition: mw_srvc_dir.h:82
guint16 type
Definition: mw_srvc_dir.h:89
mwDirectoryState
Definition: mw_srvc_dir.h:56
GList * mwServiceDirectory_getAddressBooks(struct mwServiceDirectory *srvc)
most recent list of address books available in service
int mwDirectory_open(struct mwDirectory *dir, mwSearchHandler cb)
initialize a directory.
server-side collection of users and groups.
Definition: mw_srvc_dir.h:40
enum mwDirectoryState mwDirectory_getState(struct mwDirectory *dir)
directory is created, but not open
Definition: mw_srvc_dir.h:57
Represents a Sametime client session.
Definition: mw_srvc_dir.h:84
void(* on_book_list)(struct mwServiceDirectory *srvc, GList *books)
handle receipt of the address book list from the service.
Definition: mw_srvc_dir.h:109
void mwDirectory_removeClientData(struct mwDirectory *dir)
remove and cleanup user data
GList * mwAddressBook_getDirectories(struct mwAddressBook *book)
list of directories associated with address book.
handles asynchronous events for a directory service instance
Definition: mw_srvc_dir.h:104
struct mwSession * session
session this service is attached to.
Definition: mw_service.h:139
int mwServiceDirectory_refreshAddressBooks(struct mwServiceDirectory *srvc)
submit a request to obtain an updated list of address books from service
the directory service.
char * long_name
full name of member (USER type only)
Definition: mw_srvc_dir.h:91
Definition: mw_srvc_dir.h:83
struct mwDirectory * mwDirectory_new(struct mwAddressBook *book)
allocate a new directory based off the given address book
char * id
proper ID for member
Definition: mw_srvc_dir.h:90
void(* dir_closed)(struct mwDirectory *dir, guint32 reason)
triggered when a directory has been closed
Definition: mw_srvc_dir.h:115
int mwDirectory_previous(struct mwDirectory *dir)
continue a search into its previous results
void(* clear)(struct mwServiceDirectory *srvc)
optional.
Definition: mw_srvc_dir.h:118
struct mwServiceDirectory * mwServiceDirectory_new(struct mwSession *session, struct mwDirectoryHandler *handler)
Allocate a new directory service instance for use with session.
guint16 foo
unknown
Definition: mw_srvc_dir.h:93
error determining directory state
Definition: mw_srvc_dir.h:61
struct mwAddressBook * mwDirectory_getAddressBook(struct mwDirectory *dir)
reference owning address book
const char * mwAddressBook_getName(struct mwAddressBook *book)
the name of the address book
void mwDirectory_setClientData(struct mwDirectory *dir, gpointer data, GDestroyNotify clear)
set client data.
Definition: mw_srvc_dir.h:88
searchable directory, based off of an address book
Definition: mw_srvc_dir.h:47
error opening or using directory
Definition: mw_srvc_dir.h:60
GList * mwServiceDirectory_getDirectories(struct mwServiceDirectory *srvc)
list of directories in the service
int mwDirectory_search(struct mwDirectory *dir, const char *query)
initiate a search on an open directory
directory is open
Definition: mw_srvc_dir.h:59
void(* mwSearchHandler)(struct mwDirectory *dir, guint32 code, guint32 offset, GList *members)
Appropriate function signature for handling directory search results.
Definition: mw_srvc_dir.h:99