kglobalaccel_x11.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _KGLOBALACCEL_X11_H
00021 #define _KGLOBALACCEL_X11_H
00022
00023 #include <qmap.h>
00024 #include <qwidget.h>
00025
00026 #include "kaccelbase.h"
00027 #include "kkeyserver_x11.h"
00028 #include "kshortcut.h"
00029
00033 class KGlobalAccelPrivate : public QWidget, public KAccelBase
00034 {
00035 friend class KGlobalAccel;
00036 Q_OBJECT
00037 public:
00038 KGlobalAccelPrivate();
00039 virtual ~KGlobalAccelPrivate();
00040
00041 virtual void setEnabled( bool bEnabled );
00042
00043 virtual bool emitSignal( Signal signal );
00044 virtual bool connectKey( KAccelAction& action, const KKeyServer::Key& key );
00045 virtual bool connectKey( const KKeyServer::Key& key );
00046 virtual bool disconnectKey( KAccelAction& action, const KKeyServer::Key& key );
00047 virtual bool disconnectKey( const KKeyServer::Key& key );
00048
00049 protected:
00054 class CodeMod
00055 {
00056 public:
00060 uchar code;
00064 uint mod;
00065
00069 bool operator < ( const CodeMod& b ) const
00070 {
00071 if( code < b.code ) return true;
00072 if( code == b.code && mod < b.mod ) return true;
00073 return false;
00074 }
00075 };
00076 typedef QMap<CodeMod, KAccelAction*> CodeModMap;
00077
00078 CodeModMap m_rgCodeModToAction;
00079
00083 bool grabKey( const KKeyServer::Key&, bool bGrab, KAccelAction* );
00084
00092 virtual bool x11Event( XEvent* );
00093 void x11MappingNotify();
00094 bool x11KeyPress( const XEvent *pEvent );
00095 void activate( KAccelAction* pAction, const KKeySequence& seq );
00096 virtual bool isEnabledInternal() const;
00097 static void blockShortcuts( bool block );
00098 void disableBlocking( bool disable );
00099 void suspend( bool s );
00100
00101 protected slots:
00102 void slotActivated( int iAction );
00103 private:
00104 bool m_blocked;
00105 bool m_blockingDisabled;
00106 bool m_suspended;
00107 };
00108
00109 #endif // _KGLOBALACCEL_X11_H
|