Version: 6.3.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

SUIT_Accel Class Reference

Manager of keyboard accelerator bindings.

#include <SUIT_Accel.h>

Inheritance diagram for SUIT_Accel:
Inheritance graph

Public Types

enum  Actions {
  PanLeft = 1, PanRight, PanUp, PanDown,
  ZoomIn, ZoomOut, ZoomFit, RotateLeft,
  RotateRight, RotateUp, RotateDown, LastAction
}

Public Member Functions

void setActionKey (const int action, const int key, const QString &type)
void unsetActionKey (const int key, const QString &type)

Static Public Member Functions

static SUIT_AccelgetAccel ()

Protected Member Functions

bool eventFilter (QObject *, QEvent *)

Private Types

typedef QMap< int, int > IdActionMap
 maps key to action id
typedef QMap< QString,
IdActionMap
ViewerTypeIdActionMap
 maps viewer type to IdActionMap

Private Member Functions

 SUIT_Accel ()
int getAccelKey (QEvent *)

Private Attributes

ViewerTypeIdActionMap myMap
 viewer actions map
QMap< int, bool > myOptMap
 Maps key to <not_used> flag map, used for optimization.

Static Private Attributes

static SUIT_Accelmyself = 0

Member Typedef Documentation

typedef QMap<int, int> SUIT_Accel.IdActionMap [private]
typedef QMap<QString, IdActionMap> SUIT_Accel.ViewerTypeIdActionMap [private]

Member Enumeration Documentation

Enumerator:
PanLeft 
PanRight 
PanUp 
PanDown 
ZoomIn 
ZoomOut 
ZoomFit 
RotateLeft 
RotateRight 
RotateUp 
RotateDown 
LastAction 

Constructor & Destructor Documentation

SUIT_Accel::SUIT_Accel ( ) [private]

Constructor [private].


Member Function Documentation

SUIT_Accel * SUIT_Accel::getAccel ( ) [static]

getAccel() : public interface for SUIT_Accel object. Only one instance is created and returned.

References myself, and SUIT_Accel().

void SUIT_Accel::setActionKey ( const int  action,
const int  key,
const QString &  type 
)

setActionKey() : assign a ceratain action for a key accelerator

References myMap, and myOptMap.

void SUIT_Accel::unsetActionKey ( const int  key,
const QString &  type 
)

unsetActionKey() : unregister a certain key accelerator

References myMap.

bool SUIT_Accel::eventFilter ( QObject obj,
QEvent event 
) [protected]
int SUIT_Accel::getAccelKey ( QEvent event) [private]

Returns key pressed if

  1. event was KeyPress
  2. pressed key is a registered accelerator

References getKey(), and myOptMap.


Field Documentation

QMap<int, bool> SUIT_Accel.myOptMap [private]

All registered keys (accelerators) are stored in this map.

SUIT_Accel * SUIT_Accel::myself = 0 [static, private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS