From 2bda8f7717adf28da4af0d34fb82f63d2868c31d Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- khexedit/lib/koffsetcolumn.h | 109 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 khexedit/lib/koffsetcolumn.h (limited to 'khexedit/lib/koffsetcolumn.h') diff --git a/khexedit/lib/koffsetcolumn.h b/khexedit/lib/koffsetcolumn.h new file mode 100644 index 0000000..ae182f9 --- /dev/null +++ b/khexedit/lib/koffsetcolumn.h @@ -0,0 +1,109 @@ +/*************************************************************************** + koffsetcolumn.h - description + ------------------- + begin : Mit Mai 14 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_KOFFSETCOLUMN_H +#define KHE_KOFFSETCOLUMN_H + +// lib specific +#include "koffsetformat.h" +#include "kcolumn.h" + +namespace KHE +{ + +/** + *@author Friedrich W. H. Kossebau + */ + +class KOffsetColumn : public KColumn +{ + public: + KOffsetColumn( KColumnsView *V, int FLO, int D, KOffsetFormat::KFormat F ); + virtual ~KOffsetColumn(); + + public: // KColumn API + virtual void paintFirstLine( QPainter *P, KPixelXs Xs, int FirstLine ); + virtual void paintNextLine( QPainter *P ); + virtual void paintEmptyColumn( QPainter *P, KPixelXs Xs, KPixelYs Ys ); + + + public: + void setFirstLineOffset( int FLO ); + void setDelta( int D ); + + void setFormat( KOffsetFormat::KFormat F ); + /** sets width of digits and recalculates depend sizes */ + void setDigitWidth( KPixelX DW ); + /** */ + void setMetrics( KPixelX DW, KPixelY DBL ); + + public: // read access + int delta() const; + int firstLineOffset() const; + int codingWidth() const; + KOffsetFormat::print printFunction() const; + + + protected: + /** recalculates all x values */ + void recalcX(); + /** paints full line */ + void paintLine( QPainter *P, int Line ); + + + protected: // user settings + /** starting offset of the first line + * if different from StartOffset results in leading space + */ + int FirstLineOffset; + /** offset delta per line */ + int Delta; + + protected: // pixel related + /** size of the line margin */ + int Margin; + /** */ + KPixelX DigitWidth; + /** */ + KPixelY DigitBaseLine; + + protected: // general layout + KOffsetFormat::KFormat Format; + + int CodingWidth; + KOffsetFormat::print PrintFunction; + + /** buffer to hold the formatted coding */ + mutable char CodedOffset[KOffsetFormat::MaxFormatWidth+1]; + + protected: // firstnext trips related + /** */ + int PaintLine; +}; + + +inline int KOffsetColumn::firstLineOffset() const { return FirstLineOffset; } +inline void KOffsetColumn::setFirstLineOffset( int FLO ) { FirstLineOffset = FLO; } +inline int KOffsetColumn::delta() const { return Delta; } +inline void KOffsetColumn::setDelta( int D ) { Delta = D; } + +inline int KOffsetColumn::codingWidth() const { return CodingWidth; } +inline KOffsetFormat::print KOffsetColumn::printFunction() const { return PrintFunction; } + +} + +#endif -- cgit v1.2.1