interfaces
byteseditinterface.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef BYTESEDITINTERFACE_H
00019 #define BYTESEDITINTERFACE_H
00020
00021
00022 #include <kparts/componentfactory.h>
00023
00024 #include <qwidget.h>
00025
00032 namespace KHE
00033 {
00034
00076 class BytesEditInterface
00077 {
00078 public:
00079
00080
00081 public:
00089 virtual void setData( char *D, int S, int RS = -1, bool KM = true ) = 0;
00091 virtual void setReadOnly( bool RO = true ) = 0;
00100 virtual void setMaxDataSize( int MS ) = 0;
00104 virtual void setAutoDelete( bool AD = true ) = 0;
00106
00114 virtual void setKeepsMemory( bool KM = true ) = 0;
00115
00117 virtual void setOverwriteOnly( bool b ) = 0;
00119 virtual void setOverwriteMode( bool b ) = 0;
00121 virtual void setModified( bool b ) = 0;
00122
00123
00124 public:
00126 virtual char *data() const = 0;
00128 virtual int dataSize() const = 0;
00130 virtual int maxDataSize () const = 0;
00132 virtual bool isAutoDelete() const = 0;
00134 virtual bool keepsMemory() const = 0;
00135
00137 virtual bool isOverwriteMode() const = 0;
00139 virtual bool isOverwriteOnly() const = 0;
00141 virtual bool isReadOnly() const = 0;
00143 virtual bool isModified() const = 0;
00144
00145 public:
00147 virtual void repaintRange( int i1, int i2 ) = 0;
00148 };
00149
00150
00156 template<class T>
00157 inline BytesEditInterface *bytesEditInterface( T *t )
00158 {
00159 if( !t )
00160 return 0;
00161
00162 return static_cast<BytesEditInterface*>( t->qt_cast("KHE::BytesEditInterface") );
00163 }
00164
00221 inline QWidget *createBytesEditWidget( QWidget *Parent = 0, const char *Name = 0 )
00222 {
00223 return KParts::ComponentFactory::createInstanceFromQuery<QWidget>
00224 ( QString::fromLatin1("KHexEdit/KBytesEdit"), QString::null, Parent, Name );
00225 }
00226
00227 }
00228
00229 #endif