meanwhile  1.0.2
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 #include <glib/glist.h>
26 
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 struct mwSession;
34 
35 
36 #define SERVICE_DIRECTORY 0x0000001a
37 
38 
43 
44 
50 
51 
55 struct mwDirectory;
56 
57 
64 };
65 
66 
68 #define DIR_SEARCH_ERROR 0x00000000
69 
70 
71 #define MW_DIRECTORY_IS_STATE(dir, state) \
72  (mwDirectory_getState(dir) == (state))
73 
74 #define MW_DIRECTORY_IS_NEW(dir) \
75  MW_DIRECTORY_IS_STATE((dir), mwDirectory_NEW)
76 
77 #define MW_DIRECTORY_IS_PENDING(dir) \
78  MW_DIRECTORY_IS_STATE((dir), mwDirectory_PENDING)
79 
80 #define MW_DIRECTORY_IS_OPEN(dir) \
81  MW_DIRECTORY_IS_STATE((dir), mwDirectory_OPEN)
82 
83 
87 };
88 
89 
91  guint16 type;
92  char *id;
93  char *long_name;
94  char *short_name;
95  guint16 foo;
96 };
97 
98 
100 typedef void (*mwSearchHandler)
101  (struct mwDirectory *dir,
102  guint32 code, guint32 offset, GList *members);
103 
104 
107 
111  void (*on_book_list)(struct mwServiceDirectory *srvc, GList *books);
112 
114  void (*dir_opened)(struct mwDirectory *dir);
115 
117  void (*dir_closed)(struct mwDirectory *dir, guint32 reason);
118 
120  void (*clear)(struct mwServiceDirectory *srvc);
121 };
122 
123 
125 struct mwServiceDirectory *
127  struct mwDirectoryHandler *handler);
128 
129 
131 struct mwDirectoryHandler *
133 
134 
137 
138 
142 
143 
146 
147 
150 GList *mwAddressBook_getDirectories(struct mwAddressBook *book);
151 
152 
154 const char *mwAddressBook_getName(struct mwAddressBook *book);
155 
156 
158 struct mwDirectory *mwDirectory_new(struct mwAddressBook *book);
159 
160 
162 
163 
166 void mwDirectory_setClientData(struct mwDirectory *dir,
167  gpointer data, GDestroyNotify clear);
168 
169 
171 gpointer mwDirectory_getClientData(struct mwDirectory *dir);
172 
173 
175 void mwDirectory_removeClientData(struct mwDirectory *dir);
176 
177 
180 
181 
184 
185 
187 int mwDirectory_open(struct mwDirectory *dir, mwSearchHandler cb);
188 
189 
191 int mwDirectory_next(struct mwDirectory *dir);
192 
193 
195 int mwDirectory_previous(struct mwDirectory *dir);
196 
197 
199 int mwDirectory_search(struct mwDirectory *dir, const char *query);
200 
201 
204 int mwDirectory_destroy(struct mwDirectory *dir);
205 
206 
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 
212 #endif /* _MW_SRVC_DIR_H */