summaryrefslogtreecommitdiff
path: root/externals/qhexedit/qhexedit_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'externals/qhexedit/qhexedit_p.h')
-rw-r--r--externals/qhexedit/qhexedit_p.h128
1 files changed, 0 insertions, 128 deletions
diff --git a/externals/qhexedit/qhexedit_p.h b/externals/qhexedit/qhexedit_p.h
deleted file mode 100644
index 1c2c11cc2..000000000
--- a/externals/qhexedit/qhexedit_p.h
+++ /dev/null
@@ -1,128 +0,0 @@
1#ifndef QHEXEDIT_P_H
2#define QHEXEDIT_P_H
3
4/** \cond docNever */
5
6
7#include <QtGui>
8#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
9#include <QtWidgets>
10#endif
11#include "xbytearray.h"
12
13class QHexEditPrivate : public QWidget
14{
15Q_OBJECT
16
17public:
18 QHexEditPrivate(QScrollArea *parent);
19
20 void setAddressAreaColor(QColor const &color);
21 QColor addressAreaColor();
22
23 void setAddressOffset(int offset);
24 int addressOffset();
25
26 void setCursorPos(int position);
27 int cursorPos();
28
29 void setData(QByteArray const &data);
30 QByteArray data();
31
32 void setHighlightingColor(QColor const &color);
33 QColor highlightingColor();
34
35 void setOverwriteMode(bool overwriteMode);
36 bool overwriteMode();
37
38 void setReadOnly(bool readOnly);
39 bool isReadOnly();
40
41 void setSelectionColor(QColor const &color);
42 QColor selectionColor();
43
44 XByteArray & xData();
45
46 int indexOf(const QByteArray & ba, int from = 0);
47 void insert(int index, const QByteArray & ba);
48 void insert(int index, char ch);
49 int lastIndexOf(const QByteArray & ba, int from = 0);
50 void remove(int index, int len=1);
51 void replace(int index, char ch);
52 void replace(int index, const QByteArray & ba);
53 void replace(int pos, int len, const QByteArray & after);
54
55 void setAddressArea(bool addressArea);
56 void setAddressWidth(int addressWidth);
57 void setAsciiArea(bool asciiArea);
58 void setHighlighting(bool mode);
59 virtual void setFont(const QFont &font);
60
61 void undo();
62 void redo();
63
64 QString toRedableString();
65 QString selectionToReadableString();
66
67signals:
68 void currentAddressChanged(int address);
69 void currentSizeChanged(int size);
70 void dataChanged();
71 void overwriteModeChanged(bool state);
72
73protected:
74 void keyPressEvent(QKeyEvent * event);
75 void mouseMoveEvent(QMouseEvent * event);
76 void mousePressEvent(QMouseEvent * event);
77
78 void paintEvent(QPaintEvent *event);
79
80 int cursorPos(QPoint pos); // calc cursorpos from graphics position. DOES NOT STORE POSITION
81
82 void resetSelection(int pos); // set selectionStart and selectionEnd to pos
83 void resetSelection(); // set selectionEnd to selectionStart
84 void setSelection(int pos); // set min (if below init) or max (if greater init)
85 int getSelectionBegin();
86 int getSelectionEnd();
87
88
89private slots:
90 void updateCursor();
91
92private:
93 void adjust();
94 void ensureVisible();
95
96 QColor _addressAreaColor;
97 QColor _highlightingColor;
98 QColor _selectionColor;
99 QScrollArea *_scrollArea;
100 QTimer _cursorTimer;
101 QUndoStack *_undoStack;
102
103 XByteArray _xData; // Hält den Inhalt des Hex Editors
104
105 bool _blink; // true: then cursor blinks
106 bool _renderingRequired; // Flag to store that rendering is necessary
107 bool _addressArea; // left area of QHexEdit
108 bool _asciiArea; // medium area
109 bool _highlighting; // highlighting of changed bytes
110 bool _overwriteMode;
111 bool _readOnly; // true: the user can only look and navigate
112
113 int _charWidth, _charHeight; // char dimensions (dpendend on font)
114 int _cursorX, _cursorY; // graphics position of the cursor
115 int _cursorPosition; // character positioin in stream (on byte ends in to steps)
116 int _xPosAdr, _xPosHex, _xPosAscii; // graphics x-position of the areas
117
118 int _selectionBegin; // First selected char
119 int _selectionEnd; // Last selected char
120 int _selectionInit; // That's, where we pressed the mouse button
121
122 int _size;
123};
124
125/** \endcond docNever */
126
127#endif
128