okteta
abstractbytearraycolumntextrenderer.h
Go to the documentation of this file.00001 /* 00002 This file is part of the Okteta Kakao module, part of the KDE project. 00003 00004 Copyright 2003,2008 Friedrich W. H. Kossebau <kossebau@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Lesser General Public 00008 License as published by the Free Software Foundation; either 00009 version 2.1 of the License, or (at your option) version 3, or any 00010 later version accepted by the membership of KDE e.V. (or its 00011 successor approved by the membership of KDE e.V.), which shall 00012 act as a proxy defined in Section 6 of version 3 of the license. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public 00020 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 00023 #ifndef ABSTRACTBYTEARRAYCOLUMNTEXTRENDERER_H 00024 #define ABSTRACTBYTEARRAYCOLUMNTEXTRENDERER_H 00025 00026 // lib 00027 #include "abstractcolumntextrenderer.h" 00028 // Okteta gui 00029 #include <coordrange.h> 00030 // Qt 00031 #include <QtCore/QString> 00032 00033 namespace KHECore { 00034 class KAbstractByteArrayModel; 00035 } 00036 00037 // TODO: offset should be set in renderFirstLine, calculated using coordRange, 00038 // in constructor instead take startOffset 00039 class AbstractByteArrayColumnTextRenderer : public AbstractColumnTextRenderer 00040 { 00041 protected: 00042 static QString whiteSpace( uint s ); 00043 00044 public: 00045 AbstractByteArrayColumnTextRenderer( const KHECore::KAbstractByteArrayModel *byteArrayModel, int offset, 00046 const KHEUI::CoordRange &coordRange, 00047 int noOfBytesPerLine ); 00048 virtual ~AbstractByteArrayColumnTextRenderer(); 00049 00050 public: // AbstractColumnTextRenderer API 00051 virtual void renderFirstLine( QTextStream *stream, int lineIndex ) const; 00052 virtual void renderNextLine( QTextStream *stream ) const; 00053 00054 protected: // API to be reimplemented by subclasses 00055 virtual void renderLine( QTextStream *stream ) const = 0; 00056 00057 protected: 00058 void setWidths( int byteWidth, int byteSpacingWidth, int noOfGroupedBytes ); 00059 00060 protected: 00061 const KHECore::KAbstractByteArrayModel *mByteArrayModel; 00062 00063 const KHEUI::CoordRange mCoordRange; 00064 00065 const int mNoOfBytesPerLine; 00066 00068 mutable int mRenderLine; 00070 mutable int mOffset; 00071 00073 int mNoOfCharsPerLine; 00074 // positions where to paint the 00075 int *mLinePositions; 00076 }; 00077 00078 #endif
KDE 4.2 API Reference