KAccelActions Class Reference

List of all members.

Detailed Description

Definition at line 369 of file kaccelaction.h.


Public Member Functions

 KAccelActions ()
 KAccelActions (const KAccelActions &)
virtual ~KAccelActions ()
void clear ()
bool init (const KAccelActions &actions)
bool init (KConfigBase &config, const QString &sGroup)
void updateShortcuts (KAccelActions &shortcuts)
int actionIndex (const QString &sAction) const
KAccelActionactionPtr (uint index)
const KAccelActionactionPtr (uint index) const
KAccelActionactionPtr (const QString &sAction)
const KAccelActionactionPtr (const QString &sAction) const
KAccelActionactionPtr (KKeySequence cut)
KAccelActionoperator[] (uint index)
const KAccelActionoperator[] (uint index) const
KAccelActioninsert (const QString &sAction, const QString &sLabel, const QString &sWhatsThis, const KShortcut &rgCutDefaults3, const KShortcut &rgCutDefaults4, const QObject *pObjSlot=0, const char *psMethodSlot=0, bool bConfigurable=true, bool bEnabled=true)
KAccelActioninsert (const QString &sName, const QString &sLabel)
bool remove (const QString &sAction)
bool readActions (const QString &sConfigGroup="Shortcuts", KConfigBase *pConfig=0)
bool writeActions (const QString &sConfigGroup="Shortcuts", KConfigBase *pConfig=0, bool bWriteAll=false, bool bGlobal=false) const
void emitKeycodeChanged ()
uint count () const

Protected Member Functions

void resize (uint new_size)
void insertPtr (KAccelAction *)

Protected Attributes

KAccelBasem_pKAccelBase
KAccelAction ** m_prgActions
uint m_nSizeAllocated
uint m_nSize

Friends

class KAccelBase

Constructor & Destructor Documentation

KAccelActions::KAccelActions (  ) 

Creates a new, empty KAccelActions object.

Definition at line 237 of file kaccelaction.cpp.

KAccelActions::KAccelActions ( const KAccelActions  ) 

Copy constructor (deep copy).

Definition at line 243 of file kaccelaction.cpp.


Member Function Documentation

void KAccelActions::clear (  ) 

Removes all items from this collection.

Definition at line 271 of file kaccelaction.cpp.

bool KAccelActions::init ( const KAccelActions actions  ) 

Initializes this object with the given actions.

It will make a deep copy of all actions.

Parameters:
actions the actions to copy
Returns:
true if successful, false otherwise

Definition at line 282 of file kaccelaction.cpp.

bool KAccelActions::init ( KConfigBase config,
const QString sGroup 
)

Loads the actions from the given configuration file.

Parameters:
config the configuration file to load from
sGroup the group in the configuration file
Returns:
true if successful, false otherwise

Definition at line 297 of file kaccelaction.cpp.

void KAccelActions::updateShortcuts ( KAccelActions shortcuts  ) 

Updates the shortcuts of all actions in this object with the shortcuts from the given object.

Parameters:
shortcuts the collection that contains the new shortcuts

Definition at line 349 of file kaccelaction.cpp.

int KAccelActions::actionIndex ( const QString sAction  )  const

Retrieves the index of the action with the given name.

Parameters:
sAction the action to search
Returns:
the index of the action, or -1 if not found

Definition at line 374 of file kaccelaction.cpp.

KAccelAction * KAccelActions::actionPtr ( uint  index  ) 

Returns the action with the given index.

Parameters:
index the index of an action. You must not use an index that is too high.
Returns:
the KAccelAction with the given index
See also:
count()

Definition at line 385 of file kaccelaction.cpp.

const KAccelAction * KAccelActions::actionPtr ( uint  index  )  const

Returns the action with the given index.

Parameters:
index the index of an action. You must not use an index that is too high.
Returns:
the KAccelAction with the given index
See also:
count()

Definition at line 390 of file kaccelaction.cpp.

KAccelAction * KAccelActions::actionPtr ( const QString sAction  ) 

Returns the action with the given name.

Parameters:
sAction the name of the action to search
Returns:
the KAccelAction with the given name, or 0 if not found

Definition at line 395 of file kaccelaction.cpp.

const KAccelAction * KAccelActions::actionPtr ( const QString sAction  )  const

Returns the action with the given name.

Parameters:
sAction the name of the action to search
Returns:
the KAccelAction with the given name, or 0 if not found

Definition at line 401 of file kaccelaction.cpp.

KAccelAction * KAccelActions::actionPtr ( KKeySequence  cut  ) 

Returns the action with the given key sequence.

Parameters:
cut the sequence to search for
Returns:
the KAccelAction with the given sequence, or 0 if not found

Definition at line 407 of file kaccelaction.cpp.

KAccelAction & KAccelActions::operator[] ( uint  index  ) 

Returns the action with the given index.

Parameters:
index the index of an action. You must not use an index that is too high.
Returns:
the KAccelAction with the given index
See also:
actionPtr()

count()

Definition at line 418 of file kaccelaction.cpp.

const KAccelAction & KAccelActions::operator[] ( uint  index  )  const

Returns the action with the given index.

Parameters:
index the index of an action. You must not use an index that is too high.
Returns:
the KAccelAction with the given index
See also:
actionPtr()

count()

Definition at line 423 of file kaccelaction.cpp.

KAccelAction * KAccelActions::insert ( const QString sAction,
const QString sLabel,
const QString sWhatsThis,
const KShortcut rgCutDefaults3,
const KShortcut rgCutDefaults4,
const QObject pObjSlot = 0,
const char *  psMethodSlot = 0,
bool  bConfigurable = true,
bool  bEnabled = true 
)

Inserts an action into the collection.

Parameters:
sAction the name of the accelerator
sLabel the label of the accelerator (i18n!)
sWhatsThis the What's This text (18n!)
rgCutDefaults3 the default shortcut for 3 modifier systems
rgCutDefaults4 the default shortcut for 4 modifier systems
pObjSlot the receiver of a signal when the key has been pressed
psMethodSlot the slot to connect for key presses. Receives an int, as set by setID(), as only argument
bConfigurable if true the user can configure the shortcut
bEnabled if true the accelerator should be enabled
Returns:
the new action

Definition at line 445 of file kaccelaction.cpp.

KAccelAction * KAccelActions::insert ( const QString sName,
const QString sLabel 
)

Inserts an action into the collection.

Parameters:
sName the name of the accelerator
sLabel the label of the accelerator (i18n!)
Returns:
the new action

Definition at line 428 of file kaccelaction.cpp.

bool KAccelActions::remove ( const QString sAction  ) 

Removes the given action.

Parameters:
sAction the name of the action.
Returns:
true if successful, false otherwise

Definition at line 467 of file kaccelaction.cpp.

bool KAccelActions::readActions ( const QString sConfigGroup = "Shortcuts",
KConfigBase pConfig = 0 
)

Loads the actions from the given configuration file.

Parameters:
sConfigGroup the group in the configuration file
pConfig the configuration file to load from
Returns:
true if successful, false otherwise

Definition at line 486 of file kaccelaction.cpp.

bool KAccelActions::writeActions ( const QString sConfigGroup = "Shortcuts",
KConfigBase pConfig = 0,
bool  bWriteAll = false,
bool  bGlobal = false 
) const

Writes the actions to the given configuration file.

Parameters:
sConfigGroup the group in the configuration file
pConfig the configuration file to save to
bWriteAll true to write all actions
bGlobal true to write to the global configuration file
Returns:
true if successful, false otherwise

Definition at line 505 of file kaccelaction.cpp.

void KAccelActions::emitKeycodeChanged (  ) 

Emit a keycodeChanged signal.

Definition at line 558 of file kaccelaction.cpp.

uint KAccelActions::count (  )  const

Returns the number of actions in the collection.

Returns:
the number of actions

Definition at line 564 of file kaccelaction.cpp.

void KAccelActions::resize ( uint  new_size  )  [protected]

Resize the list to the given number new_size of entries.

Todo:
Can you make it smaller?
Todo:
Implementation seems to break m_nSize.

Definition at line 321 of file kaccelaction.cpp.

void KAccelActions::insertPtr ( KAccelAction  )  [protected]

Add a action to this collection.

Todo:
Document ownership.

Definition at line 343 of file kaccelaction.cpp.


Member Data Documentation

Base object that proxies signals from us.

Definition at line 551 of file kaccelaction.h.

Array of actions we're hanging on to.

Definition at line 553 of file kaccelaction.h.

< Allocated size of the array.

Definition at line 554 of file kaccelaction.h.

uint KAccelActions::m_nSize [protected]

< Amount in use.

Definition at line 554 of file kaccelaction.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys