File indexing completed on 2024-04-21 16:34:01

0001 /*
0002     This file is part of the Okteta Gui library, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008-2010 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "bytearrayrowview.hpp"
0010 #include "bytearrayrowview_p.hpp"
0011 
0012 namespace Okteta {
0013 
0014 ByteArrayRowView::ByteArrayRowView(QWidget* parent)
0015     : AbstractByteArrayView(new ByteArrayRowViewPrivate(this), parent)
0016 {
0017     Q_D(ByteArrayRowView);
0018     d->init();
0019 }
0020 
0021 ByteArrayRowView::~ByteArrayRowView() = default;
0022 
0023 void ByteArrayRowView::setByteArrayModel(AbstractByteArrayModel* byteArrayModel)
0024 {
0025     Q_D(ByteArrayRowView);
0026     d->setByteArrayModel(byteArrayModel);
0027 }
0028 
0029 PixelX ByteArrayRowView::byteSpacingWidth() const
0030 {
0031     Q_D(const ByteArrayRowView);
0032     return d->byteSpacingWidth();
0033 }
0034 int ByteArrayRowView::noOfGroupedBytes() const
0035 {
0036     Q_D(const ByteArrayRowView);
0037     return d->noOfGroupedBytes();
0038 }
0039 PixelX ByteArrayRowView::groupSpacingWidth() const
0040 {
0041     Q_D(const ByteArrayRowView);
0042     return d->groupSpacingWidth();
0043 }
0044 PixelX ByteArrayRowView::binaryGapWidth() const
0045 {
0046     Q_D(const ByteArrayRowView);
0047     return d->binaryGapWidth();
0048 }
0049 bool ByteArrayRowView::showsNonprinting() const
0050 {
0051     Q_D(const ByteArrayRowView);
0052     return d->showsNonprinting();
0053 }
0054 QChar ByteArrayRowView::substituteChar() const
0055 {
0056     Q_D(const ByteArrayRowView);
0057     return d->substituteChar();
0058 }
0059 QChar ByteArrayRowView::undefinedChar() const
0060 {
0061     Q_D(const ByteArrayRowView);
0062     return d->undefinedChar();
0063 }
0064 bool ByteArrayRowView::isByteTypeColored() const
0065 {
0066     Q_D(const ByteArrayRowView);
0067     return d->isByteTypeColored();
0068 }
0069 void ByteArrayRowView::setBufferSpacing(/*PixelX*/ int byteSpacing, int noOfGroupedBytes, /*PixelX*/ int groupSpacing)
0070 {
0071     Q_D(ByteArrayRowView);
0072     d->setBufferSpacing(byteSpacing, noOfGroupedBytes, groupSpacing);
0073 }
0074 
0075 void ByteArrayRowView::setValueCoding(ValueCoding valueCoding)
0076 {
0077     Q_D(ByteArrayRowView);
0078     d->setValueCoding(valueCoding);
0079 }
0080 
0081 void ByteArrayRowView::setByteSpacingWidth(int /*PixelX*/ byteSpacingWidth)
0082 {
0083     Q_D(ByteArrayRowView);
0084     d->setByteSpacingWidth(byteSpacingWidth);
0085 }
0086 
0087 void ByteArrayRowView::setNoOfGroupedBytes(int noOfGroupedBytes)
0088 {
0089     Q_D(ByteArrayRowView);
0090     d->setNoOfGroupedBytes(noOfGroupedBytes);
0091 }
0092 
0093 void ByteArrayRowView::setGroupSpacingWidth(int /*PixelX*/ groupSpacingWidth)
0094 {
0095     Q_D(ByteArrayRowView);
0096     d->setGroupSpacingWidth(groupSpacingWidth);
0097 }
0098 
0099 void ByteArrayRowView::setBinaryGapWidth(int /*PixelX*/ binaryGapWidth)
0100 {
0101     Q_D(ByteArrayRowView);
0102     d->setBinaryGapWidth(binaryGapWidth);
0103 }
0104 
0105 void ByteArrayRowView::setSubstituteChar(QChar substituteChar)
0106 {
0107     Q_D(ByteArrayRowView);
0108     d->setSubstituteChar(substituteChar);
0109 }
0110 
0111 void ByteArrayRowView::setUndefinedChar(QChar undefinedChar)
0112 {
0113     Q_D(ByteArrayRowView);
0114     d->setUndefinedChar(undefinedChar);
0115 }
0116 
0117 void ByteArrayRowView::setShowsNonprinting(bool showingNonprinting)
0118 {
0119     Q_D(ByteArrayRowView);
0120     d->setShowsNonprinting(showingNonprinting);
0121 }
0122 
0123 void ByteArrayRowView::setCharCoding(CharCoding charCoding)
0124 {
0125     Q_D(ByteArrayRowView);
0126     d->setCharCoding(charCoding);
0127 }
0128 
0129 // TODO: join with function above!
0130 void ByteArrayRowView::setCharCoding(const QString& charCodingName)
0131 {
0132     Q_D(ByteArrayRowView);
0133     d->setCharCoding(charCodingName);
0134 }
0135 
0136 void ByteArrayRowView::setByteTypeColored(bool isColored)
0137 {
0138     Q_D(ByteArrayRowView);
0139     d->setByteTypeColored(isColored);
0140 }
0141 
0142 void ByteArrayRowView::changeEvent(QEvent* event)
0143 {
0144     Q_D(ByteArrayRowView);
0145 
0146     d->changeEvent(event);
0147 }
0148 
0149 QSize ByteArrayRowView::minimumSizeHint() const
0150 {
0151     Q_D(const ByteArrayRowView);
0152     // TODO: better minimal width (visibility!)
0153     return d->minimumSizeHint();
0154 }
0155 
0156 void ByteArrayRowView::renderColumns(QPainter* painter, int cx, int cy, int cw, int ch)
0157 {
0158     Q_D(ByteArrayRowView);
0159     d->renderColumns(painter, cx, cy, cw, ch);
0160 }
0161 
0162 }
0163 
0164 #include "moc_bytearrayrowview.cpp"