Home · All Classes |
MReactionMap can be used to add low latency haptic feedback to applications. More...
#include <mreactionmap.h>
Public Member Functions | |
virtual | ~MReactionMap () |
Class destructor. | |
void | setInactiveDrawingValue () |
Sets a drawing value that gives no reaction when user touches it. | |
void | setReactiveDrawingValue () |
Sets a drawing value that reacts when user touches or lifts finger from it. | |
void | setTransparentDrawingValue () |
Sets a drawing value that is transparent when user touches or lifts finger from it. | |
void | setDrawingValue (const QString &pressFeedback, const QString &releaseFeedback) |
Sets a drawing value that represents the specified press and release feedbacks. | |
QTransform | transform () const |
Returns a QTransform transformation matrix that maps screen coordinates to reaction map coordinates. | |
void | setTransform (QTransform transform) |
Sets a QTransform transformation matrix which is used when drawing to the reaction map. | |
void | setTransform (QGraphicsItem *item, QGraphicsView *view) |
Generates a QTransform transformation matrix from QGraphicsItem and QGraphicsView which is used when drawing to the reaction map. | |
void | fillRectangle (int x, int y, int width, int height) |
Draws a filled rectangle on the reaction map using the current transformation matrix and drawing value. | |
void | fillRectangle (const QRect &rectangle) |
Draws a filled rectangle on the reaction map using the current transformation matrix and drawing value. | |
void | fillRectangle (const QRectF &rectangle) |
Draws a filled rectangle on the reaction map using the current transformation matrix and drawing value. | |
void | fillRectangle (const QRect &rectangle, const QString &pressFeedback, const QString &releaseFeedback) |
Draws a filled rectangle on the reaction map with the given press and release values. The current transformation matrix is used. | |
void | fillRectangle (const QRectF &rectangle, const QString &pressFeedback, const QString &releaseFeedback) |
Draws a filled rectangle on the reaction map with the given press and release values. The current transformation matrix is used. | |
void | fillItemBoundRect (QGraphicsItem *item) |
Draws a filled bound rectangle for a graphics item. | |
void | fillItemBoundRect (QGraphicsItem *item, const QString &pressFeedback, const QString &releaseFeedback) |
Draws a filled bound rectangle for a graphics item. | |
int | width () const |
Reaction map width. | |
int | height () const |
Reaction map height. | |
void | clear () |
Clears the reaction map. | |
Static Public Member Functions | |
static MReactionMap * | instance (QWidget &anyWidget) |
Returns the reaction map for a (top-level) widget. | |
static MReactionMap * | createInstance (QWidget &anyWidget, const QString &appIdentifier=QString(), QObject *parent=0) |
Creates a reaction map for a (top-level) widget. | |
Static Public Attributes | |
static const QString | Press = "priority2_static_press" |
static const QString | Release = "priority2_static_release" |
static const QString | Cancel = "" |
static const QString | Transparent = "transparent" |
static const QString | Inactive = "" |
Protected Member Functions | |
MReactionMap (QWidget &topLevelWidget, const QString &appIdentifier=QString(), QObject *parent=0) | |
Class constructor. | |
Protected Attributes | |
MReactionMapPrivate * | d |
MReactionMap can be used to add low latency haptic feedback to applications.
MReactionMap draws a reactive map to shared memory which is used by meegofeedback daemon to provide haptic feedback. The daemon listens to touchscreen events directly from the touchscreen kernel interface and delivers haptic feedback based on the reaction map that has been drawn by MReactionMap. This is done to minimize the latency of the haptic feedback.
MReactionMap instance can be constructed after the top-level QWidget of the application has been created. Please note that there can be only one MReactionMap instance per top-level QWidget.
After the MReactionMap instance has been created the MReactionMap API can be used to draw on the created reaction map. Any point on the map defines which feedback will be played when the user's finger enters or leaves the display at that point.
Copyright © Copyright (C) 2011 Nokia Corporation
License The GNU Lesser General Public License, version 2.1
MReactionMap::MReactionMap | ( | QWidget & | topLevelWidget, | |
const QString & | appIdentifier = QString() , |
|||
QObject * | parent = 0 | |||
) | [explicit, protected] |
Class constructor.
Creates the widget's reaction map. There must be only one reaction map instance per top-level widget.
topLevelWidget | Reference to a top-level widget | |
appIdentifier | Application identifier that is used to locate custom feedback effects for the program using theming. If appIdentifier name is not provided, application identifier is determined from the name of the executable binary file of the application. | |
parent | Optional parent object. |
State: Stable
MReactionMap::~MReactionMap | ( | ) | [virtual] |
Class destructor.
Destroys the reaction map.
State: Stable
void MReactionMap::clear | ( | ) |
Clears the reaction map.
Clears the reaction map by filling the entire reaction map with Inactive drawing value.
Stable
MReactionMap * MReactionMap::createInstance | ( | QWidget & | anyWidget, | |
const QString & | appIdentifier = QString() , |
|||
QObject * | parent = 0 | |||
) | [static] |
Creates a reaction map for a (top-level) widget.
If the supplied widget is not a top-level widget, reaction map will be created for top-level widget that is the ancestor of the supplied widget. If a reaction map has been created already, the existing reaction map is returned.
anyWidget | Reference to a top-level widget or a descendant of a top-level widget | |
appIdentifier | Application identifier that is used to locate custom feedback effects for the program using theming. If appIdentifier name is not provided, application identifier is determined from the name of the executable binary file of the application. | |
parent | Optional parent object. |
Stable
void MReactionMap::fillItemBoundRect | ( | QGraphicsItem * | item, | |
const QString & | pressFeedback, | |||
const QString & | releaseFeedback | |||
) |
Draws a filled bound rectangle for a graphics item.
Draws a filled bound rectangle of a graphics item in the view that is associated with the reaction map instance that this function is called from. Even though the specified drawing values override the currently set drawing values, the currently set drawing value itself won't be changed by this method.
item | A graphics item to be drawn. | |
pressFeedback | Name of feedback to be played when screen is pressed. Empty string means Inactive value. | |
releaseFeedback | Name of feedback to be played when screen is released. Empty string means Inactive value. |
Stable
void MReactionMap::fillItemBoundRect | ( | QGraphicsItem * | item | ) |
Draws a filled bound rectangle for a graphics item.
Draws a filled bound rectangle of a graphics item in the view that is associated with the reaction map instance that this function is called from.
item | A graphics item to be drawn. |
Stable
void MReactionMap::fillRectangle | ( | int | x, | |
int | y, | |||
int | width, | |||
int | height | |||
) |
Draws a filled rectangle on the reaction map using the current transformation matrix and drawing value.
x | X coordinate of the top-left corner of the rectangle. | |
y | Y coordinate of the top-left corner of the rectangle. | |
width | Width of the rectangle. | |
height | Height of the rectangle. |
Stable
void MReactionMap::fillRectangle | ( | const QRectF & | rectangle, | |
const QString & | pressFeedback, | |||
const QString & | releaseFeedback | |||
) |
Draws a filled rectangle on the reaction map with the given press and release values. The current transformation matrix is used.
Even though the specified values override the currently set drawing value, the currently set drawing value itself will not be changed by this method. Therefore subsequent calls to for example fillRectangle(QRect &rectangle) will still use the drawing value that was set before this method was called.
rectangle | The filled rectangle to be drawn. | |
pressFeedback | Name of feedback to be played when screen is pressed. Empty string means Inactive value. | |
releaseFeedback | Name of feedback to be played when screen is released. Empty string means Inactive value. |
Stable
void MReactionMap::fillRectangle | ( | const QRect & | rectangle | ) |
Draws a filled rectangle on the reaction map using the current transformation matrix and drawing value.
rectangle | The filled rectangle to be drawn. |
Stable
void MReactionMap::fillRectangle | ( | const QRect & | rectangle, | |
const QString & | pressFeedback, | |||
const QString & | releaseFeedback | |||
) |
Draws a filled rectangle on the reaction map with the given press and release values. The current transformation matrix is used.
Even though the specified values override the currently set drawing value, the currently set drawing value itself will not be changed by this method. Therefore subsequent calls to for example fillRectangle(QRect &rectangle) will still use the drawing value that was set before this method was called.
rectangle | The filled rectangle to be drawn. | |
pressFeedback | Name of feedback to be played when screen is pressed. Empty string means Inactive value. | |
releaseFeedback | Name of feedback to be played when screen is released. Empty string means Inactive value. |
Stable
void MReactionMap::fillRectangle | ( | const QRectF & | rectangle | ) |
Draws a filled rectangle on the reaction map using the current transformation matrix and drawing value.
rectangle | The filled rectangle to be drawn. |
Stable
int MReactionMap::height | ( | ) | const |
Reaction map height.
Stable
MReactionMap * MReactionMap::instance | ( | QWidget & | anyWidget | ) | [static] |
Returns the reaction map for a (top-level) widget.
If the supplied widget is not a top-level widget, reaction map will be returned for top-level widget that is the ancestor of the supplied widget.
anyWidget | Reference to a top-level widget or a descendant of a top-level widget |
Stable
void MReactionMap::setDrawingValue | ( | const QString & | pressFeedback, | |
const QString & | releaseFeedback | |||
) |
Sets a drawing value that represents the specified press and release feedbacks.
Useful when you want to specify different feedbacks to be played when the screen is pressed and released.
pressFeedback | Name of feedback to be played when screen is pressed. Empty string means Inactive value. | |
releaseFeedback | Name of feedback to be played when screen is released. Empty string means Inactive value. |
Stable
void MReactionMap::setInactiveDrawingValue | ( | ) |
Sets a drawing value that gives no reaction when user touches it.
This is the equivalent of setDrawingValue(MReactionMap::Inactive, MReactionMap::Inactive).
Stable
void MReactionMap::setReactiveDrawingValue | ( | ) |
Sets a drawing value that reacts when user touches or lifts finger from it.
This is the equivalent of setDrawingValue(MReactionMap::Press, MReactionMap::Release).
Stable
void MReactionMap::setTransform | ( | QGraphicsItem * | item, | |
QGraphicsView * | view | |||
) |
Generates a QTransform transformation matrix from QGraphicsItem and QGraphicsView which is used when drawing to the reaction map.
Sets a QTransform transformation matrix that maps local item coordinates in the given view to reaction map coordinates. This transformation matrix is then used when drawing to the reaction map.
item | Graphics item. | |
view | Graphics view. |
Stable
void MReactionMap::setTransform | ( | QTransform | transform | ) |
Sets a QTransform transformation matrix which is used when drawing to the reaction map.
Sets a QTransform transformation matrix that maps given coordinates to reaction map coordinates. This transformation matrix is then used when drawing to the reaction map.
transform | Mapping transformation. |
Stable
void MReactionMap::setTransparentDrawingValue | ( | ) |
Sets a drawing value that is transparent when user touches or lifts finger from it.
This is the equivalent of setDrawingValue(MReactionMap::Transparent, MReactionMap::Transparent).
Stable
QTransform MReactionMap::transform | ( | ) | const |
Returns a QTransform transformation matrix that maps screen coordinates to reaction map coordinates.
Stable
int MReactionMap::width | ( | ) | const |
Reaction map width.
Stable
const QString MReactionMap::Cancel = "" [static] |
Default cancel feedback.
Deprecated
MReactionMapPrivate* MReactionMap::d [protected] |
const QString MReactionMap::Inactive = "" [static] |
Inactive feedback. Used when no feedback is wanted when finger is pressed or released.
const QString MReactionMap::Press = "priority2_static_press" [static] |
Default press feedback. Used when the user presses on an object.
const QString MReactionMap::Release = "priority2_static_release" [static] |
Default release feedback. Used when finger is released on the object.
const QString MReactionMap::Transparent = "transparent" [static] |
Transparent feedback. Used when the topmost window has transparent areas. There might be a window beneath the current window that uses reaction maps. Paint all transparent areas with this value.
Copyright © 2010 Nokia Corporation | MeeGo Touch |