File indexing completed on 2025-01-05 05:23:53

0001 /*
0002     This file is part of the Okteta Kasten module, 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 KASTEN_OFFSETCOLUMNTEXTRENDERER_HPP
0010 #define KASTEN_OFFSETCOLUMNTEXTRENDERER_HPP
0011 
0012 // lib
0013 #include "abstractcolumntextrenderer.hpp"
0014 // Okteta gui
0015 #include <Okteta/OffsetFormat>
0016 
0017 namespace Kasten {
0018 
0019 class OffsetColumnTextRenderer : public AbstractColumnTextRenderer
0020 {
0021 public:
0022     OffsetColumnTextRenderer(int offsetFormat, int firstLineOffset, int delta);
0023     ~OffsetColumnTextRenderer() override;
0024 
0025 public: // AbstractColumnTextRenderer API
0026     void renderFirstLine(QTextStream* stream, int lineIndex) const override;
0027     void renderNextLine(QTextStream* stream, bool isSubline) const override;
0028 
0029 private:
0030     void renderLine(QTextStream* stream, bool isSubline) const;
0031 
0032 private:
0033     const int mFirstLineOffset;
0034     const int mDelta;
0035     const Okteta::OffsetFormat::print printFunction;
0036     const int mCodingWidth;
0037 
0038     /** the line we are in */
0039     mutable int mRenderLine;
0040     mutable char* mEncodedOffsetBuffer;
0041 };
0042 
0043 }
0044 
0045 #endif