Logo Search packages:      
Sourcecode: kdeutils-kde4 version File versions  Download package

kbytearrayedit.cpp

/***************************************************************************
                          kbytearrayedit.cpp  -  description
                             -------------------
    begin                : Fri Aug 29 2003
    copyright            : (C) 2003 by Friedrich W. H. Kossebau
    email                : kossebau@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.       *
 *                                                                         *
 ***************************************************************************/


#include "kbytearrayedit.h"

// hexedit gui
#include <kbytearrayview.h>
// hexedit core
#include <kbytearraymodel.h>
// Qt
#include <QtGui/QLayout>
#include <QtGui/QWidget>



00030 KByteArrayEdit::KByteArrayEdit( QWidget *parent, const QStringList & )
  : QWidget( parent )
{
    Model = new KHECore::KByteArrayModel;
    HexEdit = new KHEUI::KByteArrayView( Model, this );

    QHBoxLayout* Layout = new QHBoxLayout( this );
    Layout->addWidget( HexEdit );

    connect( HexEdit, SIGNAL(copyAvailable( bool )), SIGNAL(copyAvailable( bool )) );
}



00044 void KByteArrayEdit::setData( char *D, int S, int RS, bool KM )
{
    KHECore::KByteArrayModel *OldModel = Model;
    Model = new KHECore::KByteArrayModel( D, S, RS, KM );

    // get attributes
    Model->setReadOnly( OldModel->isReadOnly() );
    Model->setAutoDelete( OldModel->autoDelete() );

    HexEdit->setByteArrayModel( Model );

    delete OldModel;
}


void KByteArrayEdit::setReadOnly( bool RO )
{
    Model->setReadOnly( RO );
    HexEdit->setReadOnly( RO );
}

00065 void KByteArrayEdit::setMaxDataSize( int MS )
{
    Model->setMaxSize( MS );
}

00070 void KByteArrayEdit::setAutoDelete( bool AD )
{
    Model->setAutoDelete( AD );
}


00076 void KByteArrayEdit::setKeepsMemory( bool KM )
{
    Model->setKeepsMemory( KM );
}


00082 void KByteArrayEdit::setCursorPosition( int Index )
{
    HexEdit->setCursorPosition( Index );
}

00087 void KByteArrayEdit::setCoding( KCoding C )
{
    HexEdit->setCoding( (KHEUI::KByteArrayView::KCoding) C );
}

00092 void KByteArrayEdit::setResizeStyle( KResizeStyle Style )
{
    HexEdit->setResizeStyle( (KHEUI::KByteArrayView::KResizeStyle) Style );
}
int KByteArrayEdit::noOfBytesPerLine() const
{
    return HexEdit->noOfBytesPerLine();
}

KByteArrayEdit::KResizeStyle KByteArrayEdit::resizeStyle() const
{
    return (KResizeStyle)HexEdit->resizeStyle();
}
00105 void KByteArrayEdit::setNoOfBytesPerLine( int NoCpL )
{
    HexEdit->setNoOfBytesPerLine( NoCpL );
}



void KByteArrayEdit::setOverwriteOnly( bool b )
{
    HexEdit->setOverwriteOnly( b );
}


void KByteArrayEdit::setOverwriteMode( bool b )
{
    HexEdit->setOverwriteMode( b );
}


void KByteArrayEdit::setModified( bool b )
{
    HexEdit->setModified( b );
}


00130 void KByteArrayEdit::setByteSpacingWidth( int BSW )
{
    HexEdit->setByteSpacingWidth( BSW );
}

00135 void KByteArrayEdit::setNoOfGroupedBytes( int NoGB )
{
    HexEdit->setNoOfGroupedBytes( NoGB );
}

00140 void KByteArrayEdit::setGroupSpacingWidth( int GSW )
{
    HexEdit->setGroupSpacingWidth( GSW );
}

00145 void KByteArrayEdit::setBinaryGapWidth( int BGW )
{
    HexEdit->setBinaryGapWidth( BGW );
}

00150 void KByteArrayEdit::setEncoding( KEncoding C )
{
    HexEdit->setEncoding( (KHEUI::KByteArrayView::KEncoding)C );
}

00155 void KByteArrayEdit::setShowUnprintable( bool SU )
{
    HexEdit->setShowUnprintable( SU );
}

00160 void KByteArrayEdit::setSubstituteChar( QChar SC )
{
    HexEdit->setSubstituteChar( SC );
}


00166 char *KByteArrayEdit::data() const
{
    return Model->data();
}

00171 int KByteArrayEdit::dataSize() const
{
    return Model->size();
}
00175 int KByteArrayEdit::maxDataSize () const
{
    return Model->maxSize();
}
00179 bool KByteArrayEdit::isAutoDelete() const
{
    return Model->autoDelete();
}

00184 bool KByteArrayEdit::keepsMemory() const
{
    return Model->keepsMemory();
}

00189 bool KByteArrayEdit::isOverwriteMode() const
{
    return HexEdit->isOverwriteMode();
}

bool KByteArrayEdit::isOverwriteOnly() const
{
    return HexEdit->isOverwriteOnly();
}

bool KByteArrayEdit::isModified() const
{
    return HexEdit->isModified();
}

bool KByteArrayEdit::isReadOnly() const
{
    return HexEdit->isReadOnly();
}


KByteArrayEdit::KCoding KByteArrayEdit::coding() const
{
    return (KCoding)HexEdit->coding();
}

int KByteArrayEdit::byteSpacingWidth() const
{
    return HexEdit->byteSpacingWidth();
}

int KByteArrayEdit::noOfGroupedBytes() const
{
    return HexEdit->noOfGroupedBytes();
}

int KByteArrayEdit::groupSpacingWidth() const
{
    return HexEdit->groupSpacingWidth();
}

int KByteArrayEdit::binaryGapWidth() const
{
    return HexEdit->binaryGapWidth();
}

00235 bool KByteArrayEdit::showUnprintable() const
{
    return HexEdit->showUnprintable();
}

00240 QChar KByteArrayEdit::substituteChar() const
{
    return HexEdit->substituteChar();
}

00245 KByteArrayEdit::KEncoding KByteArrayEdit::encoding() const
{
    return (KEncoding)HexEdit->encoding();
}


00251 bool KByteArrayEdit::hasSelectedData() const
{
    return HexEdit->hasSelectedData();
}


00257 void KByteArrayEdit::repaintRange( int i1, int i2 )
{
    Model->signalContentsChanged( i1, i2 );
}


00263 void KByteArrayEdit::insert( const QByteArray &D )
{
    HexEdit->insert( D );
}


00269 void KByteArrayEdit::selectAll( bool Select )
{
    HexEdit->selectAll( Select );
}

  // clipboard interface
void KByteArrayEdit::copy()
{
    HexEdit->copy();
}

void KByteArrayEdit::cut()
{
    HexEdit->cut();
}

void KByteArrayEdit::paste()
{
    HexEdit->paste();
}

// zooming interface
void KByteArrayEdit::zoomIn( int PointInc )
{
    HexEdit->zoomIn( PointInc );
}

void KByteArrayEdit::zoomIn()
{
    HexEdit->zoomIn();
}

void KByteArrayEdit::zoomOut( int PointDec )
{
    HexEdit->zoomOut( PointDec );
}

void KByteArrayEdit::zoomOut()
{
    HexEdit->zoomOut();
}

void KByteArrayEdit::zoomTo( int PointSize )
{
    HexEdit->zoomTo( PointSize );
}

void KByteArrayEdit::unZoom()
{
    HexEdit->unZoom();
}

KByteArrayEdit::~KByteArrayEdit()
{
    delete Model;
}


#include "kbytearrayedit.moc"

Generated by  Doxygen 1.6.0   Back to index