meanwhile  1.1.0
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_SERV_DIR_H
22 
23 
24 #include <glib.h>
25 
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 
32 struct mwSession;
33 
34 
35 #define SERVICE_DIRECTORY 0x0000001a
36 
37 
42 
43 
49 
50 
54 struct mwDirectory;
55 
56 
63 };
64 
65 
67 #define DIR_SEARCH_ERROR 0x00000000
68 
69 
70 #define MW_DIRECTORY_IS_STATE(dir, state) \
71  (mwDirectory_getState(dir) == (state))
72 
73 #define MW_DIRECTORY_IS_NEW(dir) \
74  MW_DIRECTORY_IS_STATE((dir), mwDirectory_NEW)
75 
76 #define MW_DIRECTORY_IS_PENDING(dir) \
77  MW_DIRECTORY_IS_STATE((dir), mwDirectory_PENDING)
78 
79 #define MW_DIRECTORY_IS_OPEN(dir) \
80  MW_DIRECTORY_IS_STATE((dir), mwDirectory_OPEN)
81 
82 
86 };
87 
88 
90  guint16 type;
91  char *id;
92  char *long_name;
93  char *short_name;
94  guint16 foo;
95 };
96 
97 
99 typedef void (*mwSearchHandler)
100  (struct mwDirectory *dir,
101  guint32 code, guint32 offset, GList *members);
102 
103 
106 
110  void (*on_book_list)(struct mwServiceDirectory *srvc, GList *books);
111 
113  void (*dir_opened)(struct mwDirectory *dir);
114 
116  void (*dir_closed)(struct mwDirectory *dir, guint32 reason);
117 
119  void (*clear)(struct mwServiceDirectory *srvc);
120 };
121 
122 
124 struct mwServiceDirectory *
126  struct mwDirectoryHandler *handler);
127 
128 
130 struct mwDirectoryHandler *
132 
133 
136 
137 
141 
142 
145 
146 
149 GList *mwAddressBook_getDirectories(struct mwAddressBook *book);
150 
151 
153 const char *mwAddressBook_getName(struct mwAddressBook *book);
154 
155 
157 struct mwDirectory *mwDirectory_new(struct mwAddressBook *book);
158 
159 
161 
162 
165 void mwDirectory_setClientData(struct mwDirectory *dir,
166  gpointer data, GDestroyNotify clear);
167 
168 
170 gpointer mwDirectory_getClientData(struct mwDirectory *dir);
171 
172 
174 void mwDirectory_removeClientData(struct mwDirectory *dir);
175 
176 
179 
180 
183 
184 
186 int mwDirectory_open(struct mwDirectory *dir, mwSearchHandler cb);
187 
188 
190 int mwDirectory_next(struct mwDirectory *dir);
191 
192 
194 int mwDirectory_previous(struct mwDirectory *dir);
195 
196 
198 int mwDirectory_search(struct mwDirectory *dir, const char *query);
199 
200 
203 int mwDirectory_destroy(struct mwDirectory *dir);
204 
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 
211 #endif /* _MW_SRVC_DIR_H */