1 /* coloring_rules_dialog.h
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef COLORING_RULES_DIALOG_H
23 #define COLORING_RULES_DIALOG_H
27 class QAbstractButton;
31 struct _GSList; // This is a completely and totally safe forward declaration, right?
34 class ColoringRulesDialog;
37 #include <QStyledItemDelegate>
39 class ColoringRulesTreeDelegate : public QStyledItemDelegate
44 ColoringRulesTreeDelegate(QObject *parent = 0) : QStyledItemDelegate(parent) {}
45 ~ColoringRulesTreeDelegate() {}
47 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
48 void setTree(QTreeWidget* tree) { tree_ = tree; }
54 void ruleNameChanged(const QString name);
55 void ruleFilterChanged(const QString filter);
58 class ColoringRulesDialog : public QDialog
63 explicit ColoringRulesDialog(QWidget *parent = 0, QString add_filter = QString());
64 ~ColoringRulesDialog();
66 void addColor(struct _color_filter *colorf);
69 void showEvent(QShowEvent *);
73 struct _GSList *createColorFilterList();
74 void on_coloringRulesTreeWidget_itemSelectionChanged();
75 void on_fGPushButton_clicked();
76 void on_bGPushButton_clicked();
77 void on_newToolButton_clicked();
78 void on_deleteToolButton_clicked();
79 void on_copyToolButton_clicked();
80 void on_buttonBox_clicked(QAbstractButton *button);
81 void on_buttonBox_accepted();
82 void on_buttonBox_helpRequested();
85 Ui::ColoringRulesDialog *ui;
86 QPushButton *import_button_;
87 QPushButton *export_button_;
88 ColoringRulesTreeDelegate coloring_rules_tree_delegate_;
89 struct _GSList *conversation_colors_;
91 void addColoringRule(bool disabled, QString name, QString filter, QColor foreground, QColor background, bool start_editing = false);
92 void changeColor(bool foreground = true);
95 #endif // COLORING_RULES_DIALOG_H
103 * indent-tabs-mode: nil
106 * ex: set shiftwidth=4 tabstop=8 expandtab:
107 * :indentSize=4:tabSize=8:noTabs=true: