00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _KGLOBALACCEL_H_
00021 #define _KGLOBALACCEL_H_
00022
00023 #include <tqobject.h>
00024 #include <tdeshortcut.h>
00025
00026 class TQPopupMenu;
00027 class TQWidget;
00028 class TDEAccelAction;
00029 class TDEAccelActions;
00030 class TDEConfigBase;
00031
00032 class TDEGlobalAccelPrivate;
00033
00045 class TDECORE_EXPORT TDEGlobalAccel : public TQObject
00046 {
00047 Q_OBJECT
00048 public:
00055 TDEGlobalAccel( TQObject* pParent, const char* psName = 0 );
00056 virtual ~TDEGlobalAccel();
00057
00062 bool isEnabled();
00063
00069 void setEnabled( bool bEnabled );
00070
00093 TDEAccelAction* insert( const TQString& sAction, const TQString& sLabel, const TQString& sWhatsThis,
00094 const TDEShortcut& cutDef3, const TDEShortcut& cutDef4,
00095 const TQObject* pObjSlot, const char* psMethodSlot,
00096 bool bConfigurable = true, bool bEnabled = true );
00097
00104 bool remove( const TQString& sAction );
00105
00113 TDEAccelAction* insert( const TQString& sName, const TQString& sLabel );
00114
00119 bool updateConnections();
00120
00126 const TDEShortcut& shortcut( const TQString& sAction ) const;
00133 bool setShortcut( const TQString& sAction, const TDEShortcut &shortcut );
00142 bool setSlot( const TQString& sAction, const TQObject* pObjSlot, const char* psMethodSlot );
00143
00148 bool setActionEnabled( const TQString& sAction, bool bEnable );
00155 TQString label( const TQString& sAction ) const;
00156
00162 const TQString& configGroup() const;
00163
00169 void setConfigGroup( const TQString &cg );
00170
00179 bool readSettings( TDEConfigBase* pConfig = 0 );
00180
00190 bool writeSettings( TDEConfigBase* pConfig = 0 ) const;
00191
00202 bool writeSettings( TDEConfigBase* pConfig, bool bGlobal ) const;
00203
00208 static bool useFourModifierKeys();
00209
00213 static void blockShortcuts( bool block );
00217 void disableBlocking( bool disable );
00218
00222
00223 void suspend( bool s );
00224
00225 private:
00226
00227 TDEAccelActions& actions();
00228 const TDEAccelActions& actions() const;
00229
00230 friend class TDEGlobalAccelPrivate;
00231 friend class TDEAccelShortcutList;
00232 protected:
00234 virtual void virtual_hook( int id, void* data );
00235 private:
00236 class TDEGlobalAccelPrivate* d;
00237 };
00238
00239 #endif // _KGLOBALACCEL_H_