update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / ui / qt / utils / data_printer.h
blob52c259f899adbb4b46594d4ee260c61419ca37db
1 /** @file
3 * Used by ByteView and others, to create data dumps in printable
4 * form
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef DATA_PRINTER_H
14 #define DATA_PRINTER_H
16 #include <config.h>
18 #include <QObject>
19 #include <QActionGroup>
21 #include <ui/qt/utils/idata_printable.h>
23 class DataPrinter : public QObject
25 Q_OBJECT
26 public:
27 explicit DataPrinter(QObject *parent = 0);
29 enum DumpType {
30 DP_HexDump,
31 DP_HexOnly,
32 DP_HexStream,
33 DP_UTF8Text,
34 DP_ASCIIText,
35 DP_CString,
36 DP_GoLiteral,
37 DP_CArray,
38 DP_MimeData,
39 DP_Base64
42 void toClipboard(DataPrinter::DumpType type, IDataPrintable * printable);
44 void setByteLineLength(int);
45 int byteLineLength() const;
46 // Insert a space after this many bytes
47 static int separatorInterval() { return 8; }
48 // The number of hexadecimal characters per line
49 static int hexChars();
51 static QActionGroup * copyActions(QObject * copyClass, QObject * data = Q_NULLPTR);
52 static DataPrinter * instance();
54 protected slots:
55 void copyIDataBytes(bool);
57 private:
58 QString hexTextDump(const QByteArray printData, bool showASCII);
59 void binaryDump(const QByteArray printData);
61 int byteLineLength_;
64 #endif // DATA_PRINTER_H