00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _gtk_search_h_
00027 #define _gtk_search_h_
00028
00029 #include "gui.h"
00030 #include "filter_core.h"
00031
00032 #include "if/core/search.h"
00033 #include "if/core/bitzi.h"
00034 #include "lib/hashlist.h"
00035 #include "lib/prop.h"
00036
00040 struct search {
00041 gnet_search_t search_handle;
00043 gchar *query;
00044 gboolean enabled;
00045
00046 #ifdef USE_GTK2
00047 GtkWidget *tree_view;
00048 GtkTreeModel *model;
00050 #else
00051 GtkCTree *ctree;
00052 #endif
00053
00054 GHashTable *parents;
00056 GtkWidget *scrolled_window;
00058 GtkWidget *arrow;
00060 gint sort_col;
00061 gint sort_order;
00062 gboolean sort;
00063
00064 time_t last_update_time;
00065 guint32 last_update_items;
00066 gint tab_updating;
00067 guint32 unseen_items;
00069 gboolean passive;
00070 gboolean massive_update;
00071 gboolean browse;
00073 hash_list_t *r_sets;
00075 GHashTable *dups;
00077 filter_t *filter;
00079
00080
00081
00082
00083 guint32 items;
00084 guint32 tcp_qhits;
00085 guint32 udp_qhits;
00086 guint32 skipped;
00087 guint32 ignored;
00088 guint32 hidden;
00089 guint32 auto_downloaded;
00090 guint32 duplicates;
00091 };
00092
00093 #include "search_common.h"
00094
00095 #ifdef USE_GTK1
00096
00100 typedef struct gui_record {
00101 record_t *shared_record;
00104 gint num_children;
00105 } gui_record_t;
00106
00107 #endif
00108
00109
00110
00111
00112
00113
00114 void search_gui_init(void);
00115 void search_gui_shutdown(void);
00116
00117 gboolean search_gui_new_search_full(const gchar *query,
00118 time_t create_time, guint lifetime, guint32 reissue_timeout,
00119 gint sort_col, gint sort_order, flag_t flags, search_t **search);
00120 struct search *search_new_full(const gchar *, guint32, flag_t flags);
00121 void search_gui_close_search(search_t *sch);
00122
00123 void search_gui_clear_search(search_t *sch);
00124 void search_gui_remove_search(search_t * sch);
00125 void search_gui_reset_search(search_t *sch);
00126 void search_gui_download_files(void);
00127 void search_gui_discard_files(void);
00128
00129 void search_gui_sort_column(search_t *search, gint column);
00130
00131 void search_gui_add_record(
00132 search_t *sch, record_t *rc, GString *vinfo, GdkColor *fg, GdkColor *bg);
00133
00134 gboolean gui_search_update_tab_label(struct search *);
00135 void gui_search_clear_results(void);
00136
00137 #ifdef USE_GTK2
00138 void gui_search_force_update_tab_label(struct search *, time_t now);
00139 void search_gui_request_bitzi_data(void);
00140 const record_t *search_gui_get_record_at_path(GtkTreeView *tv,
00141 GtkTreePath *path);
00142 #else
00143 void gui_search_force_update_tab_label(struct search *);
00144 GtkCTreeNode *find_parent_with_sha1(GHashTable *ht, gpointer key);
00145 #endif
00146
00147 void search_gui_expand_all(void);
00148 void search_gui_collapse_all(void);
00149
00150 void gui_search_set_enabled(struct search *sch, gboolean enabled);
00151 const GList *search_gui_get_searches(void);
00152
00153 void search_gui_set_clear_button_sensitive(gboolean flag);
00154 void gui_search_get_colors(
00155 search_t *sch,
00156 GdkColor **mark_color, GdkColor **ignore_color, GdkColor **download_color);
00157
00158 void search_gui_start_massive_update(search_t *sch);
00159 void search_gui_end_massive_update(search_t *sch);
00160
00165 void search_gui_metadata_update(const bitzi_data_t *data);
00166
00167
00168
00169
00170 gboolean search_gui_search_results_col_widths_changed(property_t prop);
00171 gboolean search_gui_search_results_col_visible_changed(property_t prop);
00172
00173 void search_gui_queue_bitzi_by_sha1(const record_t *rec, gpointer unused_udata);
00174
00175 #endif
00176
00177
00178