• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • vimode
katevivisualmode.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries and the Kate part.
2  *
3  * Copyright (C) 2008 - 2009 Erlend Hamberg <ehamberg@gmail.com>
4  * Copyright (C) 2009 Paul Gideon Dann <pdgiddie@gmail.com>
5  * Copyright (C) 2011 Svyatoslav Kuzmich <svatoslav1@gmail.com>
6  * Copyright (C) 2012 - 2013 Simon St James <kdedevel@etotheipiplusone.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB. If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef KATE_VI_VISUAL_MODE_INCLUDED
25 #define KATE_VI_VISUAL_MODE_INCLUDED
26 
27 #include <ktexteditor/cursor.h>
28 #include <ktexteditor/range.h>
29 #include "katevinormalmode.h"
30 
31 class KateViRange;
32 class KateViInputModeManager;
33 
34 class KateViVisualMode : public KateViNormalMode {
35 
36  Q_OBJECT
37 
38  public:
39  KateViVisualMode( KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal );
40  ~KateViVisualMode();
41 
42  void init();
43 
44  bool isVisualLine() const { return m_mode == VisualLineMode; }
45  bool isVisualBlock() const { return m_mode == VisualBlockMode; }
46  void switchStartEnd();
47  void reset();
48  void setVisualModeType( ViMode mode );
49  void saveRangeMarks();
50  void setStart( const Cursor& c ) { m_start = c; }
51  Cursor getStart() { return m_start; }
52 
53  void goToPos( const Cursor& c);
54 
55  ViMode getLastVisualMode() const { return m_lastVisualMode; }
56  Cursor getStart() const { return m_start; }
57 
58  // Selects all lines in range;
59  void SelectLines(Range range);
60 
61  // Selects range between c1 and c2, but includes the end cursor position.
62  void SelectInclusive(Cursor c1, Cursor c2);
63 
64  // Select block between c1 and c2.
65  void SelectBlockInclusive(Cursor c1, Cursor c2);
66 
67 public Q_SLOTS:
73  void updateSelection();
74 
75  private:
76  void initializeCommands();
77 
84  void goToPos( const KateViRange &r );
85  ViMode m_mode;
86  Cursor m_start;
87  ViMode m_lastVisualMode; // used when reselecting a visual selection
88 };
89 
90 #endif
katevinormalmode.h
KateViVisualMode::reset
void reset()
Definition: katevivisualmode.cpp:143
KateViVisualMode::SelectInclusive
void SelectInclusive(Cursor c1, Cursor c2)
Definition: katevivisualmode.cpp:53
KateViVisualMode::getStart
Cursor getStart() const
Definition: katevivisualmode.h:56
KateViVisualMode::SelectBlockInclusive
void SelectBlockInclusive(Cursor c1, Cursor c2)
Definition: katevivisualmode.cpp:62
KateViInputModeManager
Definition: kateviinputmodemanager.h:68
KateViVisualMode::updateSelection
void updateSelection()
Updates the visual mode's range to reflect a new cursor position.
Definition: katevivisualmode.cpp:237
KateViVisualMode::goToPos
void goToPos(const Cursor &c)
Definition: katevivisualmode.cpp:229
KateViVisualMode::isVisualBlock
bool isVisualBlock() const
Definition: katevivisualmode.h:45
KateViRange
Definition: katevirange.h:33
KateViVisualMode::init
void init()
Definition: katevivisualmode.cpp:197
KateViewInternal
Definition: kateviewinternal.h:58
KateViVisualMode
Definition: katevivisualmode.h:34
ViMode
ViMode
The four vi modes supported by Kate's vi input mode.
Definition: kateviinputmodemanager.h:48
KateViVisualMode::setStart
void setStart(const Cursor &c)
Definition: katevivisualmode.h:50
KateView
Definition: kateview.h:77
VisualBlockMode
Definition: kateviinputmodemanager.h:53
KateViNormalMode
Commands for the vi normal mode.
Definition: katevinormalmode.h:49
KateViVisualMode::setVisualModeType
void setVisualModeType(ViMode mode)
Definition: katevivisualmode.cpp:213
VisualLineMode
Definition: kateviinputmodemanager.h:52
KateViVisualMode::SelectLines
void SelectLines(Range range)
Definition: katevivisualmode.cpp:74
KateViVisualMode::KateViVisualMode
KateViVisualMode(KateViInputModeManager *viInputModeManager, KateView *view, KateViewInternal *viewInternal)
Definition: katevivisualmode.cpp:38
KateViVisualMode::saveRangeMarks
void saveRangeMarks()
Definition: katevivisualmode.cpp:187
KateViVisualMode::switchStartEnd
void switchStartEnd()
Definition: katevivisualmode.cpp:219
KateViVisualMode::getLastVisualMode
ViMode getLastVisualMode() const
Definition: katevivisualmode.h:55
KateViVisualMode::getStart
Cursor getStart()
Definition: katevivisualmode.h:51
KateViVisualMode::~KateViVisualMode
~KateViVisualMode()
Definition: katevivisualmode.cpp:49
KateViVisualMode::isVisualLine
bool isVisualLine() const
Definition: katevivisualmode.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal