kshortcutdialog.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2002,2003 Ellis Whitehead <ellis@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library 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 GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _KSHORTCUTDIALOG_H_ 00021 #define _KSHORTCUTDIALOG_H_ 00022 00023 #include "kdialogbase.h" 00024 #include "kshortcut.h" 00025 00026 class TQVBox; 00027 class KPushButton; 00028 class KShortcutDialogSimple; 00029 class KShortcutDialogAdvanced; 00030 00041 class KDEUI_EXPORT KShortcutDialog : public KDialogBase 00042 { 00043 Q_OBJECT 00044 public: 00045 KShortcutDialog( const KShortcut& shortcut, bool bQtShortcut, TQWidget* parent = 0, const char* name = 0 ); 00046 ~KShortcutDialog(); 00047 00048 void setShortcut( const KShortcut & shortcut ); 00049 const KShortcut& shortcut() const { return m_shortcut; } 00050 00051 private: 00052 // true if qt shortcut, false if native shortcut 00053 bool m_bQtShortcut; 00054 00055 KShortcut m_shortcut; 00056 KPushButton* m_ptxtCurrent; 00057 uint m_iSeq; 00058 uint m_iKey; 00059 bool m_bRecording; 00060 uint m_mod; 00061 KShortcutDialogSimple *m_simple; 00062 KShortcutDialogAdvanced *m_adv; 00063 TQVBox *m_stack; 00064 00065 void updateShortcutDisplay(); 00066 //void displayMods(); 00067 void keyPressed( KKey key ); 00068 void updateDetails(); 00069 00070 #ifdef Q_WS_X11 00071 virtual bool x11Event( XEvent *pEvent ); 00072 //void x11EventKeyPress( XEvent *pEvent ); 00073 void x11KeyPressEvent( XEvent* pEvent ); 00074 void x11KeyReleaseEvent( XEvent* pEvent ); 00075 #endif 00076 #ifdef Q_WS_WIN 00077 virtual void keyPressEvent( TQKeyEvent * e ); 00078 virtual bool event(TQEvent * e); 00079 #endif 00080 00081 protected slots: 00082 void slotDetails(); 00083 void slotSelectPrimary(); 00084 void slotSelectAlternate(); 00085 void slotClearShortcut(); 00086 void slotClearPrimary(); 00087 void slotClearAlternate(); 00088 void slotMultiKeyMode( bool bOn ); 00089 00090 private: 00091 class KShortcutDialogPrivate* d; 00092 static bool s_showMore; 00093 }; 00094 00095 #endif // _KSHORTCUTDIALOG_H_