Mercurial > pidgin
annotate src/protocols/gg/search.h @ 14002:fccb5cfa33b9
[gaim-migrate @ 16587]
Removed an unneeded return and made the notify functions call the close callback immediately if there is no appropriate ui_op.
committer: Tailor Script <tailor@pidgin.im>
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Thu, 27 Jul 2006 20:10:57 +0000 |
parents | d12bbe6da705 |
children |
rev | line source |
---|---|
11414 | 1 /** |
2 * @file search.h | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us> | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 */ | |
22 | |
23 | |
24 #ifndef _GAIM_GG_SEARCH_H | |
25 #define _GAIM_GG_SEARCH_H | |
26 | |
27 #include "connection.h" | |
28 | |
13317
41747a38a1a8
[gaim-migrate @ 15686]
Richard Laager <rlaager@wiktel.com>
parents:
12323
diff
changeset
|
29 #include <libgadu.h> |
11414 | 30 #include "gg.h" |
31 | |
32 | |
13640 | 33 typedef enum { |
34 GGP_SEARCH_TYPE_INFO, | |
35 GGP_SEARCH_TYPE_FULL | |
36 | |
37 } GGPSearchType; | |
38 | |
11414 | 39 typedef struct { |
40 | |
41 char *uin; | |
42 char *lastname; | |
43 char *firstname; | |
44 char *nickname; | |
45 char *city; | |
46 char *birthyear; | |
47 char *gender; | |
48 char *active; | |
49 char *offset; | |
50 | |
51 char *last_uin; | |
52 | |
13640 | 53 GGPSearchType search_type; |
54 guint32 seq; | |
55 | |
56 void *user_data; | |
57 void *window; | |
11414 | 58 } GGPSearchForm; |
59 | |
13640 | 60 typedef GHashTable GGPSearches; |
61 | |
62 | |
11414 | 63 /** |
64 * Create a new GGPSearchForm structure, and set the fields | |
65 * to the sane defaults. | |
66 * | |
67 * @return Newly allocated GGPSearchForm. | |
68 */ | |
69 GGPSearchForm * | |
13640 | 70 ggp_search_form_new(GGPSearchType st); |
71 | |
72 /** | |
73 * Destroy a Search Form. | |
74 * | |
75 * @param form Search Form to destroy. | |
76 */ | |
77 void | |
78 ggp_search_form_destroy(GGPSearchForm *form); | |
79 | |
80 /** | |
81 * Add a search to the list of searches. | |
82 * | |
83 * @param searches The list of searches. | |
84 * @param seq Search (form) ID number. | |
85 * @param form The search form to add. | |
86 */ | |
87 void | |
88 ggp_search_add(GGPSearches *searches, guint32 seq, GGPSearchForm *form); | |
89 | |
90 /** | |
91 * Remove a search from the list. | |
92 * | |
93 * If you want to destory the search completely also call: | |
94 * ggp_search_form_destroy(). | |
95 * | |
96 * @param searches The list of searches. | |
97 * @param seq ID number of the search. | |
98 */ | |
99 void | |
100 ggp_search_remove(GGPSearches *searches, guint32 seq); | |
101 | |
102 /** | |
103 * Return the search with the specified ID. | |
104 * | |
105 * @param searches The list of searches. | |
106 * @param seq ID number of the search. | |
107 */ | |
108 GGPSearchForm * | |
109 ggp_search_get(GGPSearches *searches, guint32 seq); | |
110 | |
111 /** | |
112 * Create a new GGPSearches structure. | |
113 * | |
114 * @return GGPSearches instance. | |
115 */ | |
116 GGPSearches * | |
117 ggp_search_new(void); | |
118 | |
119 /** | |
120 * Destroy GGPSearches instance. | |
121 * | |
122 * @param searches GGPSearches instance. | |
123 */ | |
124 void | |
125 ggp_search_destroy(GGPSearches *searches); | |
11414 | 126 |
127 /** | |
128 * Initiate a search in the public directory. | |
129 * | |
130 * @param gc GaimConnection. | |
131 * @param form Filled in GGPSearchForm. | |
13640 | 132 * |
133 * @return Sequence number of a search or 0 if an error occured. | |
11414 | 134 */ |
13640 | 135 guint32 |
11414 | 136 ggp_search_start(GaimConnection *gc, GGPSearchForm *form); |
137 | |
138 /* | |
139 * Return converted to the UTF-8 value of the specified field. | |
140 * | |
12007
8724718d387f
[gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11414
diff
changeset
|
141 * @param res Public directory look-up result. |
8724718d387f
[gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11414
diff
changeset
|
142 * @param num Id of the record. |
8724718d387f
[gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11414
diff
changeset
|
143 * @param fileld Name of the field. |
11414 | 144 * |
12007
8724718d387f
[gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11414
diff
changeset
|
145 * @return UTF-8 encoded value of the field. |
11414 | 146 */ |
147 char * | |
148 ggp_search_get_result(gg_pubdir50_t res, int num, const char *field); | |
149 | |
150 | |
151 #endif /* _GAIM_GG_SEARCH_H */ | |
152 | |
12007
8724718d387f
[gaim-migrate @ 14300]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
11414
diff
changeset
|
153 /* vim: set ts=8 sts=0 sw=8 noet: */ |