Kate
katevikeysequenceparser.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 * Copyright (C) 2008 Erlend Hamberg <ehamberg@gmail.com> 00003 * Copyright (C) 2008 Evgeniy Ivanov <powerfox@kde.ru> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) version 3. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public License 00016 * along with this library; see the file COPYING.LIB. If not, write to 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #include <QChar> 00022 #include <QString> 00023 #include <QHash> 00024 class QKeyEvent; 00025 00026 #ifndef KATE_VI_KEYSEQUENCE_PARSER_H_INCLUDED 00027 #define KATE_VI_KEYSEQUENCE_PARSER_H_INCLUDED 00028 00034 class KateViKeySequenceParser 00035 { 00036 public: 00037 KateViKeySequenceParser(); 00038 00039 const QString encodeKeySequence( const QString &keys ) const; 00040 const QString decodeKeySequence( const QString &keys ) const; 00041 QString qt2vi( int key ) const; 00042 int vi2qt( const QString &keypress ) const; 00043 char scanCodeToChar(quint32 code, Qt::KeyboardModifiers modifiers, bool isLetter) const; 00044 const QChar KeyEventToQChar(int keyCode, const QString &text, Qt::KeyboardModifiers mods, quint32 nativeScanCode) const; 00045 00046 private: 00047 void initKeyTables(); 00048 00049 QHash<int, QString> *m_qt2katevi; 00050 QHash<QString, int> *m_katevi2qt; 00051 QHash<QString, int> *m_nameToKeyCode; 00052 QHash<int, QString> *m_keyCodeToName; 00053 }; 00054 00055 #endif