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 #ifndef OKTETA_BYTEARRAYROWVIEW_HPP
0010 #define OKTETA_BYTEARRAYROWVIEW_HPP
0011 
0012 // lib
0013 #include "abstractbytearrayview.hpp"
0014 
0015 namespace Okteta {
0016 class ByteArrayRowViewPrivate;
0017 
0018 class OKTETAGUI_EXPORT ByteArrayRowView : public AbstractByteArrayView
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit ByteArrayRowView(QWidget* parent = nullptr);
0024     ~ByteArrayRowView() override;
0025 
0026 public: // AbstractByteArrayView API
0027     // value column
0028     int /*PixelX*/ byteSpacingWidth() const override;
0029     int noOfGroupedBytes() const override;
0030     int /*PixelX*/ groupSpacingWidth() const override;
0031     int /*PixelX*/ binaryGapWidth() const override;
0032 
0033     // char column
0034     bool showsNonprinting() const override;
0035     QChar substituteChar() const override;
0036     QChar undefinedChar() const override;
0037 
0038     bool isByteTypeColored() const override;
0039 
0040     void setByteArrayModel(AbstractByteArrayModel* byteArrayModel) override;
0041     void setByteSpacingWidth(int /*PixelX*/ byteSpacingWidth) override;
0042     void setNoOfGroupedBytes(int noOfGroupedBytes) override;
0043     void setGroupSpacingWidth(int /*PixelX*/ groupSpacingWidth) override;
0044     void setBinaryGapWidth(int binaryGapWidth) override;
0045     void setBufferSpacing(int /*PixelX*/ byteSpacingWidth, int noOfGroupedBytes = 0, int /*PixelX*/ groupSpacingWidth = 0) override;
0046     void setValueCoding(ValueCoding valueCoding) override;
0047     // char column parameters
0048     void setShowsNonprinting(bool showsNonprinting = true) override;
0049     void setSubstituteChar(QChar substituteChar) override;
0050     void setUndefinedChar(QChar undefinedChar) override;
0051     void setCharCoding(CharCoding charCoding) override;
0052     void setCharCoding(const QString& charCodingName) override;
0053     void setByteTypeColored(bool isColored) override;
0054 
0055 public: // ColumnsView API
0056     void renderColumns(QPainter* painter, int cx, int cy, int cw, int ch) override;
0057 
0058 public: // QWidget API
0059     QSize minimumSizeHint() const override;
0060 
0061 public: // logic value service
0062     /** calculates the number of bytes per line that fit into a widget with the given size
0063      * tests whether a vertical scroll bar is needed at all or not due to the given width
0064      * takes the frame width into account
0065      * @param TestSize Size the widget might have
0066      * @return number of bytes per line that fit into a widget with the given size
0067      */
0068 //     int fittingBytesPerLine() const;
0069 
0070 public: // modification access
0071 //    void repaintByte( int row, int column, bool Erase = true );
0072 //    void updateByte( int row, int column );
0073 //    void ensureByteVisible( int row, int column );
0074 
0075 protected: // Q_SLOTS QWidget API
0076     void changeEvent(QEvent* event) override;
0077 
0078 private:
0079     Q_DECLARE_PRIVATE(ByteArrayRowView)
0080 };
0081 
0082 }
0083 
0084 #endif