File indexing completed on 2024-04-14 15:52:55

0001 /*
0002     This file is part of the Okteta Gui library, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2003, 2008, 2019 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 #ifndef OKTETA_VALUEBYTEARRAYCOLUMNRENDERER_HPP
0010 #define OKTETA_VALUEBYTEARRAYCOLUMNRENDERER_HPP
0011 
0012 // lib
0013 #include "abstractbytearraycolumnrenderer.hpp"
0014 // Okteta core
0015 #include <Okteta/Byte>
0016 
0017 namespace Okteta {
0018 
0019 class ValueCodec;
0020 
0021 class ValueByteArrayColumnRendererPrivate;
0022 
0023 /** buffer column which displays the numerical values of the bytes
0024  *
0025  * @author Friedrich W. H. Kossebau
0026  */
0027 class OKTETAGUI_EXPORT ValueByteArrayColumnRenderer : public AbstractByteArrayColumnRenderer
0028 {
0029 public:
0030     ValueByteArrayColumnRenderer(AbstractColumnStylist* stylist,
0031                                  AbstractByteArrayModel* byteArrayModel, ByteArrayTableLayout* layout, ByteArrayTableRanges* ranges);
0032 
0033     ~ValueByteArrayColumnRenderer() override;
0034 
0035 public:
0036     void renderEditedByte(QPainter* painter, Byte byte, const QString& editBuffer);
0037 
0038 public: // modification access
0039     void setValueCodec(ValueCoding valueCoding, const ValueCodec* valueCodec);
0040     /** sets the spacing in the middle of a binary byte in the value column
0041      * @param binaryGapWidth spacing in the middle of a binary in pixels
0042      * returns true if there was a change
0043      */
0044     bool setBinaryGapWidth(PixelX binaryGapWidth);
0045 
0046 public: // value access
0047     PixelX binaryGapWidth() const;
0048 
0049 private:
0050     Q_DECLARE_PRIVATE(ValueByteArrayColumnRenderer)
0051 };
0052 
0053 }
0054 
0055 #endif