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: 2023 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_OFFSETCOLUMNHTMLRENDERER_HPP
0010 #define KASTEN_OFFSETCOLUMNHTMLRENDERER_HPP
0011 
0012 // lib
0013 #include "abstractcolumnhtmlrenderer.hpp"
0014 // Okteta gui
0015 #include <Okteta/OffsetFormat>
0016 
0017 namespace Kasten {
0018 
0019 class OffsetColumnHtmlRenderer : public AbstractColumnHtmlRenderer
0020 {
0021 public:
0022     OffsetColumnHtmlRenderer(int offsetFormat, int firstLineOffset, int delta, bool columnMode);
0023     ~OffsetColumnHtmlRenderer() override;
0024 
0025 public: // AbstractColumnHtmlRenderer 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     const bool mColumnMode;
0038 
0039     /** the line we are in */
0040     mutable int mRenderLine;
0041     mutable char* mEncodedOffsetBuffer;
0042 };
0043 
0044 }
0045 
0046 #endif