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

Konsole

  • kde-4.14
  • applications
  • konsole
  • src
KeyboardTranslatorManager.h
Go to the documentation of this file.
1 /*
2  This source file is part of Konsole, a terminal emulator.
3 
4  Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program 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
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301 USA.
20 */
21 
22 #ifndef KEYBOARDTRANSLATOR_MANAGER_H
23 #define KEYBOARDTRANSLATOR_MANAGER_H
24 
25 // Qt
26 #include <QtCore/QHash>
27 #include <QtCore/QStringList>
28 
29 // Konsole
30 #include "konsole_export.h"
31 #include "KeyboardTranslator.h"
32 
33 class QIODevice;
34 
35 namespace Konsole
36 {
41 class KeyboardTranslatorManager
42 {
43 public:
51  KeyboardTranslatorManager();
52  ~KeyboardTranslatorManager();
53 
60  void addTranslator(KeyboardTranslator* translator);
61 
67  bool deleteTranslator(const QString& name);
68 
70  const KeyboardTranslator* defaultTranslator();
71 
79  const KeyboardTranslator* findTranslator(const QString& name);
86  QStringList allTranslators();
87 
89  static KeyboardTranslatorManager* instance();
90 
91 private:
92  void findTranslators(); // locate all available translators
93 
94  // loads the translator with the given name
95  KeyboardTranslator* loadTranslator(const QString& name);
96  KeyboardTranslator* loadTranslator(QIODevice* device, const QString& name);
97 
98  bool saveTranslator(const KeyboardTranslator* translator);
99  QString findTranslatorPath(const QString& name);
100 
101  bool _haveLoadedAll;
102 
103  const KeyboardTranslator* _fallbackTranslator;
104  QHash<QString, KeyboardTranslator*> _translators;
105 };
106 }
107 
108 #endif // KEYBOARDTRANSLATOR_MANAGER_H
109 
QIODevice
Konsole::KeyboardTranslatorManager::addTranslator
void addTranslator(KeyboardTranslator *translator)
Adds a new translator.
Definition: KeyboardTranslatorManager.cpp:54
Konsole::KeyboardTranslator
A converter which maps between key sequences pressed by the user and the character strings which shou...
Definition: KeyboardTranslator.h:52
konsole_export.h
Konsole::KeyboardTranslatorManager::deleteTranslator
bool deleteTranslator(const QString &name)
Deletes a translator.
Definition: KeyboardTranslatorManager.cpp:63
Konsole::KeyboardTranslatorManager::allTranslators
QStringList allTranslators()
Returns a list of the names of available keyboard translators.
Definition: KeyboardTranslatorManager.cpp:188
KeyboardTranslator.h
QHash
Konsole::KeyboardTranslatorManager::~KeyboardTranslatorManager
~KeyboardTranslatorManager()
Definition: KeyboardTranslatorManager.cpp:42
QString
QStringList
Konsole::KeyboardTranslatorManager::defaultTranslator
const KeyboardTranslator * defaultTranslator()
Returns the default translator for Konsole.
Definition: KeyboardTranslatorManager.cpp:177
Konsole::KeyboardTranslatorManager::instance
static KeyboardTranslatorManager * instance()
Returns the global KeyboardTranslatorManager instance.
Definition: KeyboardTranslatorManager.cpp:49
Konsole::KeyboardTranslatorManager::KeyboardTranslatorManager
KeyboardTranslatorManager()
Constructs a new KeyboardTranslatorManager and loads the list of available keyboard translations...
Definition: KeyboardTranslatorManager.cpp:35
Konsole::KeyboardTranslatorManager
Manages the keyboard translations available for use by terminal sessions, see KeyboardTranslator.
Definition: KeyboardTranslatorManager.h:41
Konsole::KeyboardTranslatorManager::findTranslator
const KeyboardTranslator * findTranslator(const QString &name)
Returns the keyboard translator with the given name or 0 if no translator with that name exists...
Definition: KeyboardTranslatorManager.cpp:102
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • 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