Kate
kateviinsertmode.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 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) version 3. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KATE_VI_INSERT_MODE_INCLUDED 00021 #define KATE_VI_INSERT_MODE_INCLUDED 00022 00023 #include <QKeyEvent> 00024 #include "katevimodebase.h" 00025 00026 class KateViMotion; 00027 class KateView; 00028 class KateViewInternal; 00029 00034 class KateViInsertMode : public KateViModeBase 00035 { 00036 public: 00037 KateViInsertMode( KateViInputModeManager *viInputModeManager, KateView * view, KateViewInternal * viewInternal ); 00038 ~KateViInsertMode(); 00039 00040 bool handleKeypress( const QKeyEvent *e ); 00041 00042 bool commandInsertFromAbove(); 00043 bool commandInsertFromBelow(); 00044 00045 bool commandDeleteWord(); 00046 00047 bool commandIndent(); 00048 bool commandUnindent(); 00049 00050 bool commandToFirstCharacterInFile(); 00051 bool commandToLastCharacterInFile(); 00052 00053 bool commandMoveOneWordLeft(); 00054 bool commandMoveOneWordRight(); 00055 00056 private: 00057 const QChar getCharAtVirtualColumn( QString &line, int virtualColumn, int tabWidht ) const; 00058 }; 00059 00060 #endif