rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
List of all members | Public Member Functions
IlvAccelerator Class Reference

Base class for accelerators. More...

#include <ilviews/util/accel.h>

Inheritance diagram for IlvAccelerator:
IlvContainerAccelerator

Public Member Functions

IlUShort data () const
 Gets the event data. More...
 
IlBoolean match (IlvEventType type, IlUShort data, IlUShort modifiers) const
 Tests if two accelerator descriptions are equivalent. More...
 
IlUShort modifiers () const
 Gets the modifiers. More...
 
IlUShort modMask () const
 Gets the modifiers to ignore. More...
 
void setModMask (IlUShort modifiersToIgnore)
 Sets the modifiers to ignore. More...
 
IlBoolean trigger (IlvEventType type, IlUShort data, IlUShort modifiers) const
 Tests if an event triggers an accelerator. More...
 
IlvEventType type () const
 Gets the event type. More...
 
IlAny userArg () const
 Gets the user argument. More...
 

Detailed Description

Base class for accelerators.

Library: views

This abstract class provides a way to handle an application accelerator, that is, an action and an event description that specify how the action must be triggered.
The event description is represented by the following data members:

If a modifier value is found in both modifiers() and modMask(), its value is removed from modMask(), which means that this modifier remains mandatory to trigger the accelerator.
An accelerator on the IlvButtonDragged event can be triggered only if its members data and modifiers have the same value. For instance:

Generally speaking, an IlvButtonDragged event is always associated with a modifier. The Rogue Wave Views behavior in this specific case mimics the X11 behavior, meaning the modifiers field contains flags for the mouse buttons.
This class does not provide prototype or storage for the accelerator action itself; this must be done in the subclasses because they need specific signatures. However, it provides storage for a user argument that can be used by subclasses as a parameter for the action.
IlvAccelerator provides methods to determine if a given event description matches the accelerator internal description.
This class has no constructor – the constructor is protected. Subclasses must provide a public constructor.

See Also
IlvContainerAccelerator, IlvManagerAccelerator.

Member Function Documentation

IlUShort IlvAccelerator::data ( ) const

Gets the event data.

Returns
The event data associated with the accelerator.
IlBoolean IlvAccelerator::match ( IlvEventType  type,
IlUShort  data,
IlUShort  modifiers 
) const

Tests if two accelerator descriptions are equivalent.

This member function is only used by subclasses to determine if two accelerator descriptions are equivalent. Ideally, there should not be two equivalent accelerators in the same accelerator set. This function ignores the modifier mask member.

Parameters
typeThe event type.
dataThe event data.
modifiersThe set of mandatory modifiers.
Returns
IlTrue if the accelerator is equivalent to the event description. Otherwise, returns IlFalse.
IlUShort IlvAccelerator::modifiers ( ) const

Gets the modifiers.

Returns
The set of modifiers (OR combination) associated with the accelerator.
IlUShort IlvAccelerator::modMask ( ) const

Gets the modifiers to ignore.

Returns
The modifiers to ignore.
void IlvAccelerator::setModMask ( IlUShort  modifiersToIgnore)

Sets the modifiers to ignore.

Sets the modifiers to ignore. This function can be called only after the modifiers are set.

Parameters
modifiersToIgnoreThe modifier mask.
IlBoolean IlvAccelerator::trigger ( IlvEventType  type,
IlUShort  data,
IlUShort  modifiers 
) const

Tests if an event triggers an accelerator.

Parameters
typeThe event type.
dataThe event data.
modifiersThe set of mandatory modifiers.
Returns
IlTrue if the event description given in parameter triggers the accelerator action. This happens if, and only if:
IlvEventType IlvAccelerator::type ( ) const

Gets the event type.

Returns
The event type associated with the accelerator.
IlAny IlvAccelerator::userArg ( ) const

Gets the user argument.

Returns
The user argument. This returned argument is used as a parameter to call the action, if so specified in the subclasses.

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.