• 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
katevikeymapper.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) 2013 Simon St James <kdedevel@etotheipiplusone.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 #ifndef KATE_VI_KEYMAPPER_H_INCLUDED
22 #define KATE_VI_KEYMAPPER_H_INCLUDED
23 
24 #include <QtCore/QObject>
25 #include "katepartprivate_export.h"
26 
27 class KateViInputModeManager;
28 class KateDocument;
29 class KateView;
30 
31 class QTimer;
32 
33 class KATEPART_TESTS_EXPORT KateViKeyMapper : public QObject
34 {
35  Q_OBJECT
36 public:
37  KateViKeyMapper(KateViInputModeManager *kateViInputModeManager, KateDocument *doc, KateView *view );
38  bool handleKeypress(QChar key);
39  void setMappingTimeout(int timeoutMS);
40  void setDoNotMapNextKeypress();
41  bool isExecutingMapping();
42  bool isPlayingBackRejectedKeys();
43 public slots:
44  void mappingTimerTimeOut();
45 private:
46  // Will be the mapping used if we decide that no extra mapping characters will be
47  // typed, either because we have a mapping that cannot be extended to another
48  // mapping by adding additional characters, or we have a mapping and timed out waiting
49  // for it to be extended to a longer mapping.
50  // (Essentially, this allows us to have mappings that extend each other e.g. "'12" and
51  // "'123", and to choose between them.)
52  QString m_fullMappingMatch;
53  QString m_mappingKeys;
54  bool m_doNotExpandFurtherMappings;
55  QTimer *m_mappingTimer;
56  KateViInputModeManager* m_viInputModeManager;
57  KateDocument *m_doc;
58  KateView *m_view;
59  int m_timeoutlen; // time to wait for the next keypress of a multi-key mapping (default: 1000 ms)
60  bool m_doNotMapNextKeypress;
61  int m_numMappingsBeingExecuted;
62  bool m_isPlayingBackRejectedKeys;
63 
64  void executeMapping();
65  void playBackRejectedKeys();
66 };
67 
68 #endif
QChar
KateViInputModeManager
Definition: kateviinputmodemanager.h:68
KATEPART_TESTS_EXPORT
#define KATEPART_TESTS_EXPORT
Definition: katepartprivate_export.h:36
QTimer
QObject
katepartprivate_export.h
QString
KateViKeyMapper
Definition: katevikeymapper.h:33
KateView
Definition: kateview.h:77
KateDocument
Definition: katedocument.h:74
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