00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef _KSHORTCUTDIALOG_H_
00021
#define _KSHORTCUTDIALOG_H_
00022
00023
#include "kdialogbase.h"
00024
#include "kshortcut.h"
00025
00026
class QVBox;
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,
QWidget* 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
00053
bool m_bQtShortcut;
00054
00055
KShortcut m_shortcut;
00056
bool m_bGrab;
00057
KPushButton* m_ptxtCurrent;
00058 uint m_iSeq;
00059 uint m_iKey;
00060
bool m_bRecording;
00061 uint m_mod;
00062 KShortcutDialogSimple *m_simple;
00063 KShortcutDialogAdvanced *m_adv;
00064
QVBox *m_stack;
00065
00066
void updateShortcutDisplay();
00067
00068
void keyPressed(
KKey key );
00069
void updateDetails();
00070
00071
#ifdef Q_WS_X11
00072
virtual bool x11Event( XEvent *pEvent );
00073
00074
void x11KeyPressEvent( XEvent* pEvent );
00075
void x11KeyReleaseEvent( XEvent* pEvent );
00076
#endif
00077
#ifdef Q_WS_WIN
00078
virtual void keyPressEvent(
QKeyEvent * e );
00079
virtual bool event(
QEvent * e);
00080
#endif
00081
00082
protected slots:
00083
void slotDetails();
00084
void slotSelectPrimary();
00085
void slotSelectAlternate();
00086
void slotClearShortcut();
00087
void slotClearPrimary();
00088
void slotClearAlternate();
00089
void slotMultiKeyMode(
bool bOn );
00090
00091
private:
00092
class KShortcutDialogPrivate* d;
00093
static bool s_showMore;
00094 };
00095
00096
#endif // _KSHORTCUTDIALOG_H_