diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 2bda8f7717adf28da4af0d34fb82f63d2868c31d (patch) | |
tree | 8d927b7b47a90c4adb646482a52613f58acd6f8c /khexedit/lib/kvaluecolumn.h | |
download | tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.tar.gz tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khexedit/lib/kvaluecolumn.h')
-rw-r--r-- | khexedit/lib/kvaluecolumn.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/khexedit/lib/kvaluecolumn.h b/khexedit/lib/kvaluecolumn.h new file mode 100644 index 0000000..cc25929 --- /dev/null +++ b/khexedit/lib/kvaluecolumn.h @@ -0,0 +1,92 @@ +/*************************************************************************** + kvaluecolumn.h - description + ------------------- + begin : Mit Sep 3 2003 + copyright : (C) 2003 by Friedrich W. H. Kossebau + email : Friedrich.W.H@Kossebau.de + ***************************************************************************/ + +/*************************************************************************** + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License version 2 as published by the Free Software Foundation. * + * * + ***************************************************************************/ + + +#ifndef KHE_KVALUECOLUMN_H +#define KHE_KVALUECOLUMN_H + +// lib specific +#include "kbytecodec.h" +#include "kbuffercolumn.h" + + +namespace KHE +{ + +class KBufferRanges; + + +/** buffer column which displays the numerical values of the bytes + * + *@author Friedrich W. H. Kossebau + */ +class KValueColumn : public KBufferColumn +{ + public: + KValueColumn( KColumnsView *CV, KDataBuffer *B, KBufferLayout *L, KBufferRanges *R ); + virtual ~KValueColumn(); + + public: + void paintEditedByte( QPainter *P, char Byte, const QString &EditBuffer ); + + public: // modification access + /** + * returns true if there was a change + */ + bool setCoding( KCoding C ); + /** sets the spacing in the middle of a binary byte in the value column + * @param BinaryGapW spacing in the middle of a binary in pixels + * returns true if there was a change + */ + bool setBinaryGapWidth( KPixelX BGW ); + + + public: // value access + KPixelX binaryGapWidth() const; + KCoding coding() const; + const KByteCodec *byteCodec() const; + + + protected: // KBufferColumn API + virtual void drawByte( QPainter *P, char Byte, KHEChar B, const QColor &Color ) const; + virtual void recalcByteWidth(); + + protected: + void drawCode( QPainter *P, const QString &Code, const QColor &Color ) const; + + protected: // set data + /** */ + KCoding Coding; + /** */ + KByteCodec *ByteCodec; + /** */ + KPixelX BinaryGapWidth; + + protected: // buffered data + /** buffer to hold the formatted coding */ + mutable QString CodedByte; + /** calculated: Offset in pixels of the second half of the binary */ + KPixelX BinaryHalfOffset; +}; + + +inline KPixelX KValueColumn::binaryGapWidth() const { return BinaryGapWidth; } +inline KCoding KValueColumn::coding() const { return Coding; } +inline const KByteCodec *KValueColumn::byteCodec() const { return ByteCodec; } + +} + +#endif |