kdeui Library API Documentation

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., 59 Temple Place - Suite 330,
00017     Boston, MA 02111-1307, USA.
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 
00031 class KShortcutDialog : public KDialogBase
00032 {
00033     Q_OBJECT
00034 public:
00035     KShortcutDialog( const KShortcut& shortcut, bool bQtShortcut, QWidget* parent = 0, const char* name = 0 );
00036     ~KShortcutDialog();
00037 
00038     const KShortcut& shortcut() const { return m_shortcut; }
00039 
00040 private:
00041     // true if qt shortcut, false if native shortcut
00042     bool m_bQtShortcut;
00043 
00044     KShortcut m_shortcut;
00045     bool m_bGrab;
00046     KPushButton* m_ptxtCurrent;
00047     uint m_iSeq;
00048     uint m_iKey;
00049     bool m_bRecording;
00050     uint m_mod;
00051     KShortcutDialogSimple *m_simple;
00052     KShortcutDialogAdvanced *m_adv;
00053     QVBox *m_stack;
00054     
00055     void setShortcut( const KShortcut & shortcut );
00056     void updateShortcutDisplay();
00057     //void displayMods();
00058     void keyEvent( QKeyEvent * pEvent );
00059     void keyPressed( KKey key );
00060     void updateDetails();
00061 
00062     #ifdef Q_WS_X11
00063     virtual bool x11Event( XEvent *pEvent );
00064     //void x11EventKeyPress( XEvent *pEvent );
00065     void x11KeyPressEvent( XEvent* pEvent );
00066     void x11KeyReleaseEvent( XEvent* pEvent );
00067     #endif
00068 
00069 private slots:
00070     void slotDetails();
00071     void slotSelectPrimary();
00072     void slotSelectAlternate();
00073     void slotClearShortcut();
00074     void slotClearPrimary();
00075     void slotClearAlternate();
00076     void slotMultiKeyMode( bool bOn );
00077 
00078 private:
00079     // ### KDE4: add d-pointer?
00080     static bool s_showMore;
00081 };
00082 
00083 #endif // _KSHORTCUTDIALOG_H_
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 23 17:11:55 2004 by doxygen 1.3.8-20040913 written by Dimitri van Heesch, © 1997-2003