6 * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 #ifndef _PURPLE_GG_SEARCH_H
25 #define _PURPLE_GG_SEARCH_H
27 #include "connection.h"
53 GGPSearchType search_type;
60 typedef GHashTable GGPSearches;
64 * Create a new GGPSearchForm structure, and set the fields
65 * to the sane defaults.
67 * @return Newly allocated GGPSearchForm.
70 ggp_search_form_new(GGPSearchType st);
73 * Destroy a Search Form.
75 * @param form Search Form to destroy.
78 ggp_search_form_destroy(GGPSearchForm *form);
81 * Add a search to the list of searches.
83 * @param searches The list of searches.
84 * @param seq Search (form) ID number.
85 * @param form The search form to add.
88 ggp_search_add(GGPSearches *searches, guint32 seq, GGPSearchForm *form);
91 * Remove a search from the list.
93 * If you want to destory the search completely also call:
94 * ggp_search_form_destroy().
96 * @param searches The list of searches.
97 * @param seq ID number of the search.
100 ggp_search_remove(GGPSearches *searches, guint32 seq);
103 * Return the search with the specified ID.
105 * @param searches The list of searches.
106 * @param seq ID number of the search.
109 ggp_search_get(GGPSearches *searches, guint32 seq);
112 * Create a new GGPSearches structure.
114 * @return GGPSearches instance.
117 ggp_search_new(void);
120 * Destroy GGPSearches instance.
122 * @param searches GGPSearches instance.
125 ggp_search_destroy(GGPSearches *searches);
128 * Initiate a search in the public directory.
130 * @param gc PurpleConnection.
131 * @param form Filled in GGPSearchForm.
133 * @return Sequence number of a search or 0 if an error occurred.
136 ggp_search_start(PurpleConnection *gc, GGPSearchForm *form);
139 * Return converted to the UTF-8 value of the specified field.
141 * @param res Public directory look-up result.
142 * @param num Id of the record.
143 * @param fileld Name of the field.
145 * @return UTF-8 encoded value of the field.
148 ggp_search_get_result(gg_pubdir50_t res, int num, const char *field);
151 #endif /* _PURPLE_GG_SEARCH_H */
153 /* vim: set ts=8 sts=0 sw=8 noet: */