Added "Ignore Packet" menu items to the main menu.
[obnox/wireshark/wip.git] / gtk / new_packet_list.h
1 /* new_packet_list.h
2  *
3  * $Id$
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
22  * USA.
23  */
24
25 #ifndef __NEW_PACKET_LIST_H__
26 #define __NEW_PACKET_LIST_H__
27
28 #ifdef NEW_PACKET_LIST
29 #include <gtk/gtk.h>
30
31 #define RECENT_KEY_COL_WIDTH                "column.width"
32
33 typedef enum {
34   COLUMN_SELECTED_SORT_ASCENDING,
35   COLUMN_SELECTED_SORT_DESCENDING,
36   COLUMN_SELECTED_SORT_NONE,
37   COLUMN_SELECTED_ALIGN_LEFT,
38   COLUMN_SELECTED_ALIGN_CENTER,
39   COLUMN_SELECTED_ALIGN_RIGHT,
40   COLUMN_SELECTED_ALIGN_DEFAULT,
41   COLUMN_SELECTED_RESIZE,
42   COLUMN_SELECTED_RENAME,
43   COLUMN_SELECTED_REMOVE
44 } COLUMN_SELECTED_E;
45
46 GtkWidget *new_packet_list_create(void);
47 void new_packet_list_recreate(void);
48 void new_packet_list_column_menu_cb (GtkWidget *w, gpointer data, COLUMN_SELECTED_E action);
49 void new_packet_list_resize_columns_cb(GtkWidget *widget _U_, gpointer data _U_);
50 gboolean new_packet_list_get_event_row_column(GdkEventButton *event_button, gint *physical_row, gint *row, gint *column);
51
52 /** Set the font of the packet list window.
53  *
54  * @param font new font
55  */
56 extern void new_packet_list_set_font(PangoFontDescription *font);
57
58 /** Mark the currently selected packet.
59  *
60  * @param widget parent widget (unused)
61  * @param data unused
62  */
63 extern void new_packet_list_mark_frame_cb(GtkWidget *widget, gpointer data);
64
65 /** Mark all packets in the list.
66  *
67  * @param widget parent widget (unused)
68  * @param data unused
69  */
70 void new_packet_list_mark_all_frames_cb(GtkWidget *w _U_, gpointer data _U_);
71
72 /** Unmark all packets in the list.
73  *
74  * @param widget parent widget (unused)
75  * @param data unused
76  */
77 void new_packet_list_unmark_all_frames_cb(GtkWidget *w _U_, gpointer data _U_);
78
79 /** Ignore the currently selected packet.
80  *
81  * @param widget parent widget (unused)
82  * @param data unused
83  */
84 extern void new_packet_list_ignore_frame_cb(GtkWidget *widget, gpointer data);
85
86 /** Un-ignore all packets in the list.
87  *
88  * @param widget parent widget (unused)
89  * @param data unused
90  */
91 extern void new_packet_list_unignore_all_frames_cb(GtkWidget *w _U_, gpointer data _U_);
92
93 /* Different modes of copying summary data */
94 typedef enum {
95     CS_TEXT, /* Packet summary data (tab separated) */
96     CS_CSV   /* Packet summary data (comma separated) */
97 } copy_summary_type;
98
99 /** Called when user clicks on menu item to copy summary data.
100  *
101  *  @param w Not used.
102  *  @param data Not used.
103  *  @param copy_type Mode in which to copy data (e.g. tab-separated, CSV)
104  */
105 void new_packet_list_copy_summary_cb(GtkWidget * w _U_, gpointer data _U_, copy_summary_type copy_type);
106
107 /** Write all packet list geometry values to the recent file.
108  *
109  *  @param rf recent file handle from caller
110  */
111 extern void new_packet_list_recent_write_all(FILE *rf);
112
113 GtkWidget * new_packet_list_get_widget(void);
114 void new_packet_list_colorize_packets(void);
115
116 /** Set the selection mode of the packet list window.
117  *
118  * @param val TRUE for GTK_SELECTION_SINGLE, FALSE for GTK_SELECTION_BROWSE
119  * @param force_set TRUE to force setting of the selection mode even if it
120  *                  was already set (used within packet_list_recreate).
121  */
122 extern void new_packet_list_set_sel_browse(gboolean val, gboolean force_set);
123
124 #endif /* NEW_PACKET_LIST */
125
126 #endif /* __NEW_PACKET_LIST_H__ */