Kate
katevivisualmode.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries and the Kate part. 00002 * 00003 * Copyright (C) 2008 - 2009 Erlend Hamberg <ehamberg@gmail.com> 00004 * Copyright (C) 2009 Paul Gideon Dann <pdgiddie@gmail.com> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KATE_VI_VISUAL_MODE_INCLUDED 00023 #define KATE_VI_VISUAL_MODE_INCLUDED 00024 00025 #include <ktexteditor/cursor.h> 00026 #include "katevinormalmode.h" 00027 00028 class KateViRange; 00029 class KateViInputModeManager; 00030 00031 class KateViVisualMode : public KateViNormalMode { 00032 public: 00033 KateViVisualMode( KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal ); 00034 ~KateViVisualMode(); 00035 00036 void init(); 00037 00038 void setVisualLine( bool l ); 00039 void setVisualBlock( bool l ); 00040 bool isVisualLine() const { return m_mode == VisualLineMode; } 00041 bool isVisualBlock() const { return m_mode == VisualBlockMode; } 00042 void switchStartEnd(); 00043 void setVisualModeType( ViMode mode ); 00044 KTextEditor::Cursor getStart() const { return m_start; } 00045 KTextEditor::Range getVisualRange() const; 00046 00047 private: 00048 void initializeCommands(); 00049 void updateDirty( bool entireView = false ) const; 00050 void goToPos( const KateViRange &r ); 00051 void reset(); 00052 ViMode m_mode; 00053 KTextEditor::Cursor m_start; 00054 KTextEditor::Cursor m_previous; // previous position, used when deciding which lines to redraw 00055 }; 00056 00057 #endif
KDE 4.6 API Reference