• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kate

katevimodebase.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_MODE_BASE_INCLUDED
00021 #define KATE_VI_MODE_BASE_INCLUDED
00022 
00023 #include <ktexteditor/cursor.h>
00024 #include "kateview.h"
00025 #include "katevirange.h"
00026 
00027 #include <QList>
00028 
00029 class QKeyEvent;
00030 class QString;
00031 class QRegExp;
00032 class KateDocument;
00033 class KateViewInternal;
00034 class KateViVisualMode;
00035 class KateViNormalMode;
00036 class KateViInputModeManager;
00037 
00038 class KateViModeBase
00039 {
00040   public:
00041     KateViModeBase() {};
00042     virtual ~KateViModeBase() {};
00043 
00047     QString getVerbatimKeys() const;
00048 
00049   protected:
00050     // helper methods
00051     bool deleteRange( KateViRange &r, bool linewise = true, bool addToRegister = true );
00052     const QString getRange( KateViRange &r, bool linewise = true ) const;
00053     const QString getLine( int lineNumber = -1 ) const;
00054     const QChar getCharUnderCursor() const;
00055     KTextEditor::Cursor findNextWordStart( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00056     KTextEditor::Cursor findNextWORDStart( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00057     KTextEditor::Cursor findPrevWordStart( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00058     KTextEditor::Cursor findPrevWORDStart( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00059     KTextEditor::Cursor findPrevWordEnd( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00060     KTextEditor::Cursor findPrevWORDEnd( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00061     KTextEditor::Cursor findWordEnd( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00062     KTextEditor::Cursor findWORDEnd( int fromLine, int fromColumn, bool onlyCurrentLine = false ) const;
00063     KateViRange findSurrounding( const QChar &c1, const QChar &c2, bool inner = false ) const;
00064     int findLineStartingWitchChar( const QChar &c, unsigned int count, bool forward = true ) const;
00065     void updateCursor( const KTextEditor::Cursor &c ) const;
00066 
00067     KateViRange goLineUp();
00068     KateViRange goLineDown();
00069     KateViRange goLineUpDown( int lines);
00070 
00071     unsigned int getCount() const { return ( m_count > 0 ) ? m_count : 1; }
00072 
00073     bool startNormalMode();
00074     bool startInsertMode();
00075     bool startVisualMode();
00076     bool startVisualLineMode();
00077 
00078     void error( const QString &errorMsg ) const;
00079     void message( const QString &msg ) const;
00080 
00081     QChar getChosenRegister( const QChar &defaultReg ) const;
00082     QString getRegisterContent( const QChar &reg ) const;
00083     void fillRegister( const QChar &reg, const QString &text);
00084 
00085     QChar m_register;
00086 
00087     KateViRange m_commandRange;
00088     unsigned int m_count;
00089 
00090     QString m_extraWordCharacters;
00091     QString m_keysVerbatim;
00092 
00093     int m_stickyColumn;
00094 
00095     inline KateDocument* doc() const { return m_view->doc(); };
00096     KateView *m_view;
00097     KateViewInternal *m_viewInternal;
00098     KateViInputModeManager* m_viInputModeManager;
00099 };
00100 
00101 #endif

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal