• 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
katevicommand.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 Erlend Hamberg <ehamberg@gmail.com>
4  * Copyright (C) 2011 Svyatoslav Kuzmich <svatoslav1@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #include "katevinormalmode.h"
23 #include "katevikeyparser.h"
24 #include "katepartprivate_export.h"
25 
26 #ifndef KATE_VI_COMMAND_H
27 #define KATE_VI_COMMAND_H
28 
29 class KATEPART_TESTS_EXPORT KateViNormalMode;
30 
31 enum KateViCommandFlags {
32  REGEX_PATTERN = 0x1, // the pattern is a regex
33  NEEDS_MOTION = 0x2, // the command needs a motion before it can be executed
34  SHOULD_NOT_RESET = 0x4, // the command should not cause the current mode to be left
35  IS_CHANGE = 0x8, // the command changes the buffer
36  IS_NOT_LINEWISE = 0x10, // the motion is not line wise
37  CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION = 0x20 // the motion is a text object that can set the
38  // whole Visual Mode selection to the text object
39 };
40 
41 class KATEPART_TESTS_EXPORT KateViCommand {
42  public:
43  KateViCommand( KateViNormalMode *parent, QString pattern,
44  bool ( KateViNormalMode::*pt2Func)(), unsigned int flags = 0 );
45  ~KateViCommand();
46 
47  bool matches( const QString &pattern ) const;
48  bool matchesExact( const QString &pattern ) const;
49  bool execute() const;
50  const QString pattern() const { return m_pattern; }
51  bool isRegexPattern() const { return m_flags & REGEX_PATTERN; }
52  bool needsMotion() const { return m_flags & NEEDS_MOTION; }
53  bool shouldReset() const { return !( m_flags & SHOULD_NOT_RESET ); }
54  bool isChange() const { return m_flags & IS_CHANGE; }
55  bool isLineWise() const { return !(m_flags & IS_NOT_LINEWISE); }
56  bool canChangeWholeVisualModeSelection() const { return m_flags & CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION; }
57 
58  protected:
59  KateViNormalMode *m_parent;
60  QString m_pattern;
61  unsigned int m_flags;
62  bool ( KateViNormalMode::*m_ptr2commandMethod)();
63  KateViKeyParser *m_keyParser;
64 };
65 
66 #endif
katevinormalmode.h
KATEPART_TESTS_EXPORT
#define KATEPART_TESTS_EXPORT
Definition: katepartprivate_export.h:36
katepartprivate_export.h
QString
KateViNormalMode
Commands for the vi normal mode.
Definition: katevinormalmode.h:49
katevikeyparser.h
KateViCommand
KateViKeyParser
for encoding keypresses w/ modifiers into an internal QChar representation and back again to a descri...
Definition: katevikeyparser.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 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