| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
qt_ui_utils.h
Go to the documentation of this file.
1
11
12#ifndef __QT_UI_UTILS_H__
13#define __QT_UI_UTILS_H__
14
15// xxx - copied from ui/gtk/gui_utils.h
16
20
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
111QByteArray gbytes_free_to_qbytearray(GBytes *glib_bytes);
112
122 const QString int_to_qstring(qint64 value, int field_width = 0, int base = 10);
123
131 const QString address_to_qstring(const struct _address *address, bool enclose = false);
132
139 const QString address_to_display_qstring(const struct _address *address);
140
149 const QString val_to_qstring(const uint32_t val, const struct _value_string *vs, const char *fmt)
150G_GNUC_PRINTF(3, 0);
151
160 const QString val_ext_to_qstring(const uint32_t val, struct _value_string_ext *vse, const char *fmt)
161G_GNUC_PRINTF(3, 0);
162
169 const QString range_to_qstring(const range_string *range);
170
177 const QString bits_s_to_qstring(const double bits_s);
178
185 const QString file_size_to_qstring(const int64_t size);
186
193 const QString time_t_to_qstring(time_t ti_time);
194
201QUuid e_guid_t_to_quuid(const struct _e_guid_t &guid);
202
209QString html_escape(const QString plain_string);
210
220QString join_lines(const QString multiline_string);
221
228 void smooth_font_size(QFont &font);
229
236 bool qActionLessThan(const QAction *a1, const QAction *a2);
237
244 bool qStringCaseLessThan(const QString &s1, const QString &s2);
245
252 void desktop_show_in_folder(const QString file_path);
253
261 bool rect_on_screen(const QRect &rect);
262
270QVector<rtpstream_id_t *>qvector_rtpstream_ids_copy(QVector<rtpstream_id_t *> stream_ids);
271
277 void qvector_rtpstream_ids_free(QVector<rtpstream_id_t *> stream_ids);
278
285QString make_filter_based_on_rtpstream_id(QVector<rtpstream_id_t *> stream_ids);
286
295QString openDialogInitialDir();
296
300 void storeLastDir(QString dir);
301
321 bool filePathsMatch(const QString &path1, const QString &path2);
322
323#endif /* __QT_UI_UTILS__H__ */
324
325// XXX Add a routine to fetch the HWND corresponding to a widget using QPlatformIntegration
address
struct _address address
Holds a network or link-layer address of any supported type.
qActionLessThan
bool qActionLessThan(const QAction *a1, const QAction *a2)
Definition qt_ui_utils.cpp:235
bits_s_to_qstring
const QString bits_s_to_qstring(const double bits_s)
Definition qt_ui_utils.cpp:174
gchar_free_to_qbytearray
QByteArray gchar_free_to_qbytearray(char *glib_string)
Definition qt_ui_utils.cpp:68
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:325
int_to_qstring
const QString int_to_qstring(qint64 value, int field_width=0, int base=10)
Definition qt_ui_utils.cpp:99
file_size_to_qstring
const QString file_size_to_qstring(const int64_t size)
Definition qt_ui_utils.cpp:180
html_escape
QString html_escape(const QString plain_string)
Definition qt_ui_utils.cpp:200
gbytearray_free_to_qbytearray
QByteArray gbytearray_free_to_qbytearray(GByteArray *glib_array)
Definition qt_ui_utils.cpp:82
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:155
desktop_show_in_folder
void desktop_show_in_folder(const QString file_path)
Definition qt_ui_utils.cpp:244
storeLastDir
void storeLastDir(QString dir)
Store the directory as last directory being used.
Definition qt_ui_utils.cpp:379
time_t_to_qstring
const QString time_t_to_qstring(time_t ti_time)
Definition qt_ui_utils.cpp:186
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:345
rect_on_screen
bool rect_on_screen(const QRect &rect)
Definition qt_ui_utils.cpp:314
filePathsMatch
bool filePathsMatch(const QString &path1, const QString &path2)
Definition qt_ui_utils.cpp:386
qstring_strdup
char * qstring_strdup(QString q_string)
Definition qt_ui_utils.cpp:60
smooth_font_size
void smooth_font_size(QFont &font)
Definition qt_ui_utils.cpp:220
gstring_free_to_qbytearray
QByteArray gstring_free_to_qbytearray(GString *glib_gstring)
Definition qt_ui_utils.cpp:75
gbytes_free_to_qbytearray
QByteArray gbytes_free_to_qbytearray(GBytes *glib_bytes)
Definition qt_ui_utils.cpp:89
range_to_qstring
const QString range_to_qstring(const range_string *range)
Definition qt_ui_utils.cpp:165
gchar_free_to_qstring
QString gchar_free_to_qstring(char *glib_string)
Definition qt_ui_utils.cpp:64
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:239
join_lines
QString join_lines(const QString multiline_string)
Definition qt_ui_utils.cpp:207
qvector_rtpstream_ids_free
void qvector_rtpstream_ids_free(QVector< rtpstream_id_t * > stream_ids)
Definition qt_ui_utils.cpp:338
openDialogInitialDir
QString openDialogInitialDir()
Return the last directory that had been opened.
Definition qt_ui_utils.cpp:367
rtp_stream.h
_address
Holds a network or link-layer address of any supported type.
Definition address.h:62
_e_guid_t
Represents a GUID/UUID value; may be larger than GUID_LEN so must not be used to directly overlay pac...
Definition guid-utils.h:21
_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:42
range_string
struct _range_string range_string
Maps an inclusive numeric range to a string value, used for table-driven range-to-string lookups.