• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDECore

KAccelActions Class Reference

A collection of accelerator actions. More...

#include <kaccelaction.h>

List of all members.


Public Member Functions

int actionIndex (const QString &sAction) const
KAccelAction * actionPtr (KKeySequence cut)
const KAccelAction * actionPtr (const QString &sAction) const
KAccelAction * actionPtr (const QString &sAction)
const KAccelAction * actionPtr (uint index) const
KAccelAction * actionPtr (uint index)
void clear ()
uint count () const
void emitKeycodeChanged ()
bool init (KConfigBase &config, const QString &sGroup)
bool init (const KAccelActions &actions)
KAccelAction * insert (const QString &sName, const QString &sLabel)
KAccelAction * 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)
 KAccelActions (const KAccelActions &)
 KAccelActions ()
const KAccelAction & operator[] (uint index) const
KAccelAction & operator[] (uint index)
bool readActions (const QString &sConfigGroup="Shortcuts", KConfigBase *pConfig=0)
bool remove (const QString &sAction)
void updateShortcuts (KAccelActions &shortcuts)
bool writeActions (const QString &sConfigGroup="Shortcuts", KConfigBase *pConfig=0, bool bWriteAll=false, bool bGlobal=false) const
virtual ~KAccelActions ()

Protected Member Functions

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

Protected Attributes

uint m_nSize
uint m_nSizeAllocated
KAccelBase * m_pKAccelBase
KAccelAction ** m_prgActions

Detailed Description

A collection of accelerator actions.

For internal use only.

This class represents a collection of KAccelAction objects.

See also:
KAccelAction

Definition at line 369 of file kaccelaction.h.


Constructor & Destructor Documentation

KAccelActions::KAccelActions (  ) 

Creates a new, empty KAccelActions object.

Definition at line 237 of file kaccelaction.cpp.

KAccelActions::KAccelActions ( const KAccelActions &  actions  ) 

Copy constructor (deep copy).

Definition at line 243 of file kaccelaction.cpp.

KAccelActions::~KAccelActions (  )  [virtual]

Definition at line 256 of file kaccelaction.cpp.


Member Function Documentation

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 ( 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.

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 ( 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 ( 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 ( 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.

void KAccelActions::clear (  ) 

Removes all items from this collection.

Definition at line 271 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::emitKeycodeChanged (  ) 

Emit a keycodeChanged signal.

Definition at line 558 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.

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.

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.

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.

void KAccelActions::insertPtr ( KAccelAction *  pAction  )  [protected]

Add a action to this collection.

Todo:
Document ownership.

Definition at line 343 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::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.

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::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.

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

Resize the list to the given number new_size of entries.

Todo:
Can you make it smaller?

Implementation seems to break m_nSize.

Definition at line 321 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.

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.


Member Data Documentation

uint KAccelActions::m_nSize [protected]

< Amount in use.

Definition at line 554 of file kaccelaction.h.

uint KAccelActions::m_nSizeAllocated [protected]

< Allocated size of the array.

Definition at line 554 of file kaccelaction.h.

KAccelBase* KAccelActions::m_pKAccelBase [protected]

Base object that proxies signals from us.

Definition at line 551 of file kaccelaction.h.

KAccelAction** KAccelActions::m_prgActions [protected]

Array of actions we're hanging on to.

Definition at line 553 of file kaccelaction.h.


The documentation for this class was generated from the following files:
  • kaccelaction.h
  • kaccelaction.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal