Konsole
KeyBindingEditor.h
Go to the documentation of this file.00001 /* 00002 Copyright 2007-2008 by Robert Knight <robertknight@gmail.com> 00003 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or 00007 (at your option) any later version. 00008 00009 This program 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 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; if not, write to the Free Software 00016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301 USA. 00018 */ 00019 00020 #ifndef KEYBINDINGEDITOR_H 00021 #define KEYBINDINGEDITOR_H 00022 00023 // Qt 00024 #include <QtGui/QWidget> 00025 00026 class QTableWidgetItem; 00027 00028 namespace Ui 00029 { 00030 class KeyBindingEditor; 00031 } 00032 00033 namespace Konsole 00034 { 00035 00036 class KeyboardTranslator; 00037 00051 class KeyBindingEditor : public QWidget 00052 { 00053 Q_OBJECT 00054 00055 public: 00057 KeyBindingEditor(QWidget* parent = 0); 00058 virtual ~KeyBindingEditor(); 00059 00064 void setup(const KeyboardTranslator* translator); 00065 00070 KeyboardTranslator* translator() const; 00071 00075 QString description() const; 00076 00077 // reimplemented to handle test area input 00078 virtual bool eventFilter( QObject* watched , QEvent* event ); 00079 00080 public slots: 00084 void setDescription(const QString& description); 00085 00086 private slots: 00087 void bindingTableItemChanged(QTableWidgetItem* item); 00088 void removeSelectedEntry(); 00089 void addNewEntry(); 00090 00091 private: 00092 void setupKeyBindingTable(const KeyboardTranslator* translator); 00093 00094 Ui::KeyBindingEditor* _ui; 00095 00096 // translator to which modifications are made as the user makes 00097 // changes in the UI. 00098 // this is initialized as a copy of the translator specified 00099 // when setup() is called 00100 KeyboardTranslator* _translator; 00101 }; 00102 00103 } 00104 00105 #endif //KEYBINDINGEDITOR_H