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

0001 /*
0002     This file is part of the Okteta Gui library, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2003, 2008 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_CHARBYTEARRAYCOLUMNRENDERER_HPP
0010 #define OKTETA_CHARBYTEARRAYCOLUMNRENDERER_HPP
0011 
0012 // lib
0013 #include "abstractbytearraycolumnrenderer.hpp"
0014 
0015 namespace Okteta {
0016 
0017 class CharByteArrayColumnRendererPrivate;
0018 
0019 /** buffer column that interprets the bytes as chars
0020  *
0021  * @author Friedrich W. H. Kossebau
0022  */
0023 class OKTETAGUI_EXPORT CharByteArrayColumnRenderer : public AbstractByteArrayColumnRenderer
0024 {
0025 public:
0026     CharByteArrayColumnRenderer(AbstractColumnStylist* stylist,
0027                                 AbstractByteArrayModel* byteArrayModel, ByteArrayTableLayout* layout, ByteArrayTableRanges* ranges);
0028     ~CharByteArrayColumnRenderer() override;
0029 
0030 public: // modification access
0031     /** sets whether "unprintable" chars (>32) should be displayed in the char column
0032      * with their corresponding character.
0033      * @param showingNonprinting
0034      * returns true if there was a change
0035      */
0036     bool setShowingNonprinting(bool showingNonprinting = true);
0037     /** sets the substitute character for "unprintable" chars
0038      * returns true if there was a change
0039      */
0040     bool setSubstituteChar(QChar substituteChar);
0041     /** sets the undefined character for "undefined" chars
0042      * returns true if there was a change
0043      */
0044     bool setUndefinedChar(QChar undefinedChar);
0045 
0046 public: // value access
0047     /** returns true if "unprintable" chars (>32) are displayed in the char column
0048      * with their corresponding character, default is false
0049      */
0050     bool isShowingNonprinting() const;
0051     /** returns the actually used substitute character for "unprintable" chars, default is '.' */
0052     QChar substituteChar() const;
0053     /** returns the actually used undefined character for "undefined" chars, default is '?' */
0054     QChar undefinedChar() const;
0055 
0056 private:
0057     Q_DECLARE_PRIVATE(CharByteArrayColumnRenderer)
0058 };
0059 
0060 }
0061 
0062 #endif