| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
qt_ui_utils.h
Go to the documentation of this file.
1
12#ifndef __QT_UI_UTILS_H__
13#define __QT_UI_UTILS_H__
14
15// xxx - copied from ui/gtk/gui_utils.h
16
21#include <config.h>
22
23#include <glib.h>
24
25#include "ui/rtp_stream.h"
26
27#include <QString>
28#include <QUuid>
29
30 class QAction;
31 class QFont;
32 class QRect;
33
34#ifdef __cplusplus
35 extern "C" {
36#endif /* __cplusplus */
37
38// These are defined elsewhere in ../gtk/
39#define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
40#define RECENT_KEY_REMOTE_HOST "recent.remote_host"
41
42 struct _address;
43 struct epan_range;
44 struct _e_guid_t;
45
46#ifdef __cplusplus
47}
48#endif /* __cplusplus */
49
50/*
51 * Helper macro, to prevent old-style-cast warnings, when using GList in c++ code
52 */
53#define gxx_list_next(list) ((list) ? ((reinterpret_cast<GList *>(list))->next) : Q_NULLPTR)
54#define gxx_constlist_next(list) ((list) ? ((reinterpret_cast<const GList *>(list))->next) : Q_NULLPTR)
55#define gxx_list_previous(list) ((list) ? ((reinterpret_cast<GList *>(list))->prev) : Q_NULLPTR)
56#define gxx_constlist_previous(list) ((list) ? ((reinterpret_cast<const GList *>(list))->prev) : Q_NULLPTR)
57
58#define gxx_list_data(type, list) ((list) ? ((reinterpret_cast<type>(list->data))) : Q_NULLPTR)
59
66 char *qstring_strdup(QString q_string);
67
75QString gchar_free_to_qstring(char *glib_string);
76
84QByteArray gchar_free_to_qbytearray(char *glib_string);
85
93QByteArray gstring_free_to_qbytearray(GString *glib_gstring);
94
100QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array);
101
111 const QString int_to_qstring(qint64 value, int field_width = 0, int base = 10);
112
120 const QString address_to_qstring(const struct _address *address, bool enclose = false);
121
128 const QString address_to_display_qstring(const struct _address *address);
129
138 const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt)
139G_GNUC_PRINTF(3, 0);
140
149 const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt)
150G_GNUC_PRINTF(3, 0);
151
158 const QString range_to_qstring(const range_string *range);
159
166 const QString bits_s_to_qstring(const double bits_s);
167
174 const QString file_size_to_qstring(const int64_t size);
175
182 const QString time_t_to_qstring(time_t ti_time);
183
190QUuid e_guid_t_to_quuid(const struct _e_guid_t &guid);
191
198QString html_escape(const QString plain_string);
199
209QString join_lines(const QString multiline_string);
210
217 void smooth_font_size(QFont &font);
218
225 bool qActionLessThan(const QAction *a1, const QAction *a2);
226
233 bool qStringCaseLessThan(const QString &s1, const QString &s2);
234
241 void desktop_show_in_folder(const QString file_path);
242
250 bool rect_on_screen(const QRect &rect);
251
258 void set_action_shortcuts_visible_in_context_menu(QList<QAction *> actions);
259
267QVector<rtpstream_id_t *>qvector_rtpstream_ids_copy(QVector<rtpstream_id_t *> stream_ids);
268
274 void qvector_rtpstream_ids_free(QVector<rtpstream_id_t *> stream_ids);
275
282QString make_filter_based_on_rtpstream_id(QVector<rtpstream_id_t *> stream_ids);
283
292QString openDialogInitialDir();
293
297 void storeLastDir(QString dir);
298
318 bool filePathsMatch(const QString &path1, const QString &path2);
319
320#endif /* __QT_UI_UTILS__H__ */
321
322// XXX Add a routine to fetch the HWND corresponding to a widget using QPlatformIntegration
qActionLessThan
bool qActionLessThan(const QAction *a1, const QAction *a2)
Definition qt_ui_utils.cpp:229
bits_s_to_qstring
const QString bits_s_to_qstring(const double bits_s)
Definition qt_ui_utils.cpp:163
gchar_free_to_qbytearray
QByteArray gchar_free_to_qbytearray(char *glib_string)
Definition qt_ui_utils.cpp:67
val_to_qstring
const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt)
qvector_rtpstream_ids_copy
QVector< rtpstream_id_t * > qvector_rtpstream_ids_copy(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:326
int_to_qstring
const QString int_to_qstring(qint64 value, int field_width=0, int base=10)
Definition qt_ui_utils.cpp:88
file_size_to_qstring
const QString file_size_to_qstring(const int64_t size)
Definition qt_ui_utils.cpp:169
html_escape
QString html_escape(const QString plain_string)
Definition qt_ui_utils.cpp:189
gbytearray_free_to_qbytearray
QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array)
Definition qt_ui_utils.cpp:81
e_guid_t_to_quuid
QUuid e_guid_t_to_quuid(const struct _e_guid_t &guid)
val_ext_to_qstring
const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt)
Definition qt_ui_utils.cpp:144
desktop_show_in_folder
void desktop_show_in_folder(const QString file_path)
Definition qt_ui_utils.cpp:238
storeLastDir
void storeLastDir(QString dir)
Store the directory as last directory being used.
Definition qt_ui_utils.cpp:380
time_t_to_qstring
const QString time_t_to_qstring(time_t ti_time)
Definition qt_ui_utils.cpp:175
address_to_display_qstring
const QString address_to_display_qstring(const struct _address *address)
make_filter_based_on_rtpstream_id
QString make_filter_based_on_rtpstream_id(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:346
rect_on_screen
bool rect_on_screen(const QRect &rect)
Definition qt_ui_utils.cpp:308
filePathsMatch
bool filePathsMatch(const QString &path1, const QString &path2)
Definition qt_ui_utils.cpp:387
qstring_strdup
char * qstring_strdup(QString q_string)
Definition qt_ui_utils.cpp:59
smooth_font_size
void smooth_font_size(QFont &font)
Definition qt_ui_utils.cpp:209
gstring_free_to_qbytearray
QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
Definition qt_ui_utils.cpp:74
range_to_qstring
const QString range_to_qstring(const range_string *range)
Definition qt_ui_utils.cpp:154
set_action_shortcuts_visible_in_context_menu
void set_action_shortcuts_visible_in_context_menu(QList< QAction * > actions)
Definition qt_ui_utils.cpp:319
gchar_free_to_qstring
QString gchar_free_to_qstring(char *glib_string)
Definition qt_ui_utils.cpp:63
address_to_qstring
const QString address_to_qstring(const struct _address *address, bool enclose=false)
qStringCaseLessThan
bool qStringCaseLessThan(const QString &s1, const QString &s2)
Definition qt_ui_utils.cpp:233
join_lines
QString join_lines(const QString multiline_string)
Definition qt_ui_utils.cpp:196
qvector_rtpstream_ids_free
void qvector_rtpstream_ids_free(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:339
openDialogInitialDir
QString openDialogInitialDir()
Return the last directory that had been opened.
Definition qt_ui_utils.cpp:368
rtp_stream.h
_address
Definition address.h:58
_e_guid_t
Definition guid-utils.h:23
_range_string
Definition value_string.h:570
_value_string_ext
Extended metadata for a value_string array.
Definition value_string.h:325
_value_string
Mapping between a 32-bit integer value and its string representation.
Definition value_string.h:33
epan_range
Definition range.h:41