summaryrefslogtreecommitdiffstats
path: root/externals/qhexedit/qhexedit.cpp
blob: b12624e08504c597417eef8b833ccda9a11d6857 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#include <QtGui>

#include "qhexedit.h"


QHexEdit::QHexEdit(QWidget *parent) : QScrollArea(parent)
{
    qHexEdit_p = new QHexEditPrivate(this);
    setWidget(qHexEdit_p);
    setWidgetResizable(true);

    connect(qHexEdit_p, SIGNAL(currentAddressChanged(int)), this, SIGNAL(currentAddressChanged(int)));
    connect(qHexEdit_p, SIGNAL(currentSizeChanged(int)), this, SIGNAL(currentSizeChanged(int)));
    connect(qHexEdit_p, SIGNAL(dataChanged()), this, SIGNAL(dataChanged()));
    connect(qHexEdit_p, SIGNAL(overwriteModeChanged(bool)), this, SIGNAL(overwriteModeChanged(bool)));
    setFocusPolicy(Qt::NoFocus);
}

int QHexEdit::indexOf(const QByteArray & ba, int from) const
{
    return qHexEdit_p->indexOf(ba, from);
}

void QHexEdit::insert(int i, const QByteArray & ba)
{
    qHexEdit_p->insert(i, ba);
}

void QHexEdit::insert(int i, char ch)
{
    qHexEdit_p->insert(i, ch);
}

int QHexEdit::lastIndexOf(const QByteArray & ba, int from) const
{
    return qHexEdit_p->lastIndexOf(ba, from);
}

void QHexEdit::remove(int pos, int len)
{
    qHexEdit_p->remove(pos, len);
}

void QHexEdit::replace( int pos, int len, const QByteArray & after)
{
    qHexEdit_p->replace(pos, len, after);
}

QString QHexEdit::toReadableString()
{
    return qHexEdit_p->toRedableString();
}

QString QHexEdit::selectionToReadableString()
{
    return qHexEdit_p->selectionToReadableString();
}

void QHexEdit::setAddressArea(bool addressArea)
{
    qHexEdit_p->setAddressArea(addressArea);
}

void QHexEdit::redo()
{
    qHexEdit_p->redo();
}

void QHexEdit::undo()
{
    qHexEdit_p->undo();
}

void QHexEdit::setAddressWidth(int addressWidth)
{
    qHexEdit_p->setAddressWidth(addressWidth);
}

void QHexEdit::setAsciiArea(bool asciiArea)
{
    qHexEdit_p->setAsciiArea(asciiArea);
}

void QHexEdit::setHighlighting(bool mode)
{
    qHexEdit_p->setHighlighting(mode);
}

void QHexEdit::setAddressOffset(int offset)
{
    qHexEdit_p->setAddressOffset(offset);
}

int QHexEdit::addressOffset()
{
    return qHexEdit_p->addressOffset();
}

void QHexEdit::setCursorPosition(int cursorPos)
{
    // cursorPos in QHexEditPrivate is the position of the textcoursor without
    // blanks, means bytePos*2
    qHexEdit_p->setCursorPos(cursorPos*2);
}

int QHexEdit::cursorPosition()
{
    return qHexEdit_p->cursorPos() / 2;
}


void QHexEdit::setData(const QByteArray &data)
{
    qHexEdit_p->setData(data);
}

QByteArray QHexEdit::data()
{
    return qHexEdit_p->data();
}

void QHexEdit::setAddressAreaColor(const QColor &color)
{
    qHexEdit_p->setAddressAreaColor(color);
}

QColor QHexEdit::addressAreaColor()
{
    return qHexEdit_p->addressAreaColor();
}

void QHexEdit::setHighlightingColor(const QColor &color)
{
    qHexEdit_p->setHighlightingColor(color);
}

QColor QHexEdit::highlightingColor()
{
    return qHexEdit_p->highlightingColor();
}

void QHexEdit::setSelectionColor(const QColor &color)
{
    qHexEdit_p->setSelectionColor(color);
}

QColor QHexEdit::selectionColor()
{
    return qHexEdit_p->selectionColor();
}

void QHexEdit::setOverwriteMode(bool overwriteMode)
{
    qHexEdit_p->setOverwriteMode(overwriteMode);
}

bool QHexEdit::overwriteMode()
{
    return qHexEdit_p->overwriteMode();
}

void QHexEdit::setReadOnly(bool readOnly)
{
    qHexEdit_p->setReadOnly(readOnly);
}

bool QHexEdit::isReadOnly()
{
    return qHexEdit_p->isReadOnly();
}

void QHexEdit::setFont(const QFont &font)
{
    qHexEdit_p->setFont(font);
}

const QFont & QHexEdit::font() const
{
    return qHexEdit_p->font();
}