TODO netlogon_user_flags_ntlmv2_enabled
[wireshark-sm.git] / ui / qt / import_text_dialog.h
blob66f42b1162429dec603383b408bebcf6cc03f77b
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef IMPORT_TEXT_DIALOG_H
11 #define IMPORT_TEXT_DIALOG_H
13 #include <config.h>
15 #include <stdio.h>
17 #include "ui/text_import.h"
19 #include <ui/qt/widgets/syntax_line_edit.h>
21 #include <QDialog>
22 #include <QPushButton>
23 #include <QRadioButton>
24 #include <QButtonGroup>
26 namespace Ui {
27 class ImportTextDialog;
30 class ImportTextDialog : public QDialog
32 Q_OBJECT
34 public:
35 explicit ImportTextDialog(QWidget *parent = 0);
36 ~ImportTextDialog();
37 QString &capfileName();
39 private:
40 void enableHeaderWidgets(uint encapsulation = WTAP_ENCAP_ETHERNET);
42 /* regex fields */
43 void enableFieldWidgets(bool enable_direction_input = true, bool enable_time_input = true);
45 void check_line_edit(SyntaxLineEdit *le, bool &ok_enable, const QString &num_str, int base, unsigned max_val, bool is_short, unsigned *val_ptr);
46 void checkAddress(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in4_addr *val_ptr);
47 void checkIPv6Address(SyntaxLineEdit *le, bool &ok_enable, const QString &addr_str, ws_in6_addr *val_ptr);
48 bool checkDateTimeFormat(const QString &time_format);
50 void loadSettingsFile();
51 void saveSettingsFile();
52 void applyDialogSettings();
53 void storeDialogSettings();
55 void updateImportButtonState();
57 Ui::ImportTextDialog *ti_ui_;
58 QVariantMap settings;
60 QPushButton *import_button_;
61 QButtonGroup *encap_buttons;
62 text_import_info_t import_info_;
63 QString capfile_name_;
64 bool file_ok_;
65 bool timestamp_format_ok_;
67 /* Regex input */
68 bool regex_ok_;
69 bool re_has_dir_;
70 bool in_indication_ok_;
71 bool out_indication_ok_;
72 bool re_has_time_;
74 bool ether_type_ok_;
75 bool proto_ok_;
76 bool source_addr_ok_;
77 bool dest_addr_ok_;
78 bool source_port_ok_;
79 bool dest_port_ok_;
80 bool tag_ok_;
81 bool ppi_ok_;
82 bool payload_ok_;
83 bool max_len_ok_;
85 public slots:
86 int exec();
88 private slots:
89 void on_textFileBrowseButton_clicked();
90 void on_textFileLineEdit_textChanged(const QString &arg1);
91 void on_modeTabWidget_currentChanged(int index);
92 void on_timestampFormatLineEdit_textChanged(const QString &arg1);
94 /* Hex Dump input */
95 void on_noOffsetButton_toggled(bool checked);
96 void on_directionIndicationCheckBox_toggled(bool checked);
97 void on_asciiIdentificationCheckBox_toggled(bool checked);
98 void on_littleEndianCheckBox_toggled(bool checked);
100 /* Regex input */
101 void on_regexTextEdit_textChanged();
102 void on_dataEncodingComboBox_currentIndexChanged(int index);
103 void on_dirInIndicationLineEdit_textChanged(const QString &arg1);
104 void on_dirOutIndicationLineEdit_textChanged(const QString &arg1);
106 /* Encapsulation input */
107 void on_encapComboBox_currentIndexChanged(int index);
108 void encap_buttonsToggled(QAbstractButton *button, bool checked);
109 void on_ipVersionComboBox_currentIndexChanged(int index);
110 void on_ethertypeLineEdit_textChanged(const QString &ethertype_str);
111 void on_protocolLineEdit_textChanged(const QString &protocol_str);
112 void on_sourceAddressLineEdit_textChanged(const QString &source_addr_str);
113 void on_destinationAddressLineEdit_textChanged(const QString &destination_addr_str);
114 void on_sourcePortLineEdit_textChanged(const QString &source_port_str);
115 void on_destinationPortLineEdit_textChanged(const QString &destination_port_str);
116 void on_tagLineEdit_textChanged(const QString &tag_str);
117 void on_ppiLineEdit_textChanged(const QString &ppi_str);
119 /* Footer input */
120 void on_maxLengthLineEdit_textChanged(const QString &max_frame_len_str);
121 void on_buttonBox_helpRequested();
125 #endif // IMPORT_TEXT_DIALOG_H