Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

ui2c.h

Go to the documentation of this file.
00001 /*
00002  * $Id: ui2c.h 13925 2007-06-22 05:24:10Z cbiere $
00003  *
00004  * Copyright (c) 2004, Emile Roberts
00005  *
00006  *----------------------------------------------------------------------
00007  * This file is part of gtk-gnutella.
00008  *
00009  *  gtk-gnutella is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  gtk-gnutella is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with gtk-gnutella; if not, write to the Free Software
00021  *  Foundation, Inc.:
00022  *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *----------------------------------------------------------------------
00024  */
00025 
00036 #ifndef _if_bridge_ui2c_h_
00037 #define _if_bridge_ui2c_h_
00038 
00039 #include "common.h"
00040 
00041 /*
00042  *  SECTION 1 - Interface includes
00043  */
00044 
00045 #include "lib/adns.h"
00046 
00047 #include "if/core/downloads.h"
00048 #include "if/core/fileinfo.h"
00049 #include "if/core/net_stats.h"
00050 #include "if/core/hcache.h"
00051 #include "if/core/hsep.h"
00052 #include "if/core/search.h"
00053 #include "if/core/share.h"
00054 #include "if/core/uploads.h"
00055 #include "if/core/bitzi.h"
00056 
00057 /* Property table includes */
00058 #include "if/gnet_property.h"
00059 
00060 /* adns interface functions */
00061 gboolean guc_adns_resolve(const gchar *hostname,
00062             adns_callback_t user_callback, gpointer user_data);
00063 
00064 /* download and src interface functions */
00065 gboolean
00066 guc_download_new(const gchar *filename,
00067     const gchar *uri,
00068     filesize_t size,
00069     const host_addr_t addr,
00070     guint16 port,
00071     const gchar *guid,
00072     const gchar *hostname,
00073     const struct sha1 *sha1,
00074     time_t stamp,
00075     fileinfo_t *fi,
00076     gnet_host_vec_t *proxies,
00077     guint32 flags,
00078     const gchar *parq_id);
00079 
00080 void
00081 guc_download_auto_new(const gchar *filename,
00082     filesize_t size,
00083     const host_addr_t addr,
00084     guint16 port,
00085     const gchar *guid,
00086     const gchar *hostname,
00087     const struct sha1 *sha1,
00088     time_t stamp,
00089     fileinfo_t *fi,
00090     gnet_host_vec_t *proxies,
00091     guint32 flags);
00092 
00093 gchar *guc_download_build_url(const struct download *d);
00094 gchar *guc_file_info_build_magnet(gnet_fi_t handle);
00095 gchar *guc_file_info_get_file_url(gnet_fi_t handle);
00096 const gchar *guc_file_info_status_to_string(const gnet_fi_status_t *status);
00097 gint guc_download_get_http_req_percent(const struct download *d);
00098 void guc_download_fallback_to_push(struct download *d, gboolean on_timeout,
00099         gboolean user_request);
00100 gint guc_download_remove_all_from_peer(const gchar *guid,
00101         const host_addr_t addr, guint16 port, gboolean unavailable);
00102 gint guc_download_remove_all_named(const gchar *name);
00103 gint guc_download_remove_all_with_sha1(const struct sha1 *sha1);
00104 void guc_download_remove_file(struct download *d, gboolean reset);
00105 gboolean guc_download_file_exists(const struct download *d);
00106 void guc_download_requeue(struct download *d);
00107 void guc_download_start(struct download *d, gboolean check_allowed);
00108 void guc_download_pause(struct download *d);
00109 gboolean guc_download_remove(struct download *d);
00110 void guc_download_abort(struct download *d);
00111 void guc_download_resume(struct download *d);
00112 void guc_download_freeze_queue(void);
00113 void guc_download_thaw_queue(void);
00114 gboolean guc_download_queue_is_frozen(void);
00115 void guc_download_clear_stopped(gboolean complete,
00116     gboolean failed, gboolean unavailable, gboolean now);
00117 guint guc_download_handle_magnet(const gchar *url);
00118 const gchar *guc_download_get_hostname(const struct download *d);
00119 const gchar *guc_download_get_country(const struct download *d);
00120 gdouble guc_download_source_progress(const struct download *d);
00121 gdouble guc_download_total_progress(const struct download *d);
00122 gboolean guc_download_something_to_clear(void);
00123 void guc_download_index_changed(const host_addr_t addr, guint16 port,
00124     const gchar *guid, filesize_t from, filesize_t to);
00125 struct download *guc_src_get_download(gnet_src_t src_handle);
00126 void guc_src_add_listener(src_listener_t cb, gnet_src_ev_t ev,
00127     frequency_t t, guint32 interval);
00128 void guc_src_remove_listener(src_listener_t cb,
00129     gnet_src_ev_t ev);
00130 
00131 /* fileinfo interface functions */
00132 const gchar *guc_file_info_readable_filename(fileinfo_t *fi);
00133 gnet_fi_info_t *guc_fi_get_info(gnet_fi_t fih);
00134 void guc_fi_free_info(gnet_fi_info_t *info);
00135 void guc_fi_get_status(gnet_fi_t fih, gnet_fi_status_t *s);
00136 gchar **guc_fi_get_aliases(gnet_fi_t fih);
00137 void guc_fi_purge_by_handle_list(const GSList *list);
00138 void guc_fi_add_listener(fi_listener_t cb, gnet_fi_ev_t ev,
00139     frequency_t t, guint32 interval);
00140 void guc_fi_remove_listener(fi_listener_t cb, gnet_fi_ev_t ev);
00141 GSList *guc_fi_get_chunks(gnet_fi_t fih);
00142 void guc_fi_free_chunks(GSList *chunks);
00143 GSList *guc_fi_get_ranges(gnet_fi_t fih);
00144 void guc_fi_free_ranges(GSList *ranges);
00145 void guc_fi_add_listener(fi_listener_t cb, gnet_fi_ev_t ev,
00146     frequency_t t, guint32 interval);
00147 void guc_fi_remove_listener(fi_listener_t cb, gnet_fi_ev_t ev);
00148 
00149 /* gnet_stats interface functions */
00150 void guc_gnet_stats_get(gnet_stats_t *stats);
00151 void guc_gnet_stats_tcp_get(gnet_stats_t *stats);
00152 void guc_gnet_stats_udp_get(gnet_stats_t *stats);
00153 void guc_gnet_get_bw_stats(gnet_bw_source type, gnet_bw_stats_t *stats);
00154 const gchar *guc_gnet_stats_drop_reason_to_string(msg_drop_reason_t reason);
00155 
00156 /* hcache interface functions */
00157 void guc_hcache_clear_host_type(host_type_t type);
00158 void guc_hcache_clear(hcache_type_t type);
00159 void guc_hcache_get_stats(hcache_stats_t *stats);
00160 
00161 /* hsep interface functions */
00162 gint guc_hsep_get_table_size(void);
00163 void guc_hsep_get_non_hsep_triple(hsep_triple *tripledest);
00164 const gchar *guc_hsep_get_static_str(gint row, gint column);
00165 void guc_hsep_add_global_table_listener(GCallback cb,
00166     frequency_t t, guint32 interval);
00167 void guc_hsep_remove_global_table_listener(GCallback cb);
00168 
00169 /* http interface functions */
00170 const gchar *guc_http_range_to_string(const GSList *list);
00171 GSList * guc_http_range_merge(GSList *old_list, GSList *new_list);
00172 
00173 /* node interface functions */
00174 void guc_node_add_node_added_listener(node_added_listener_t l);
00175 void guc_node_add_node_removed_listener(node_removed_listener_t l);
00176 void guc_node_add_node_info_changed_listener(node_info_changed_listener_t l);
00177 void guc_node_add_node_flags_changed_listener(node_flags_changed_listener_t l);
00178 void guc_node_remove_node_added_listener(node_added_listener_t l);
00179 void guc_node_remove_node_removed_listener(node_removed_listener_t l);
00180 void guc_node_remove_node_info_changed_listener(node_info_changed_listener_t l);
00181 void guc_node_remove_node_flags_changed_listener(node_flags_changed_listener_t l);
00182 void guc_node_add(const host_addr_t addr, guint16 port, guint32 flags);
00183 void guc_node_remove_by_id(const node_id_t node_id);
00184 void guc_node_remove_nodes_by_id(const GSList *node_list);
00185 gboolean guc_node_get_status(const node_id_t node_id, gnet_node_status_t *s);
00186 gnet_node_info_t *guc_node_get_info(const node_id_t node_id);
00187 void guc_node_clear_info(gnet_node_info_t *info);
00188 void guc_node_free_info(gnet_node_info_t *info);
00189 gboolean guc_node_fill_flags(const node_id_t node_id, gnet_node_flags_t *flags);
00190 gboolean guc_node_fill_info(const node_id_t node_id, gnet_node_info_t *info);
00191 const gchar *guc_node_flags_to_string(const gnet_node_flags_t *flags);
00192 const gchar *guc_node_peermode_to_string(node_peer_t m);
00193 
00194 /* parq interface functions */
00195 gint guc_get_parq_dl_position(const struct download *d);
00196 gint guc_get_parq_dl_queue_length(const struct download *d);
00197 gint guc_get_parq_dl_eta(const struct download *d);
00198 gint guc_get_parq_dl_retry_delay(const struct download *d);
00199 
00200 /* search interface functions */
00201 guint guc_search_handle_magnet(const gchar *url);
00202 void guc_search_update_items(gnet_search_t sh, guint32 items);
00203 guint guc_search_get_lifetime(gnet_search_t sh);
00204 time_t guc_search_get_create_time(gnet_search_t sh);
00205 void guc_search_set_create_time(gnet_search_t sh, time_t t);
00206 guint32 guc_search_get_reissue_timeout(gnet_search_t sh);
00207 void guc_search_set_reissue_timeout(gnet_search_t sh, guint32 timeout);
00208 
00209 const gchar *guc_search_query(gnet_search_t sh);
00210 
00211 gboolean guc_search_is_active(gnet_search_t sh);
00212 gboolean guc_search_is_browse(gnet_search_t sh);
00213 gboolean guc_search_is_expired(gnet_search_t sh);
00214 gboolean guc_search_is_frozen(gnet_search_t sh);
00215 gboolean guc_search_is_local(gnet_search_t sh);
00216 gboolean guc_search_is_passive(gnet_search_t sh);
00217 
00218 gnet_search_t guc_search_new(const gchar *query,
00219     time_t create_time, guint lifetime,
00220     guint32 reissue_timeout, flag_t flags);
00221 gboolean guc_search_browse(gnet_search_t sh,
00222     const gchar *hostname, host_addr_t addr, guint16 port,
00223     const gchar *guid, const gnet_host_vec_t *proxies, guint32 flags);
00224 gboolean guc_search_locally(gnet_search_t sh, const gchar *query);
00225 void guc_search_reissue(gnet_search_t sh);
00226 void guc_search_close(gnet_search_t sh);
00227 void guc_search_start(gnet_search_t sh);
00228 void guc_search_stop(gnet_search_t sh);
00229 void guc_search_add_kept(gnet_search_t sh, guint32 kept);
00230 
00231 /* settings interface functions */
00232 guint16 guc_listen_port(void);
00233 host_addr_t guc_listen_addr(enum net_type net);
00234 const gchar *guc_settings_home_dir(void);
00235 const gchar *guc_settings_config_dir(void);
00236 
00237 /* share interface functions */
00238 void guc_shared_dir_add(const gchar * path);
00239 void guc_share_scan(void);
00240 guint64 guc_shared_files_scanned(void);
00241 guint64 guc_shared_kbytes_scanned(void);
00242 void guc_share_add_search_request_listener
00243     (search_request_listener_t l);
00244 void guc_share_remove_search_request_listener
00245     (search_request_listener_t l);
00246 
00247 /* upload interface functions */
00248 gnet_upload_info_t *guc_upload_get_info(gnet_upload_t uh);
00249 void guc_upload_free_info(gnet_upload_info_t *info);
00250 void guc_upload_get_status
00251     (gnet_upload_t uh, gnet_upload_status_t *si);
00252 void guc_upload_kill(gnet_upload_t upload);
00253 void guc_upload_add_upload_added_listener
00254     (upload_added_listener_t l);
00255 void guc_upload_remove_upload_added_listener
00256     (upload_added_listener_t l);
00257 void guc_upload_add_upload_removed_listener
00258     (upload_removed_listener_t l);
00259 void guc_upload_remove_upload_removed_listener
00260     (upload_removed_listener_t l);
00261 void guc_upload_add_upload_info_changed_listener
00262     (upload_info_changed_listener_t l);
00263 void guc_upload_remove_upload_info_changed_listener
00264     (upload_info_changed_listener_t l);
00265 
00266 /* upload stats interface functions */
00267 void guc_upload_stats_prune_nonexistent(void);
00268 void guc_upload_stats_clear_all(void);
00269 
00271 const gchar *guc_version_get_version_string(void);
00272 
00273 /* bitzi interface functions*/
00274 gboolean guc_bitzi_has_cached_ticket(const struct sha1 *sha1);
00275 void guc_query_bitzi_by_sha1(const struct sha1 *sha1, filesize_t filesize);
00276 
00278 void guc_gtk_gnutella_exit(gint code);
00279 
00280 #endif /* _if_bridge_ui2c_h_ */
00281 /* vi: set ts=4 sw=4 cindent: */

Generated on Sat Jun 30 17:53:24 2007 for gtk-gnutella by  doxygen 1.3.9.1