Logo Search packages:      
Sourcecode: kdeutils version File versions

KHE::KBytesEdit Class Reference

#include <kbytesedit.h>

Inheritance diagram for KHE::KBytesEdit:

KHE::KHexEdit KHE::KColumnsView

List of all members.


Detailed Description

the beginner's hex edit widget ;)

It hides the concept of the KDataBuffer and accepts a pure pointer to a reasonable large array of bytes

1. used as viewer a) static data ranges -> no changes for data pointer and length possible changes are told to the widget by repaintRange b) changing data ranges -> data pointer and length might change changes told by * resetData( char *, int size, bool repaint ); * 2. used as editor a) static data ranges data pointer stays the same b) changing data ranges pointer to the data changes in charge of the widget: given pointer and intermediate pointer are possibly invalid problem: who cares about the array if the data is deleted? -> solved by setAutoDelete()

Author:
Friedrich W. H. Kossebau

Definition at line 56 of file kbytesedit.h.


Public Types

enum  KCoding {
  HexadecimalCoding = 0, DecimalCoding = 1, OctalCoding = 2, BinaryCoding = 3,
  MaxCodingId = 0xFFFF
}
enum  KEncoding { LocalEncoding = 0, ISO8859_1Encoding = 1, MaxEncodingId = 0xFFFF }
enum  KKeyboardAction { ActionDelete, ActionWordDelete, ActionBackspace, ActionWordBackspace }
enum  KMoveAction {
  MoveBackward, MoveWordBackward, MoveForward, MoveWordForward,
  MoveUp, MovePgUp, MoveDown, MovePgDown,
  MoveLineStart, MoveHome, MoveLineEnd, MoveEnd
}
enum  KResizeStyle { NoResize = 0, LockGrouping = 1, FullSizeUsage = 2, MaxResizeStyleId = 0xFF }

Public Slots

virtual void copy ()
virtual void cut ()
bool decByte ()
void doKeyboardAction (KKeyboardAction Action)
void ensureCursorVisible ()
bool goInsideByte ()
void goOutsideByte (bool MoveToNext=false)
bool incByte ()
virtual void insert (const QByteArray &D)
void moveCursor (KMoveAction Action, bool Select)
virtual void paste ()
virtual void pauseCursor (bool LeaveEdit=false)
virtual void removeSelectedData ()
void repaintRange (int i1, int i2)
void selectAll (bool select)
bool selectWord (int Index)
void setAutoDelete (bool AD=true)
void setBinaryGapWidth (int BGW)
void setBufferSpacing (KPixelX ByteSpacingWidth, int NoOfGroupedBytes=0, KPixelX GroupSpacingWidth=0)
void setByteSpacingWidth (int BSW)
void setCoding (KCoding C)
void setData (char *D, int S, int RS=-1, bool KM=true)
void setDataBuffer (KDataBuffer *B)
void setEncoding (KEncoding C)
void setFirstLineOffset (int FLO)
void setGroupSpacingWidth (int GSW)
void setKeepsMemory (bool KM=true)
void setMaxDataSize (int MS)
virtual void setModified (bool b)
virtual void setNoOfBytesPerLine (int NoCpL)
void setNoOfGroupedBytes (int NoGB)
virtual void setOverwriteMode (bool b)
virtual void setOverwriteOnly (bool b)
virtual void setReadOnly (bool RO=true)
void setResizeStyle (KResizeStyle Style)
void setShowUnprintable (bool SU=true)
void setStartOffset (int SO)
void setSubstituteChar (QChar SC)
virtual void setTabChangesFocus (bool b=true)
virtual void startCursor ()
virtual void stopCursor ()
virtual void unpauseCursor ()
virtual void unZoom ()
virtual void zoomIn ()
virtual void zoomIn (int PointInc)
virtual void zoomOut ()
virtual void zoomOut (int PointInc)
virtual void zoomTo (int PointSize)

Signals

void bufferChanged ()
void clicked (int Index)
void copyAvailable (bool Really)
void cursorPositionChanged (int Index)
void cutAvailable (bool Really)
void doubleClicked (int Index)
void inputFailed ()
void selectionChanged ()

Public Member Functions

int binaryGapWidth () const
int byteSpacingWidth () const
KCoding coding () const
char * data () const
int dataSize () const
virtual void drawContents (QPainter *p, int cx, int cy, int cw, int ch)
KEncoding encoding () const
virtual bool eventFilter (QObject *O, QEvent *E)
int firstLineOffset () const
int fittingBytesPerLine (const QSize &TestSize) const
int groupSpacingWidth () const
bool hasSelectedData () const
int indexByPoint (const QPoint &Point) const
bool isAutoDelete () const
bool isModified () const
bool isOverwriteMode () const
bool isOverwriteOnly () const
bool isReadOnly () const
 KBytesEdit (QWidget *Parent=0, const char *Name=0, WFlags F=0)
 KBytesEdit (char *D, int DS, QWidget *Parent=0, const char *Name=0, WFlags F=0)
 KBytesEdit (char *D, int DS, int RS, bool KM, QWidget *Parent=0, const char *Name=0, WFlags F=0)
bool keepsMemory () const
int lineAt (KPixelY y) const
KPixelY lineHeight () const
int maxDataSize () const
virtual QSize minimumSizeHint () const
void moveCursor (KMoveAction Action)
int noOfBytesPerLine () const
int noOfGroupedBytes () const
int noOfLines () const
int noOfLinesPerPage () const
virtual void paintEmptyArea (QPainter *p, int cx, int cy, int cw, int ch)
void placeCursor (const QPoint &Point)
KResizeStyle resizeStyle () const
QByteArray selectedData () const
void setCursorPosition (int Index)
bool showUnprintable () const
virtual QSize sizeHint () const
int startOffset () const
QChar substituteChar () const
bool tabChangesFocus () const
KPixelY totalHeight () const
QSize totalViewSize () const
KPixelX totalWidth () const
KSection visibleLines (KPixelYs YPixels) const
KSection visibleLines () const

Protected Slots

void autoScrollTimerDone ()
void blinkCursor ()
void clipboardChanged ()
virtual void fontChange (const QFont &OldFont)
void startDrag ()

Protected Member Functions

const KBufferColumnactiveColumn () const
KBufferColumnactiveColumn ()
void addColumn (KColumn *C)
void adjustLayoutToSize ()
void adjustToLayoutNoOfBytesPerLine ()
const KCharColumncharColumn () const
KCharColumncharColumn ()
void clean ()
virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
virtual void contentsMouseDoubleClickEvent (QMouseEvent *e)
virtual void contentsMouseMoveEvent (QMouseEvent *e)
virtual void contentsMousePressEvent (QMouseEvent *e)
virtual void contentsMouseReleaseEvent (QMouseEvent *e)
virtual void contentsWheelEvent (QWheelEvent *e)
void createCursorPixmaps ()
KBufferDragdragObject (bool F=false, QWidget *Parent=0) const
bool handleByteEditKey (QKeyEvent *KeyEvent)
void handleInternalDrag (QDropEvent *e)
bool handleLetter (QKeyEvent *KeyEvent)
void handleMouseMove (const QPoint &Point)
bool hasChanged (const KCoordRange &VisibleRange, KCoordRange *ChangedRange) const
const KBufferColumninactiveColumn () const
KBufferColumninactiveColumn ()
virtual void keyPressEvent (QKeyEvent *KeyEvent)
const KOffsetColumnoffsetColumn () const
KOffsetColumnoffsetColumn ()
void paintActiveCursor (bool CursorOn)
void paintEditedByte (bool Edited)
void paintInactiveCursor (bool CursorOn)
void paintLine (KBufferColumn *C, int Line, KSection Positions)
void pasteFromSource (QMimeSource *Source)
void pointPainterToCursor (QPainter &Painter, const KBufferColumn &Column) const
void removeColumn (KColumn *C)
void removeData (KSection Indizes)
void repaintChanged ()
void repaintView ()
virtual void resizeEvent (QResizeEvent *ResizeEvent)
virtual void setLineHeight (KPixelY NewLineHeight)
virtual void setNoOfLines (int NewNoOfLines)
virtual void showEvent (QShowEvent *e)
void syncEditedByte ()
void updateColumn (KColumn &Column)
void updateCursor ()
void updateLength ()
void updateLineBufferSize ()
void updateView ()
void updateViewByWidth ()
void updateWidths ()
const KValueColumnvalueColumn () const
KValueColumnvalueColumn ()

Protected Attributes

KBufferColumnActiveColumn
bool BlinkCursorVisible:1
KBufferCursorBufferCursor
KBufferLayoutBufferLayout
KBufferRangesBufferRanges
char * ByteBuffer
KCharColumnCharColumn
QClipboard::Mode ClipboardMode
QPtrList< KColumnColumns
QTimer * CursorBlinkTimer
bool CursorPaused:1
KCursorCursorPixmaps
KBytesEditPrivate * d
KDataBufferDataBuffer
int DefaultFontSize
int DoubleClickLine
QPoint DoubleClickPoint
QPoint DragStartPoint
bool DragStartPossible:1
QTimer * DragStartTimer
bool EditModeByInsert:1
unsigned char EditValue
KBorderColumnFirstBorderColumn
bool HorizontalGrid
KBufferColumnInactiveColumn
bool InDnD:1
bool InDoubleClick:1
bool InEditMode:1
bool InZooming:1
int LengthOfByteBuffer
QPixmap LineBuffer
KPixelY LineHeight
bool MousePressed:1
int NoOfLines
KOffsetColumnOffsetColumn
unsigned char OldValue
bool OverWrite:1
bool OverWriteOnly:1
QTimer * ScrollTimer
KBorderColumnSecondBorderColumn
KPixelX TotalWidth
QTimer * TrippleClickTimer
KValueColumnValueColumn

Properties

bool AutoDelete
int BinaryGapWidth
int ByteSpacingWidth
KCoding Coding
int DataSize
int FirstLineOffset
int GroupSpacingWidth
int MaxDataSize
bool Modified
int NoOfBytesPerLine
int NoOfGroupedBytes
bool OverwriteMode
bool OverwriteOnly
bool ReadOnly
KResizeStyle ResizeStyle
bool ShowUnprintable
int StartOffset
QChar SubstituteChar
bool TabChangesFocus

Private Member Functions

 KBytesEdit (const KBytesEdit &)
KBytesEditoperator= (const KBytesEdit &)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index