Added "Ignore Packet" menu items to the main menu.
[obnox/wireshark/wip.git] / gtk / main_packet_list.h
1 /* main_packet_list.h
2  * Declarations of GTK+-specific routines for managing the packet list.
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23  */
24
25 #ifndef __PACKET_LIST_H__
26 #define __PACKET_LIST_H__
27
28 #ifndef NEW_PACKET_LIST
29
30 #define RECENT_KEY_COL_WIDTH                "column.width"
31
32 /** @file
33  *  Packet list pane.
34  *  @ingroup main_window_group
35  */
36
37 typedef enum {
38    COLUMN_SELECTED_SORT_ASCENDING,
39    COLUMN_SELECTED_SORT_DESCENDING,
40    COLUMN_SELECTED_SORT_NONE,
41    COLUMN_SELECTED_ALIGN_LEFT,
42    COLUMN_SELECTED_ALIGN_CENTER,
43    COLUMN_SELECTED_ALIGN_RIGHT,
44    COLUMN_SELECTED_RESIZE,
45    COLUMN_SELECTED_RENAME,
46    COLUMN_SELECTED_REMOVE
47 } COLUMN_SELECTED_E;
48
49 /** Create a new packet list.
50  *
51  * @param prefs current preferences
52  * @return the new packet list
53  */
54 extern GtkWidget *packet_list_new(e_prefs *prefs);
55
56 /** Recreate the packet list (for use after columns are changed) */
57 extern void packet_list_recreate(void);
58
59 /** Fill in column titles.  This must be done after the top level window
60  *  is displayed.
61  *
62  * @todo is that still true, with fixed-width columns?
63  */
64 extern void packet_list_set_column_titles(void);
65
66 extern void packet_list_column_menu_cb (GtkWidget *w, gpointer data, COLUMN_SELECTED_E action);
67
68 /** Resize columns
69  *
70  * @param widget parent widget (unused)
71  * @param data unused
72  */
73 extern void packet_list_resize_columns_cb(GtkWidget *widget, gpointer data);
74
75 /** Mark the currently selected packet.
76  *
77  * @param widget parent widget (unused)
78  * @param data unused
79  */
80 extern void packet_list_mark_frame_cb(GtkWidget *widget, gpointer data);
81
82 /** Mark all packets in the list.
83  *
84  * @param widget parent widget (unused)
85  * @param data unused
86  */
87 extern void packet_list_mark_all_frames_cb(GtkWidget *widget, gpointer data);
88
89 /** Unmark all packets in the list.
90  *
91  * @param widget parent widget (unused)
92  * @param data unused
93  */
94 extern void packet_list_unmark_all_frames_cb(GtkWidget *widget, gpointer data);
95
96 /** Update packet marks. */
97 extern void packet_list_update_marked_frames(void);
98
99 /** Ignore the currently selected packet.
100  *
101  * @param widget parent widget (unused)
102  * @param data unused
103  */
104 extern void packet_list_ignore_frame_cb(GtkWidget *w _U_, gpointer data _U_);
105
106 /** Un-ignore all packets in the list.
107  *
108  * @param widget parent widget (unused)
109  * @param data unused
110  */
111 extern void packet_list_unignore_all_frames_cb(GtkWidget *w _U_, gpointer data _U_);
112
113 /** Update ignored packages. */
114 extern void packet_list_update_ignored_frames(void);
115
116 /** Gdk button click appeared, get row and column number in packet list from that position.
117  *
118  * @param widget the packet list widget from packet_list_new()
119  * @param event_button the button event clicked
120  * @param row the row in the packet list
121  * @param column the column in the packet list
122  * @return TRUE if row/column is returned and in range
123  */
124 extern gboolean packet_list_get_event_row_column(GtkWidget *widget,
125     GdkEventButton *event_button, gint *row, gint *column);
126
127 /** Set the font of the packet list.
128  *
129  * @param font the new font
130  */
131 extern void packet_list_set_font(PangoFontDescription *font);
132
133 /** Set the selection mode of the packet list window.
134  *
135  * @param val TRUE for GTK_SELECTION_SINGLE, FALSE for GTK_SELECTION_BROWSE
136  * @param force_set TRUE to force setting of the selection mode even if it
137  *                  was already set (used within packet_list_recreate).
138  */
139 extern void packet_list_set_sel_browse(gboolean val, gboolean force_set);
140
141 /** Check to see if the packet list is at its end.  Toggles automatic
142  * scrolling if needed.
143  *
144  * @return TRUE if packet list is scrolled to greater than 90% of its total length.
145  */
146 extern gboolean packet_list_check_end(void);
147
148 /* Different modes of copying summary data */
149 typedef enum {
150     CS_TEXT, /* Packet summary data (tab separated) */
151     CS_CSV   /* Packet summary data (comma separated) */
152 } copy_summary_type;
153
154 /** Called when user clicks on menu item to copy summary data.
155  *
156  *  @param w Not used.
157  *  @param data Not used.
158  *  @param copy_type Mode in which to copy data (e.g. tab-separated, CSV)
159  */
160 extern void packet_list_copy_summary_cb(GtkWidget * w _U_, gpointer data _U_, copy_summary_type copy_type);
161
162 /** Write all packet list geometry values to the recent file.
163  *
164  *  @param rf recent file handle from caller
165  */
166 extern void packet_list_recent_write_all(FILE *rf);
167
168 #endif /* NEW_PACKET_LIST */
169
170 #endif /* __PACKET_LIST_H__ */