23 #ifndef OKTETA_ABSTRACTBYTEARRAYVIEW_H
24 #define OKTETA_ABSTRACTBYTEARRAYVIEW_H
31 #include <QtGui/QClipboard>
41 class AbstractByteArrayModel;
45 class AbstractWheelController;
46 class ByteArrayTableLayout;
47 class ByteArrayTableCursor;
48 class ByteArrayTableRanges;
51 class AbstractByteArrayViewPrivate;
68 Q_PROPERTY(
bool OverwriteMode READ isOverwriteMode WRITE setOverwriteMode )
69 Q_PROPERTY(
bool OverwriteOnly READ isOverwriteOnly WRITE setOverwriteOnly )
70 Q_PROPERTY(
bool Modified READ isModified WRITE setModified DESIGNABLE false )
71 Q_PROPERTY(
bool ReadOnly READ isReadOnly WRITE setReadOnly )
75 Q_PROPERTY(
bool TabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus )
77 Q_PROPERTY(
int NoOfBytesPerLine READ noOfBytesPerLine WRITE setNoOfBytesPerLine )
78 Q_PROPERTY(
int StartOffset READ startOffset WRITE setStartOffset )
79 Q_PROPERTY(
int FirstLineOffset READ firstLineOffset WRITE setFirstLineOffset )
80 Q_PROPERTY(
bool OffsetColumnVisible READ offsetColumnVisible WRITE toggleOffsetColumn )
82 Q_PROPERTY(
CodingTypes VisibleCodings READ visibleCodings WRITE setVisibleCodings )
85 Q_PROPERTY(
bool ByteTypeColored READ isByteTypeColored WRITE setByteTypeColored )
87 Q_PROPERTY(
ValueCoding Coding READ valueCoding WRITE setValueCoding )
88 Q_PROPERTY(
int ByteSpacingWidth READ byteSpacingWidth WRITE setByteSpacingWidth )
89 Q_PROPERTY(
int NoOfGroupedBytes READ noOfGroupedBytes WRITE setNoOfGroupedBytes )
90 Q_PROPERTY(
int GroupSpacingWidth READ groupSpacingWidth WRITE setGroupSpacingWidth )
91 Q_PROPERTY(
int BinaryGapWidth READ binaryGapWidth WRITE setBinaryGapWidth )
93 Q_PROPERTY(
bool ShowNonprinting READ showsNonprinting WRITE setShowsNonprinting )
94 Q_PROPERTY( QChar SubstituteChar READ substituteChar WRITE setSubstituteChar )
97 enum
OffsetCoding { HexadecimalOffset=0, DecimalOffset=1, MaxOffsetCodingId=0xFF };
104 enum CodingTypes { OnlyValueCoding = ValueCodingId, OnlyCharCoding = CharCodingId, ValueAndCharCodings=ValueCodingId|CharCodingId };
111 bool isModified()
const;
113 bool isOverwriteMode()
const;
114 bool isOverwriteOnly()
const;
115 bool isReadOnly()
const;
118 Address cursorPosition()
const;
120 bool isCursorBehind()
const;
123 Address firstLineOffset()
const;
124 int noOfBytesPerLine()
const;
128 bool tabChangesFocus()
const;
130 CodingTypes visibleCodings()
const;
131 CodingTypeId activeCoding()
const;
133 bool offsetColumnVisible()
const;
134 OffsetCoding offsetCoding()
const;
137 bool hasSelectedData()
const;
150 const QString& charCodingName()
const;
152 double zoomLevel()
const;
156 virtual int byteSpacingWidth()
const = 0;
157 virtual int noOfGroupedBytes()
const = 0;
158 virtual int groupSpacingWidth()
const = 0;
159 virtual int binaryGapWidth()
const = 0;
166 virtual bool showsNonprinting()
const = 0;
170 virtual QChar substituteChar()
const = 0;
172 virtual QChar undefinedChar()
const = 0;
174 virtual bool isByteTypeColored()
const = 0;
186 virtual void setByteSpacingWidth(
int byteSpacingWidth ) = 0;
191 virtual void setNoOfGroupedBytes(
int noOfGroupedBytes ) = 0;
196 virtual void setGroupSpacingWidth(
int groupSpacingWidth ) = 0;
201 virtual void setBinaryGapWidth(
int binaryGapWidth ) = 0;
208 virtual void setBufferSpacing(
int byteSpacingWidth,
int noOfGroupedBytes = 0,
int groupSpacingWidth = 0 ) = 0;
210 virtual void setValueCoding(
ValueCoding valueCoding ) = 0;
218 virtual void setShowsNonprinting(
bool showsNonprinting =
true ) = 0;
222 virtual void setSubstituteChar( QChar substituteChar ) = 0;
226 virtual void setUndefinedChar( QChar undefinedChar ) = 0;
229 virtual void setCharCoding(
CharCoding charCoding ) = 0;
234 virtual void setCharCoding(
const QString& charCodingName ) = 0;
235 virtual void setByteTypeColored(
bool isColored ) = 0;
239 void setModified(
bool modified );
246 void setReadOnly(
bool readOnly );
248 void setOverwriteOnly(
bool overwriteOnly );
250 void setOverwriteMode(
bool overwriteMode );
253 void setNoOfBytesPerLine(
int noOfBytesPerLine );
255 void setStartOffset(
Address startOffset );
257 void setFirstLineOffset(
Address firstLineOffset );
262 void setTabChangesFocus(
bool tabChangesFocus =
true );
265 void setActiveCoding( CodingTypeId codingId );
267 void setVisibleCodings(
int visibleCodings );
270 void toggleOffsetColumn(
bool offsetColumnVisible );
272 void setOffsetCoding( OffsetCoding offsetCoding );
278 QByteArray selectedData()
const;
279 QMimeData* selectionAsMimeData()
const;
282 void pasteData(
const QMimeData* data );
284 void removeSelectedData();
286 void insert(
const QByteArray& data );
292 void setCursorPosition(
Address index,
bool isBehind =
false );
293 void setSelectionCursorPosition(
Address index );
296 void selectAll(
bool select );
301 bool selectWord(
Address index );
309 void ensureVisible(
const AddressRange& range,
bool ensureStartVisible =
false );
311 void ensureCursorVisible();
313 void placeCursor(
const QPoint& point );
316 bool canReadData(
const QMimeData* data )
const;
319 void zoomIn(
int pointInc );
321 void zoomOut(
int pointDec );
323 void zoomTo(
int pointSize );
325 void setZoomLevel(
double level );
335 void unpauseCursor();
341 virtual void paste();
344 QRect cursorRect()
const;
347 virtual QSize sizeHint()
const;
354 Address indexByPoint(
const QPoint& point )
const;
364 void overwriteModeChanged(
bool newOverwriteMode );
366 void readOnlyChanged(
bool isReadOnly );
368 void hasSelectedDataChanged(
bool hasSelectedData );
371 void cutAvailable(
bool Really );
373 void copyAvailable(
bool Really );
375 void charCodecChanged(
const QString& codecName );
377 void valueCodingChanged(
int valueCoding );
378 void focusChanged(
bool hasFocus );
380 void offsetColumnVisibleChanged(
bool visible );
381 void offsetCodingChanged(
int offsetCoding );
382 void visibleByteArrayCodingsChanged(
int columns );
383 void layoutStyleChanged(
int layoutStyle );
384 void noOfBytesPerLineChanged(
int noOfBytesPerLine );
385 void showsNonprintingChanged(
bool showsNonprinting );
386 void substituteCharChanged( QChar substituteChar );
387 void undefinedCharChanged( QChar undefinedChar );
388 void noOfGroupedBytesChanged(
int noOfGroupedBytes );
391 void finishByteEdit();
392 void emitSelectionSignals();
393 void updateChanged();
394 void copyToClipboard( QClipboard::Mode mode )
const;
395 void pasteFromClipboard( QClipboard::Mode mode );
405 virtual void keyPressEvent( QKeyEvent* keyEvent );
406 virtual void mousePressEvent( QMouseEvent* mousePressEvent );
407 virtual void mouseReleaseEvent( QMouseEvent* mouseReleaseEvent );
408 virtual void mouseMoveEvent( QMouseEvent* mouseMoveEvent );
409 virtual void mouseDoubleClickEvent( QMouseEvent* mouseDoubleClickEvent );
411 virtual bool event( QEvent* event );
412 virtual void showEvent( QShowEvent* showEvent );
413 virtual void focusInEvent( QFocusEvent* focusEvent );
414 virtual void focusOutEvent( QFocusEvent* focusEvent );
415 virtual void resizeEvent( QResizeEvent* resizeEvent );
416 virtual void dragEnterEvent( QDragEnterEvent* dragEnterEvent );
417 virtual void dragMoveEvent( QDragMoveEvent* dragMoveEvent) ;
418 virtual void dragLeaveEvent( QDragLeaveEvent* dragLeaveEvent );
419 virtual void dropEvent( QDropEvent* dropEvent );
423 virtual void wheelEvent( QWheelEvent *e );
424 virtual bool viewportEvent( QEvent* event );
427 virtual void setNoOfLines(
int newNoOfLines );
430 virtual void changeEvent( QEvent* event );
437 Q_PRIVATE_SLOT( d_func(),
void adaptController() )
438 Q_PRIVATE_SLOT( d_func(),
void blinkCursor() )
439 Q_PRIVATE_SLOT( d_func(),
void onByteArrayReadOnlyChange(
bool isByteArrayReadOnly) )
441 Q_PRIVATE_SLOT( d_func(),
void onBookmarksChange( const
QList<Okteta::
Bookmark>& bookmarks ) )
442 Q_PRIVATE_SLOT( d_func(),
void onRevertedToVersionIndex(
int versionIndex ) )
could it be useful to hide the data access behind an iterator? * class KDataBufferIterator { public: ...
a class to control all the ranges like marking and selections holds also all modified ranges and merg...
Offset for own encodings which are bound in by plugins.
this should enable extension without breaking binary compatibility
ASCII encoding, also known as Latin1.
Okteta::ArrayChangeMetricsList ArrayChangeMetricsList
the logical layout of a byte array table for a view
Class that is able to convert codings to and from hexadecimal, decimal, octal, and binary...
the most common EBCDIC codepage
navigates through the buffer in an abstract way, based on the layout
general class for widgets with columns that display different aspects of the same data with the same ...
AbstractByteArrayViewPrivate *const d_ptr