20#ifndef _TDEACCELACTION_H
21#define _TDEACCELACTION_H
24#include <tqptrvector.h>
26#include <tqvaluevector.h>
28#include <tdeshortcut.h>
72class TDECORE_EXPORT TDEAccelAction
84 TDEAccelAction(
const TDEAccelAction& );
100 TDEAccelAction(
const TQString& sName,
const TQString& sLabel,
const TQString& sWhatsThis,
102 const TQObject* pObjSlot,
const char* psMethodSlot,
103 bool bConfigurable,
bool bEnabled );
126 bool init(
const TQString& sName,
const TQString& sLabel,
const TQString& sWhatsThis,
128 const TQObject* pObjSlot,
const char* psMethodSlot,
129 bool bConfigurable,
bool bEnabled );
134 TDEAccelAction& operator=(
const TDEAccelAction& );
141 const TQString&
name()
const {
return m_sName; }
148 const TQString&
label()
const {
return m_sLabel; }
155 const TQString&
whatsThis()
const {
return m_sWhatsThis; }
197 const TQObject* objSlotPtr()
const {
return m_pObjSlot; }
203 const char* methodSlotPtr()
const {
return m_psMethodSlot; }
209 bool isConfigurable()
const {
return m_bConfigurable; }
215 bool isEnabled()
const {
return m_bEnabled; }
221 void setName(
const TQString& name );
227 void setLabel(
const TQString& label );
233 void setWhatsThis(
const TQString& whatsThis );
247 void setSlot(
const TQObject* pObjSlot,
const char* psMethodSlot );
253 void setConfigurable(
bool configurable );
259 void setEnabled(
bool enable );
265 int getID()
const {
return m_nIDAccel; }
274 void setID(
int n ) { m_nIDAccel = n; }
280 bool isConnected()
const;
289 bool setKeySequence( uint i,
const KKeySequence &keySeq );
296 void clearShortcut();
311 TQString toString()
const;
316 TQString toStringInternal()
const;
322 static bool useFourModifierKeys();
329 static void useFourModifierKeys(
bool use );
338 const TQObject* m_pObjSlot ;
339 const char* m_psMethodSlot ;
340 bool m_bConfigurable ,
343 uint m_nConnections ;
346 void incConnections();
348 void decConnections();
351 static int g_bUseFourModifierKeys;
352 class TDEAccelActionPrivate* d;
354 friend class TDEAccelActions;
355 friend class TDEAccelBase;
369class TDECORE_EXPORT TDEAccelActions
380 TDEAccelActions(
const TDEAccelActions& );
381 virtual ~TDEAccelActions();
394 bool init(
const TDEAccelActions &actions );
411 void updateShortcuts( TDEAccelActions &shortcuts );
418 int actionIndex(
const TQString& sAction )
const;
427 TDEAccelAction* actionPtr( uint index );
436 const TDEAccelAction* actionPtr( uint index )
const;
444 TDEAccelAction* actionPtr(
const TQString& sAction );
452 const TDEAccelAction* actionPtr(
const TQString& sAction )
const;
470 TDEAccelAction& operator []( uint index );
480 const TDEAccelAction& operator []( uint index )
const;
497 TDEAccelAction*
insert(
const TQString& sAction,
const TQString& sLabel,
const TQString& sWhatsThis,
499 const TQObject* pObjSlot = 0,
const char* psMethodSlot = 0,
500 bool bConfigurable =
true,
bool bEnabled =
true );
508 TDEAccelAction*
insert(
const TQString& sName,
const TQString& sLabel );
515 bool remove(
const TQString& sAction );
524 bool readActions(
const TQString& sConfigGroup =
"Shortcuts",
TDEConfigBase* pConfig = 0 );
535 bool writeActions(
const TQString& sConfigGroup =
"Shortcuts",
TDEConfigBase* pConfig = 0,
536 bool bWriteAll =
false,
bool bGlobal =
false )
const;
541 void emitKeycodeChanged();
551 TDEAccelBase* m_pTDEAccelBase;
553 TDEAccelAction** m_prgActions;
554 uint m_nSizeAllocated ,
562 void resize( uint new_size );
564 void insertPtr( TDEAccelAction* );
567 class TDEAccelActionsPrivate* d;
569 TDEAccelActions( TDEAccelBase* );
570 void initPrivate( TDEAccelBase* );
571 TDEAccelActions& operator =( TDEAccelActions& );
573 friend class TDEAccelBase;
A KKeySequence object holds a sequence of up to 4 keys.
KDE Configuration Management abstract base class.
Access KDE Configuration entries.
The TDEShortcut class is used to represent a keyboard shortcut to an action.
TDEAction * whatsThis(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)
TDEAction * clear(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)
const char * name(StdAction id)
TDEShortcut shortcutDefault3(StdAccel id)
Returns the hardcoded default 3 modifier shortcut for id.
TDEShortcut shortcutDefault4(StdAccel id)
Returns the hardcoded default 4 modifier shortcut for id.
const TDEShortcut & insert()
Toggle insert/overwrite (with visual feedback, e.g.
TDEShortcut shortcutDefault(StdAccel id)
Returns the hardcoded default shortcut for id.
TQString label(StdAccel id)
Returns a localized label for user-visible display.
const TDEShortcut & shortcut(StdAccel id)
Returns the keybinding for accel.