diff -r 2b40d63a9c3d -r 90517678cc4f qtmobileextensions/src/keycapture/xqkeycapture.cpp --- a/qtmobileextensions/src/keycapture/xqkeycapture.cpp Fri Apr 16 15:51:22 2010 +0300 +++ b/qtmobileextensions/src/keycapture/xqkeycapture.cpp Mon May 03 13:18:40 2010 +0300 @@ -24,58 +24,198 @@ #include "keycapture_p.h" #include +/*! + Constructor. +*/ XqKeyCapture::XqKeyCapture() : d(new KeyCapturePrivate()) { } +/*! + Destructor. +*/ XqKeyCapture::~XqKeyCapture() { delete d; } -bool XqKeyCapture::captureKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap, - Qt::KeyboardModifiers aModifier) +/*! + Selects a given key for capturing key pressing. Requires a Qt key code. + \param aKey A Qt key. + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. + */ +bool XqKeyCapture::captureKey(Qt::Key aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) +{ + return d->captureKey(aKey, aModifiersMap, aModifier); +} + +/*! + Selects a given key for capturing key pressing. Requires a S60 key code (TKeyCode). + \param aKey A S60 key code (TKeyCode). + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. + */ +bool XqKeyCapture::captureKey(TUint aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) { return d->captureKey(aKey, aModifiersMap, aModifier); } -bool XqKeyCapture::captureLongKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap, - Qt::KeyboardModifiers aModifier, XqKeyCapture::LongFlags aLongType) +/*! + Selects a given key for capturing long pressing. Requires a Qt key code. + \param aKey A Qt key. + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. + */ +bool XqKeyCapture::captureLongKey(Qt::Key aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier, + XqKeyCapture::LongFlags aLongType) { return d->captureLongKey(aKey, aModifiersMap, aModifier, aLongType); } -bool XqKeyCapture::captureKeyUpAndDowns(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap, - Qt::KeyboardModifiers aModifier) +/*! + Selects a given key for capturing long pressing. Requires a S60 key code (TKeyCode). + \param aKey A S60 key code (TKeyCode). + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. + */ +bool XqKeyCapture::captureLongKey(TUint aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier, + XqKeyCapture::LongFlags aLongType) +{ + return d->captureLongKey(aKey, aModifiersMap, aModifier, aLongType); +} + +/*! + Selects a given key for capturing pressing up and down. Requires a Qt key code. + \param aKey A Qt key. + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. + */ +bool XqKeyCapture::captureKeyUpAndDowns(Qt::Key aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) +{ + return d->captureKeyUpAndDowns(aKey, aModifiersMap, aModifier); +} + +/*! + Selects a given key for capturing pressing up and down. Requires a S60 key scan code (TStdScanCode). + \param aKey A S60 key scan code (TStdScanCode). + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false. + */ +bool XqKeyCapture::captureKeyUpAndDowns(TUint aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) { return d->captureKeyUpAndDowns(aKey, aModifiersMap, aModifier); } -bool XqKeyCapture::cancelCaptureKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap, - Qt::KeyboardModifiers aModifier) +/*! + Deselects a given key from key capturing. Requires a Qt key code. + \param aKey A Qt key. + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. + */ +bool XqKeyCapture::cancelCaptureKey(Qt::Key aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) +{ + return d->cancelCaptureKey(aKey, aModifiersMap, aModifier); +} + +/*! + Deselects a given key from key capturing. Requires a S60 key code (TKeyCode). + \param aKey A S60 key code (TKeyCode). + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. + */ +bool XqKeyCapture::cancelCaptureKey(TUint aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) { return d->cancelCaptureKey(aKey, aModifiersMap, aModifier); } -bool XqKeyCapture::cancelCaptureLongKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap, - Qt::KeyboardModifiers aModifier, XqKeyCapture::LongFlags aLongType) +/*! + Deselects a given key from capturing long pressing. Requires a Qt key code. + \param aKey A Qt key. + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. + */ +bool XqKeyCapture::cancelCaptureLongKey(Qt::Key aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier, + XqKeyCapture::LongFlags aLongType) { - return d->cancelCaptureLongKey(aKey, aModifiersMap, aModifier, aLongType); + return d->cancelCaptureLongKey(aKey, aModifiersMap, aModifier, + aLongType); } -bool XqKeyCapture::cancelCaptureKeyUpAndDowns(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap, - Qt::KeyboardModifiers aModifier) +/*! + Deselects a given key from capturing long pressing. Requires a S60 key code (TKeyCode). + \param aKey A S60 key code (TKeyCode). + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. + */ +bool XqKeyCapture::cancelCaptureLongKey(TUint aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier, + XqKeyCapture::LongFlags aLongType) +{ + return d->cancelCaptureLongKey(aKey, aModifiersMap, aModifier, + aLongType); +} + +/*! + Deselects a given key from capturing pressing up and down. Requires a Qt key code. + \param aKey A Qt key. + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. + */ +bool XqKeyCapture::cancelCaptureKeyUpAndDowns(Qt::Key aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) { return d->cancelCaptureKeyUpAndDowns(aKey, aModifiersMap, aModifier); } +/*! + Deselects a given key from capturing pressing up and down. Requires a S60 key scan code (TStdScanCode). + \param aKey A S60 key scan code (TStdScanCode). + \param aModifiersMap + \param aModifier + \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false. + */ +bool XqKeyCapture::cancelCaptureKeyUpAndDowns(TUint aKey, + Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier) +{ + return d->cancelCaptureKeyUpAndDowns(aKey, aModifiersMap, aModifier); +} + +/*! + Returns latest error string. + \retval Latest error string. + */ QString XqKeyCapture::errorString() const { return d->errorString(); } +/*! + Returns latest error id. + \retval Latest error id. + */ int XqKeyCapture::errorId() const { return d->errorId();