• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHexEdit

  • interfaces
  • khexedit
byteseditinterface.h
Go to the documentation of this file.
1/***************************************************************************
2 byteseditinterface.h - description
3 -------------------
4 begin : Fri Sep 12 2003
5 copyright : (C) 2003 by Friedrich W. H. Kossebau
6 email : kossebau@kde.org
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This library is free software; you can redistribute it and/or *
12 * modify it under the terms of the GNU Library General Public *
13 * License version 2 as published by the Free Software Foundation. *
14 * *
15 ***************************************************************************/
16
17
18#ifndef KHE_BYTESEDITINTERFACE_H
19#define KHE_BYTESEDITINTERFACE_H
20
21// KDE
22#include <kservicetypetrader.h>
23// Qt
24#include <QtGui/QWidget>
25
30namespace KHE
31{
32
73class BytesEditInterface
74{
75 public:
76 virtual ~BytesEditInterface() {}
77
78 public: // set methods
86 virtual void setData( char *D, int S, int RS = -1, bool KM = true ) = 0;
88 virtual void setReadOnly( bool RO = true ) = 0;
97 virtual void setMaxDataSize( int MS ) = 0;
101 virtual void setAutoDelete( bool AD = true ) = 0;
103// virtual void resetData( char *D, int S, bool Repaint ) = 0;
111 virtual void setKeepsMemory( bool KM = true ) = 0;
112 //
114 virtual void setOverwriteOnly( bool b ) = 0;
116 virtual void setOverwriteMode( bool b ) = 0;
118 virtual void setModified( bool b ) = 0;
119
120
121 public: // get methods
123 virtual char *data() const = 0;
125 virtual int dataSize() const = 0;
127 virtual int maxDataSize () const = 0;
129 virtual bool isAutoDelete() const = 0;
131 virtual bool keepsMemory() const = 0;
132
134 virtual bool isOverwriteMode() const = 0;
136 virtual bool isOverwriteOnly() const = 0;
138 virtual bool isReadOnly() const = 0;
140 virtual bool isModified() const = 0;
141
142 public: // call for action
144 virtual void repaintRange( int i1, int i2 ) = 0;
145};
146
147
152template<class T>
153inline BytesEditInterface *bytesEditInterface( T *t )
154{
155 return t ? qobject_cast<KHE::BytesEditInterface *>( t ) : 0;
156}
157
165inline QWidget *createBytesEditWidget( QWidget *Parent = 0 )
166{
167 return KServiceTypeTrader::createInstanceFromQuery<QWidget>
168 ( QString::fromLatin1("KHexEdit/KBytesEdit"), QString(), Parent );
169}
170
171}
172
173Q_DECLARE_INTERFACE( KHE::BytesEditInterface, "org.kde.khe.byteseditinterface/1.0" )
174
175#endif
KHE::BytesEditInterface
An interface for a hex edit editor/viewer for arrays of byte.
Definition: byteseditinterface.h:74
KHE::BytesEditInterface::dataSize
virtual int dataSize() const =0
KHE::BytesEditInterface::setModified
virtual void setModified(bool b)=0
sets whether the data should be treated modified or not
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::isAutoDelete
virtual bool isAutoDelete() const =0
KHE::BytesEditInterface::repaintRange
virtual void repaintRange(int i1, int i2)=0
repaint the indizes from i1 to i2
KHE::BytesEditInterface::setOverwriteMode
virtual void setOverwriteMode(bool b)=0
sets whether the widget is in overwrite mode or not.
KHE::BytesEditInterface::keepsMemory
virtual bool keepsMemory() const =0
KHE::BytesEditInterface::isModified
virtual bool isModified() const =0
KHE::BytesEditInterface::setReadOnly
virtual void setReadOnly(bool RO=true)=0
sets whether the given array should be handled read only or not.
KHE::BytesEditInterface::setMaxDataSize
virtual void setMaxDataSize(int MS)=0
sets the maximal size of the actual byte array.
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::isReadOnly
virtual bool isReadOnly() const =0
KHE::BytesEditInterface::isOverwriteMode
virtual bool isOverwriteMode() const =0
KHE::BytesEditInterface::data
virtual char * data() const =0
KHE::BytesEditInterface::maxDataSize
virtual int maxDataSize() const =0
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::~BytesEditInterface
virtual ~BytesEditInterface()
Definition: byteseditinterface.h:76
KHE::BytesEditInterface::isOverwriteOnly
virtual bool isOverwriteOnly() const =0
QWidget
kservicetypetrader.h
KHE
KHE (short for KHexEdit) is KDE's namespace for all things related to the viewing/editing of bytes.
Definition: byteseditinterface.h:31
KHE::bytesEditInterface
BytesEditInterface * bytesEditInterface(T *t)
tries to get the bytesedit interface of t
Definition: byteseditinterface.h:153
KHE::createBytesEditWidget
QWidget * createBytesEditWidget(QWidget *Parent=0)
tries to create an instance of a hexedit widget for arrays of chars (char[])
Definition: byteseditinterface.h:165
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHexEdit

Skip menu "KHexEdit"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal