• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • gui
  • io
  • streamencoder
  • viewtext
bytearrayrowscolumntextrenderer.h
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef BYTEARRAYROWSCOLUMNTEXTRENDERER_H
24 #define BYTEARRAYROWSCOLUMNTEXTRENDERER_H
25 
26 // lib
27 #include "abstractcolumntextrenderer.h"
28 // Okteta gui
29 #include <coordrange.h>
30 // Okteta core
31 #include <oktetacore.h>
32 // Qt
33 #include <QtCore/QChar>
34 
35 namespace Okteta {
36 class ValueCodec;
37 class CharCodec;
38 class AbstractByteArrayModel;
39 }
40 
41 namespace Kasten2
42 {
43 
44 // TODO: offset should be set in renderFirstLine, calculated using coordRange,
45 // in constructor instead take startOffset
46 class ByteArrayRowsColumnTextRenderer : public AbstractColumnTextRenderer
47 {
48  private:
49  static const int DefaultTRByteSpacingWidth = 1;
50  static const int TRGroupSpacingWidth = 2;
51 
52  public:
53  ByteArrayRowsColumnTextRenderer( const Okteta::AbstractByteArrayModel* byteArrayModel, Okteta::Address offset,
54  const Okteta::CoordRange& coordRange,
55  int noOfBytesPerLine, int byteSpacingWidth, int noOfGroupedBytes,
56  int visibleCodings,
57  Okteta::ValueCoding valueCoding,
58  const QString& charCodecName, QChar substituteChar, QChar undefinedChar );
59  virtual ~ByteArrayRowsColumnTextRenderer();
60 
61  public: // AbstractColumnTextRenderer API
62  virtual void renderFirstLine( QTextStream* stream, int lineIndex ) const;
63  virtual void renderNextLine( QTextStream* stream, bool isSubline ) const;
64  virtual int noOfSublinesNeeded() const;
65 
66  protected:
67  void renderLine( QTextStream* stream, bool isSubline ) const;
68 
69  protected:
70  void setWidths( int byteWidth, int byteSpacingWidth, int noOfGroupedBytes );
71 
72  protected:
73  const Okteta::AbstractByteArrayModel* mByteArrayModel;
74 
75  const Okteta::CoordRange mCoordRange;
76 
77  const int mNoOfBytesPerLine;
78 
79  const int mVisibleCodings;
80  const Okteta::ValueCodec* mValueCodec;
81  const Okteta::CharCodec* mCharCodec;
82  const QChar mSubstituteChar;
83  const QChar mUndefinedChar;
84 
86  mutable int mRenderLine;
88  mutable Okteta::Address mOffset;
89 
91  int mNoOfCharsPerLine;
92  // positions where to paint the
93  int* const mLinePositions;
94 };
95 
96 }
97 
98 #endif
Kasten2::ByteArrayRowsColumnTextRenderer::~ByteArrayRowsColumnTextRenderer
virtual ~ByteArrayRowsColumnTextRenderer()
Definition: bytearrayrowscolumntextrenderer.cpp:177
Okteta::CoordRange
describes a range in the buffercoord
Definition: coordrange.h:51
Okteta::Address
qint32 Address
Definition: address.h:34
Okteta::AbstractByteArrayModel
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
Definition: abstractbytearraymodel.h:79
Kasten2::ByteArrayRowsColumnTextRenderer::mOffset
Okteta::Address mOffset
Data to print.
Definition: bytearrayrowscolumntextrenderer.h:88
Kasten2::ByteArrayRowsColumnTextRenderer::mNoOfBytesPerLine
const int mNoOfBytesPerLine
Definition: bytearrayrowscolumntextrenderer.h:77
Kasten2::AbstractColumnTextRenderer
interface for the text export of columns
Definition: abstractcolumntextrenderer.h:36
Kasten2::ByteArrayRowsColumnTextRenderer::mVisibleCodings
const int mVisibleCodings
Definition: bytearrayrowscolumntextrenderer.h:79
Kasten2::ByteArrayRowsColumnTextRenderer::ByteArrayRowsColumnTextRenderer
ByteArrayRowsColumnTextRenderer(const Okteta::AbstractByteArrayModel *byteArrayModel, Okteta::Address offset, const Okteta::CoordRange &coordRange, int noOfBytesPerLine, int byteSpacingWidth, int noOfGroupedBytes, int visibleCodings, Okteta::ValueCoding valueCoding, const QString &charCodecName, QChar substituteChar, QChar undefinedChar)
Definition: bytearrayrowscolumntextrenderer.cpp:37
Kasten2::ByteArrayRowsColumnTextRenderer::mByteArrayModel
const Okteta::AbstractByteArrayModel * mByteArrayModel
Definition: bytearrayrowscolumntextrenderer.h:73
abstractcolumntextrenderer.h
Kasten2::ByteArrayRowsColumnTextRenderer::renderLine
void renderLine(QTextStream *stream, bool isSubline) const
Definition: bytearrayrowscolumntextrenderer.cpp:112
Okteta::CharCodec
Definition: charcodec.h:42
oktetacore.h
Kasten2::ByteArrayRowsColumnTextRenderer::mLinePositions
int *const mLinePositions
Definition: bytearrayrowscolumntextrenderer.h:93
Okteta::ValueCodec
Class that is able to convert codings to and from hexadecimal, decimal, octal, and binary...
Definition: valuecodec.h:45
Kasten2::ByteArrayRowsColumnTextRenderer::mNoOfCharsPerLine
int mNoOfCharsPerLine
buffered value of how many chars a line needs
Definition: bytearrayrowscolumntextrenderer.h:91
Kasten2::ByteArrayRowsColumnTextRenderer::renderFirstLine
virtual void renderFirstLine(QTextStream *stream, int lineIndex) const
Definition: bytearrayrowscolumntextrenderer.cpp:100
Kasten2::ByteArrayRowsColumnTextRenderer::mValueCodec
const Okteta::ValueCodec * mValueCodec
Definition: bytearrayrowscolumntextrenderer.h:80
Kasten2::ByteArrayRowsColumnTextRenderer::mSubstituteChar
const QChar mSubstituteChar
Definition: bytearrayrowscolumntextrenderer.h:82
Kasten2::ByteArrayRowsColumnTextRenderer::renderNextLine
virtual void renderNextLine(QTextStream *stream, bool isSubline) const
Definition: bytearrayrowscolumntextrenderer.cpp:107
Kasten2::ByteArrayRowsColumnTextRenderer::setWidths
void setWidths(int byteWidth, int byteSpacingWidth, int noOfGroupedBytes)
Definition: bytearrayrowscolumntextrenderer.cpp:66
Okteta::ValueCoding
ValueCoding
Definition: oktetacore.h:34
Kasten2::ByteArrayRowsColumnTextRenderer::mCharCodec
const Okteta::CharCodec * mCharCodec
Definition: bytearrayrowscolumntextrenderer.h:81
Kasten2::ByteArrayRowsColumnTextRenderer::mCoordRange
const Okteta::CoordRange mCoordRange
Definition: bytearrayrowscolumntextrenderer.h:75
Kasten2::ByteArrayRowsColumnTextRenderer::mUndefinedChar
const QChar mUndefinedChar
Definition: bytearrayrowscolumntextrenderer.h:83
coordrange.h
Kasten2::ByteArrayRowsColumnTextRenderer::mRenderLine
int mRenderLine
Line to print.
Definition: bytearrayrowscolumntextrenderer.h:86
Kasten2::ByteArrayRowsColumnTextRenderer
Definition: bytearrayrowscolumntextrenderer.h:46
Kasten2::ByteArrayRowsColumnTextRenderer::noOfSublinesNeeded
virtual int noOfSublinesNeeded() const
default returns 1
Definition: bytearrayrowscolumntextrenderer.cpp:61
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal