1 /* wireshark_application.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 WIRESHARK_APPLICATION_H
23 #define WIRESHARK_APPLICATION_H
31 #include "ui/help_url.h"
33 #include <QApplication>
38 #include <QTranslator>
42 class QSocketNotifier;
46 // - Add from open file
47 // - Check current list
48 // - Signal updated item
50 typedef struct _recent_item_status {
57 class WiresharkApplication : public QApplication
61 explicit WiresharkApplication(int &argc, char **argv);
65 FilterExpressionsChanged,
66 PacketDissectionChanged,
72 void registerUpdate(register_action_e action, const char *message);
73 void emitAppSignal(AppSignal signal);
74 void emitStatCommandSignal(const QString &menu_path, const char *arg, void *userdata);
76 void refreshLocalInterfaces();
77 struct _e_prefs * readConfigurationFiles(char **gdp_path, char **dp_path);
78 QList<recent_item_status *> recentItems() const;
79 void addRecentItem(const QString &filename, qint64 size, bool accessible);
81 void setLastOpenDir(const char *dir_name);
82 void setLastOpenDir(QString *dir_str);
83 void helpTopicAction(topic_action_e action);
84 const QFont monospaceFont() const { return mono_font_; }
85 void setMonospaceFont(const char *font_string);
86 int monospaceTextSize(const char *str);
87 void setConfigurationProfile(const gchar *profile_name);
88 bool isInitialized() { return initialized_; }
89 const QIcon &normalIcon() const { return normal_icon_; }
90 const QIcon &captureIcon() const { return capture_icon_; }
91 const QString &windowTitleSeparator() const { return window_title_separator_; }
92 const QString windowTitleString(QStringList title_parts);
93 const QString windowTitleString(QString title_part) { return windowTitleString(QStringList() << title_part); }
95 QTranslator translator;
96 QTranslator translatorQt;
97 void loadLanguage(const QString& language);
102 QTimer recent_timer_;
103 QTimer addr_resolv_timer_;
104 QTimer tap_update_timer_;
105 QList<QString> pending_open_files_;
106 QSocketNotifier *if_notifier_;
109 static QString window_title_separator_;
112 bool event(QEvent *event);
115 void appInitialized();
116 void localInterfaceListChanged();
117 void openCaptureFile(QString &cf_path, QString &display_filter, unsigned int type);
118 void recentFilesRead();
119 void updateRecentItemStatus(const QString &filename, qint64 size, bool accessible);
120 void splashUpdate(register_action_e action, const char *message);
121 void profileChanging();
122 void profileNameChanged(const gchar *profile_name);
124 void columnsChanged(); // XXX This recreates the packet list. We might want to rename it accordingly.
125 void filterExpressionsChanged();
126 void packetDissectionChanged();
127 void preferencesChanged();
128 void addressResolutionChanged();
129 void fieldsChanged();
131 void openStatCommandDialog(const QString &menu_path, const char *arg, void *userdata);
134 void clearRecentItems();
135 void captureFileReadStarted();
140 void ifChangeEventsAvailable();
141 void itemStatusFinished(const QString filename = "", qint64 size = 0, bool accessible = false);
142 void refreshRecentFiles(void);
143 void refreshAddressResolution(void);
146 extern WiresharkApplication *wsApp;
148 /** Global compile time version string */
149 extern GString *comp_info_str;
150 /** Global runtime version string */
151 extern GString *runtime_info_str;
153 #endif // WIRESHARK_APPLICATION_H
161 * indent-tabs-mode: nil
164 * ex: set shiftwidth=4 tabstop=8 expandtab:
165 * :indentSize=4:tabSize=8:noTabs=true: