byteseditinterface.h
/***************************************************************************
byteseditinterface.h - description
-------------------
begin : Fri Sep 12 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 BYTESEDITINTERFACE_H
#define BYTESEDITINTERFACE_H
// kde specific
#include <kparts/componentfactory.h>
#include <qwidget.h>
namespace KHE
{
class BytesEditInterface
{
public:
//static const char Name[] = "KHE::BytesEditInterface";
public: // set methods
virtual void setData( char *D, int S, int RS = -1, bool KM = true ) = 0;
virtual void setReadOnly( bool RO = true ) = 0;
virtual void setMaxDataSize( int MS ) = 0;
virtual void setAutoDelete( bool AD = true ) = 0;
// virtual void resetData( char *D, int S, bool Repaint ) = 0;
virtual void setKeepsMemory( bool KM = true ) = 0;
//
virtual void setOverwriteOnly( bool b ) = 0;
virtual void setOverwriteMode( bool b ) = 0;
virtual void setModified( bool b ) = 0;
public: // get methods
virtual char *data() const = 0;
virtual int dataSize() const = 0;
virtual int maxDataSize () const = 0;
virtual bool isAutoDelete() const = 0;
virtual bool keepsMemory() const = 0;
virtual bool isOverwriteMode() const = 0;
virtual bool isOverwriteOnly() const = 0;
virtual bool isReadOnly() const = 0;
virtual bool isModified() const = 0;
public: // call for action
virtual void repaintRange( int i1, int i2 ) = 0;
};
template<class T>
inline BytesEditInterface *bytesEditInterface( T *t )
{
if( !t )
return 0;
return static_cast<BytesEditInterface*>( t->qt_cast("KHE::BytesEditInterface") );
}
inline QWidget *createBytesEditWidget( QWidget *Parent = 0, const char *Name = 0 )
{
return KParts::ComponentFactory::createInstanceFromQuery<QWidget>
( QString::fromLatin1("KHexEdit/KBytesEdit"), QString::null, Parent, Name );
}
}
#endif
KHE::bytesEditInterface
BytesEditInterface * bytesEditInterface(T *t)
tries to get the bytesedit interface of t
Definition: byteseditinterface.h:157
KHE::BytesEditInterface::dataSize
virtual int dataSize() const =0
KHE::BytesEditInterface::repaintRange
virtual void repaintRange(int i1, int i2)=0
repaint the indizes from i1 to i2
KHE::createBytesEditWidget
QWidget * createBytesEditWidget(QWidget *Parent=0, const char *Name=0)
tries to create an instance of a hexedit widget for arrays of chars (char[])
Definition: byteseditinterface.h:221
KHE::BytesEditInterface::setMaxDataSize
virtual void setMaxDataSize(int MS)=0
sets the maximal size of the actual byte array.
KHE::BytesEditInterface::setOverwriteMode
virtual void setOverwriteMode(bool b)=0
sets whether the widget is in overwrite mode or not.
KHE::BytesEditInterface::isAutoDelete
virtual bool isAutoDelete() const =0
KHE::BytesEditInterface::setData
virtual void setData(char *D, int S, int RS=-1, bool KM=true)=0
hands over to the editor a new byte array.
KHE::BytesEditInterface::maxDataSize
virtual int maxDataSize() const =0
KHE::BytesEditInterface::isOverwriteOnly
virtual bool isOverwriteOnly() const =0
KHE::BytesEditInterface::isModified
virtual bool isModified() const =0
KHE::BytesEditInterface
An interface for a hex edit editor/viewer for arrays of byte.
Definition: byteseditinterface.h:76
KHE::BytesEditInterface::isReadOnly
virtual bool isReadOnly() const =0
KHE::BytesEditInterface::setOverwriteOnly
virtual void setOverwriteOnly(bool b)=0
sets whether the widget is overwriteonly or not.
KHE::BytesEditInterface::setKeepsMemory
virtual void setKeepsMemory(bool KM=true)=0
switches the array
KHE::BytesEditInterface::setModified
virtual void setModified(bool b)=0
sets whether the data should be treated modified or not
KHE::BytesEditInterface::setAutoDelete
virtual void setAutoDelete(bool AD=true)=0
sets whether the array should be deleted on the widget's end or if a new array is set...
KHE::BytesEditInterface::setReadOnly
virtual void setReadOnly(bool RO=true)=0
sets whether the given array should be handled read only or not.
KHE::BytesEditInterface::data
virtual char * data() const =0
KHE::BytesEditInterface::keepsMemory
virtual bool keepsMemory() const =0
KHE::BytesEditInterface::isOverwriteMode
virtual bool isOverwriteMode() const =0

KDE Home | KDE Accessibility Home | Description of Access Keys