org.kde.koala
public class KAccel extends QAccel
KAccel pAccel = new KAccel( this ); // Insert an action "Scroll Up" which is associated with the "Up" key: pAccel.insert( "Scroll Up", i18n("Scroll up"), i18n("Scroll up the current document by one line."), Qt.Key_Up, this, SLOT("slotScrollUp()") ); // Insert an standard acclerator action. pAccel.insert( KStdAccel.Print, this, SLOT("slotPrint()") ); // Update the shortcuts by read any user-defined settings from the // application's config file. pAccel.readSettings();See KAccelSignals for signals emitted by KAccel
See Also: KGlobalAccel KAccelShortcutList KKeyChooser KKeyDialog
UNKNOWN: Configurable shortcut support for widgets.
Constructor Summary | |
---|---|
protected | KAccel(Class dummy) |
KAccel(QWidget pParent, String psName)
Creates a new KAccel that watches pParent , which is also
the QObject's parent. | |
KAccel(QWidget pParent) | |
KAccel(QWidget watch, QObject parent, String psName)
Creates a new KAccel that watches watch. | |
KAccel(QWidget watch, QObject parent) |
Method Summary | |
---|---|
KAccelActions | actions()
Returns the KAccel's KAccelActions , a list of KAccelAction. |
String | className() |
String | configGroup()
Returns the configuration group of the settings. |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
void | emitKeycodeChanged()
Emits the keycodeChanged() signal. |
protected void | finalize() Deletes the wrapped C++ instance |
KAccelAction | insert(String sAction, String sLabel, String sWhatsThis, KShortcut cutDef, QObject pObjSlot, String psMethodSlot, boolean bConfigurable, boolean bEnabled)
Create an accelerator action.
|
KAccelAction | insert(String sAction, String sLabel, String sWhatsThis, KShortcut cutDef, QObject pObjSlot, String psMethodSlot, boolean bConfigurable) |
KAccelAction | insert(String sAction, String sLabel, String sWhatsThis, KShortcut cutDef, QObject pObjSlot, String psMethodSlot) |
KAccelAction | insert(String sAction, String sLabel, String sWhatsThis, KShortcut cutDef3, KShortcut cutDef4, QObject pObjSlot, String psMethodSlot, boolean bConfigurable, boolean bEnabled)
Same as first insert(), but with separate shortcuts defined for
3- and 4- modifier defaults. |
KAccelAction | insert(String sAction, String sLabel, String sWhatsThis, KShortcut cutDef3, KShortcut cutDef4, QObject pObjSlot, String psMethodSlot, boolean bConfigurable) |
KAccelAction | insert(String sAction, String sLabel, String sWhatsThis, KShortcut cutDef3, KShortcut cutDef4, QObject pObjSlot, String psMethodSlot) |
KAccelAction | insert(String psAction, KShortcut cutDef, QObject pObjSlot, String psMethodSlot, boolean bConfigurable, boolean bEnabled)
This is an overloaded function provided for convenience.
|
KAccelAction | insert(String psAction, KShortcut cutDef, QObject pObjSlot, String psMethodSlot, boolean bConfigurable) |
KAccelAction | insert(String psAction, KShortcut cutDef, QObject pObjSlot, String psMethodSlot) |
KAccelAction | insert(int id, QObject pObjSlot, String psMethodSlot, boolean bConfigurable, boolean bEnabled)
Similar to the first insert() method, but with the action
name, short description, help text, and default shortcuts all
set according to one of the standard accelerators. |
KAccelAction | insert(int id, QObject pObjSlot, String psMethodSlot, boolean bConfigurable) |
KAccelAction | insert(int id, QObject pObjSlot, String psMethodSlot) |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isEnabled()
Checks whether the KAccel is active. |
QMetaObject | metaObject() |
boolean | readSettings(KConfigBase pConfig)
Read all shortcuts from pConfig , or (if pConfig
is zero) from the application's configuration file
KGlobal.config().
|
boolean | readSettings() |
boolean | remove(String sAction)
Removes the accelerator action identified by the name.
|
boolean | setAutoUpdate(boolean bAuto)
Enable auto-update of connections. |
void | setConfigGroup(String name)
Returns the configuration group of the settings. |
void | setEnabled(boolean bEnabled)
Enables or disables the KAccel. |
boolean | setEnabled(String sAction, boolean bEnabled)
Enable or disable the action named by sAction. |
boolean | setShortcut(String sAction, KShortcut shortcut)
Set the shortcut to be associated with the action named by sAction. |
boolean | setSlot(String sAction, QObject pObjSlot, String psMethodSlot)
Set the slot to be called when the shortcut of the action named
by sAction is pressed. |
KShortcut | shortcut(String sAction)
Return the shortcut associated with the action named by sAction. |
boolean | updateConnections()
Updates the connections of the accelerations after changing them.
|
boolean | writeSettings(KConfigBase pConfig)
Write the current shortcuts to pConfig ,
or (if pConfig is zero) to the application's
configuration file. |
boolean | writeSettings() |
pParent
, which is also
the QObject's parent.Parameters: pParent the parent and widget to watch for key strokes psName the name of the QObject
UNKNOWN: Creates a new KAccel that watches pParent
, which is also the QObject's parent.
watch.
Parameters: watch the widget to watch for key strokes parent the parent of the QObject psName the name of the QObject
UNKNOWN: Creates a new KAccel that watches watch.
KAccelActions
, a list of KAccelAction.
Returns: the KAccelActions of the KAccel
UNKNOWN:
Returns: the configuration group
See Also: KConfig
UNKNOWN: Returns the configuration group of the settings.
UNKNOWN: Emits the keycodeChanged() signal.
insert( "Do Something", i18n("Do Something"), i18n("This action allows you to do something really great with this program to " "the currently open document."), ALT+Key_D, this, SLOT("slotDoSomething()") );
Parameters: sAction The internal name of the action. sLabel An i18n'ized short description of the action displayed when using KKeyChooser to reconfigure the shortcuts. sWhatsThis An extended description of the action. cutDef The default shortcut. pObjSlot Pointer to the slot object. psMethodSlot Pointer to the slot method. bConfigurable Allow the user to change this shortcut if set to 'true'. bEnabled The action will be activated by the shortcut if set to 'true'.
UNKNOWN: Create an accelerator action.
UNKNOWN: Same as first insert(), but with separate shortcuts defined for 3- and 4- modifier defaults.
insert( i18n("Do Something"), ALT+Key_D, this, SLOT("slotDoSomething()") );
Parameters: psAction The name AND label of the action. cutDef The default shortcut for this action. pObjSlot Pointer to the slot object. psMethodSlot Pointer to the slot method. bConfigurable Allow the user to change this shortcut if set to 'true'. bEnabled The action will be activated by the shortcut if set to 'true'.
UNKNOWN: This is an overloaded function provided for convenience.
See Also: #
UNKNOWN: Similar to the first insert() method, but with the action name, short description, help text, and default shortcuts all set according to one of the standard accelerators.
Returns: true if the QAccel is enabled
UNKNOWN: Checks whether the KAccel is active.
pConfig
, or (if pConfig
is zero) from the application's configuration file
KGlobal.config().
The group in which the configuration is stored can be
set with setConfigGroup().Parameters: pConfig the configuration file, or 0 for the application configuration file
Returns: true if successful, false otherwise
UNKNOWN: Read all shortcuts from pConfig
, or (if pConfig
is zero) from the application's configuration file KGlobal.config().
Parameters: sAction the name of the action to remove
Returns: true if successful, false otherwise
UNKNOWN: Removes the accelerator action identified by the name.
Parameters: bAuto true to enable, false to disable
Returns: the value of the flag before this call
UNKNOWN: Enable auto-update of connections.
Parameters: name the new configuration group
See Also: KConfig
UNKNOWN: Returns the configuration group of the settings.
Parameters: bEnabled true to enable, false to disable
UNKNOWN: Enables or disables the KAccel.
sAction.
Parameters: sAction the action to en-/disable bEnabled true to enable, false to disable
Returns: true if successful, false otherwise
UNKNOWN: Enable or disable the action named by sAction.
sAction.
Parameters: sAction the name of the action shortcut the shortcut to set
Returns: true if successful, false otherwise
UNKNOWN: Set the shortcut to be associated with the action named by sAction.
sAction
is pressed.Parameters: sAction the name of the action pObjSlot the owner of the slot psMethodSlot the name of the slot
Returns: true if successful, false otherwise
UNKNOWN: Set the slot to be called when the shortcut of the action named by sAction
is pressed.
sAction.
Parameters: sAction the name of the action
Returns: the action's shortcut, or a null shortcut if not found
UNKNOWN: Return the shortcut associated with the action named by sAction.
Returns: true if successful, false otherwise
UNKNOWN: Updates the connections of the accelerations after changing them.
pConfig
,
or (if pConfig
is zero) to the application's
configuration file.Parameters: pConfig the configuration file, or 0 for the application configuration file
Returns: true if successful, false otherwise
UNKNOWN: Write the current shortcuts to pConfig
, or (if pConfig
is zero) to the application's configuration file.