From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- interfaces/khexedit/charcolumninterface.h | 105 ++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 interfaces/khexedit/charcolumninterface.h (limited to 'interfaces/khexedit/charcolumninterface.h') diff --git a/interfaces/khexedit/charcolumninterface.h b/interfaces/khexedit/charcolumninterface.h new file mode 100644 index 000000000..aef282fdc --- /dev/null +++ b/interfaces/khexedit/charcolumninterface.h @@ -0,0 +1,105 @@ +/*************************************************************************** + charcolumninterface.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 CHARCOLUMNINTERFACE_H +#define CHARCOLUMNINTERFACE_H + +#include + +namespace KHE +{ + +/** + * @short A simple interface for the access to the char column of a hex edit widget + * + * @author Friedrich W. H. Kossebau + * @see createBytesEditWidget(), charColumnInterface() + * @since 3.2 + */ +class CharColumnInterface +{ + public: + /** encoding used to display the symbols in the text column */ + enum KEncoding + { + /** the encoding of your shell. If that is a multibyte encoding this will default to Latin1. */ + LocalEncoding=0, + /** extended ASCII encoding, also known as Latin1 */ + ISO8859_1Encoding=1, + /** @internal not implemented: the most common EBCDIC codepage */ + CECP1047Encoding=2, + /** @internal enables extension without breaking binary compatibility */ + MaxEncodingId=0xFFFF + }; + + public: // set methods + /** sets whether "unprintable" chars (value<32) should be displayed in the text column + * with their corresponding character. + * Default is @c false. + * @param SU + * @see showUnprintable() + */ + virtual void setShowUnprintable( bool SU = true ) = 0; + /** sets the substitute character for "unprintable" chars + * Default is '.'. + * @param SC new character + * @see substituteChar() + */ + virtual void setSubstituteChar( QChar SC ) = 0; + /** sets the encoding of the text column. + * If the encoding is not available the format will not be changed. + * Default is @c LocalEncoding. + * @param C the new encoding + * @see encoding() + */ + virtual void setEncoding( KEncoding C ) = 0; + + + public: // get methods + /** @return @c true if "unprintable" chars (value<32) are displayed in the text column + * with their corresponding character, @c false otherwise + * @see setShowUnprintable() + */ + virtual bool showUnprintable() const = 0; + /** @return the currently used substitute character for "unprintable" chars. + * @see setSubstituteChar() + */ + virtual QChar substituteChar() const = 0; + /** @return the currently used encoding + * @see setEncoding() + */ + virtual KEncoding encoding() const = 0; +}; + + +/** tries to get the charcolumn interface of t + * @return a pointer to the interface, otherwise 0 + * @author Friedrich W. H. Kossebau + * @since 3.2 + */ +template +CharColumnInterface *charColumnInterface( T *t ) +{ + if( !t ) + return 0; + + return static_cast( t->qt_cast("KHE::CharColumnInterface") ); +} + +} + +#endif -- cgit v1.2.1