qtmobileextensions/src/keycapture/xqkeycapture.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 5 453da2cfceef
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    22 #include "xqkeycapture.h"
    22 #include "xqkeycapture.h"
    23 
    23 
    24 #include "keycapture_p.h"
    24 #include "keycapture_p.h"
    25 #include <qnamespace.h>
    25 #include <qnamespace.h>
    26 
    26 
       
    27 /*!
       
    28  Constructor.
       
    29 */
    27 XqKeyCapture::XqKeyCapture() :
    30 XqKeyCapture::XqKeyCapture() :
    28     d(new KeyCapturePrivate())
    31     d(new KeyCapturePrivate())
    29 {
    32 {
    30 
    33 
    31 }
    34 }
    32 
    35 
       
    36 /*!
       
    37  Destructor.
       
    38 */
    33 XqKeyCapture::~XqKeyCapture()
    39 XqKeyCapture::~XqKeyCapture()
    34 {
    40 {
    35     delete d;
    41     delete d;
    36 }
    42 }
    37 
    43 
    38 bool XqKeyCapture::captureKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap,
    44 /*!
    39 	Qt::KeyboardModifiers aModifier)
    45  Selects a given key for capturing key pressing. Requires a Qt key code.
       
    46  \param aKey A Qt key.
       
    47  \param aModifiersMap
       
    48  \param aModifier 
       
    49  \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false.
       
    50  */
       
    51 bool XqKeyCapture::captureKey(Qt::Key aKey,
       
    52     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
    40 {
    53 {
    41     return d->captureKey(aKey, aModifiersMap, aModifier);
    54     return d->captureKey(aKey, aModifiersMap, aModifier);
    42 }
    55 }
    43 
    56 
    44 bool XqKeyCapture::captureLongKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap,
    57 /*!
    45 	Qt::KeyboardModifiers aModifier, XqKeyCapture::LongFlags aLongType)
    58  Selects a given key for capturing key pressing. Requires a S60 key code (TKeyCode).
       
    59  \param aKey A S60 key code (TKeyCode).
       
    60  \param aModifiersMap
       
    61  \param aModifier 
       
    62  \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false.
       
    63  */
       
    64 bool XqKeyCapture::captureKey(TUint aKey,
       
    65     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
       
    66 {
       
    67     return d->captureKey(aKey, aModifiersMap, aModifier);
       
    68 }
       
    69 
       
    70 /*!
       
    71  Selects a given key for capturing long pressing. Requires a Qt key code.
       
    72  \param aKey A Qt key.
       
    73  \param aModifiersMap
       
    74  \param aModifier 
       
    75  \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false.
       
    76  */
       
    77 bool XqKeyCapture::captureLongKey(Qt::Key aKey,
       
    78     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier,
       
    79     XqKeyCapture::LongFlags aLongType)
    46 {
    80 {
    47     return d->captureLongKey(aKey, aModifiersMap, aModifier, aLongType);
    81     return d->captureLongKey(aKey, aModifiersMap, aModifier, aLongType);
    48 }
    82 }
    49 
    83 
    50 bool XqKeyCapture::captureKeyUpAndDowns(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap,
    84 /*!
    51 	Qt::KeyboardModifiers aModifier)
    85  Selects a given key for capturing long pressing. Requires a S60 key code (TKeyCode).
       
    86  \param aKey A S60 key code (TKeyCode).
       
    87  \param aModifiersMap
       
    88  \param aModifier 
       
    89  \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false.
       
    90  */
       
    91 bool XqKeyCapture::captureLongKey(TUint aKey,
       
    92     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier,
       
    93     XqKeyCapture::LongFlags aLongType)
       
    94 {
       
    95     return d->captureLongKey(aKey, aModifiersMap, aModifier, aLongType);
       
    96 }
       
    97 
       
    98 /*!
       
    99  Selects a given key for capturing pressing up and down. Requires a Qt key code.
       
   100  \param aKey A Qt key.
       
   101  \param aModifiersMap
       
   102  \param aModifier 
       
   103  \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false.
       
   104  */
       
   105 bool XqKeyCapture::captureKeyUpAndDowns(Qt::Key aKey,
       
   106     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
    52 {
   107 {
    53     return d->captureKeyUpAndDowns(aKey, aModifiersMap, aModifier);
   108     return d->captureKeyUpAndDowns(aKey, aModifiersMap, aModifier);
    54 }
   109 }
    55 
   110 
    56 bool XqKeyCapture::cancelCaptureKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap,
   111 /*!
    57 	Qt::KeyboardModifiers aModifier)
   112  Selects a given key for capturing pressing up and down. Requires a S60 key scan code (TStdScanCode).
       
   113  \param aKey A S60 key scan code (TStdScanCode).
       
   114  \param aModifiersMap
       
   115  \param aModifier 
       
   116  \retval Returns true if aKey was succesfully added to the capturing system, otherwise returns false.
       
   117  */
       
   118 bool XqKeyCapture::captureKeyUpAndDowns(TUint aKey,
       
   119     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
       
   120 {
       
   121     return d->captureKeyUpAndDowns(aKey, aModifiersMap, aModifier);
       
   122 }
       
   123 
       
   124 /*!
       
   125  Deselects a given key from key capturing. Requires a Qt key code.
       
   126  \param aKey A Qt key.
       
   127  \param aModifiersMap
       
   128  \param aModifier 
       
   129  \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false.
       
   130  */
       
   131 bool XqKeyCapture::cancelCaptureKey(Qt::Key aKey,
       
   132     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
    58 {
   133 {
    59     return d->cancelCaptureKey(aKey, aModifiersMap, aModifier);
   134     return d->cancelCaptureKey(aKey, aModifiersMap, aModifier);
    60 }
   135 }
    61 
   136 
    62 bool XqKeyCapture::cancelCaptureLongKey(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap,
   137 /*!
    63 	Qt::KeyboardModifiers aModifier, XqKeyCapture::LongFlags aLongType)
   138  Deselects a given key from key capturing. Requires a S60 key code (TKeyCode).
    64 {
   139  \param aKey A S60 key code (TKeyCode).
    65     return d->cancelCaptureLongKey(aKey, aModifiersMap, aModifier, aLongType);
   140  \param aModifiersMap
    66 }
   141  \param aModifier 
    67 
   142  \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false.
    68 bool XqKeyCapture::cancelCaptureKeyUpAndDowns(Qt::Key aKey, Qt::KeyboardModifiers aModifiersMap,
   143  */
    69 	Qt::KeyboardModifiers aModifier)
   144 bool XqKeyCapture::cancelCaptureKey(TUint aKey,
       
   145     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
       
   146 {
       
   147     return d->cancelCaptureKey(aKey, aModifiersMap, aModifier);
       
   148 }
       
   149 
       
   150 /*!
       
   151  Deselects a given key from capturing long pressing. Requires a Qt key code.
       
   152  \param aKey A Qt key.
       
   153  \param aModifiersMap
       
   154  \param aModifier 
       
   155  \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false.
       
   156  */
       
   157 bool XqKeyCapture::cancelCaptureLongKey(Qt::Key aKey,
       
   158     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier,
       
   159     XqKeyCapture::LongFlags aLongType)
       
   160 {
       
   161     return d->cancelCaptureLongKey(aKey, aModifiersMap, aModifier,
       
   162         aLongType);
       
   163 }
       
   164 
       
   165 /*!
       
   166  Deselects a given key from capturing long pressing. Requires a S60 key code (TKeyCode).
       
   167  \param aKey A S60 key code (TKeyCode).
       
   168  \param aModifiersMap
       
   169  \param aModifier 
       
   170  \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false.
       
   171  */
       
   172 bool XqKeyCapture::cancelCaptureLongKey(TUint aKey,
       
   173     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier,
       
   174     XqKeyCapture::LongFlags aLongType)
       
   175 {
       
   176     return d->cancelCaptureLongKey(aKey, aModifiersMap, aModifier,
       
   177         aLongType);
       
   178 }
       
   179 
       
   180 /*!
       
   181  Deselects a given key from capturing pressing up and down. Requires a Qt key code.
       
   182  \param aKey A Qt key.
       
   183  \param aModifiersMap
       
   184  \param aModifier 
       
   185  \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false.
       
   186  */
       
   187 bool XqKeyCapture::cancelCaptureKeyUpAndDowns(Qt::Key aKey,
       
   188     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
    70 {
   189 {
    71     return d->cancelCaptureKeyUpAndDowns(aKey, aModifiersMap, aModifier);
   190     return d->cancelCaptureKeyUpAndDowns(aKey, aModifiersMap, aModifier);
    72 }
   191 }
    73 
   192 
       
   193 /*!
       
   194  Deselects a given key from capturing pressing up and down. Requires a S60 key scan code (TStdScanCode).
       
   195  \param aKey A S60 key scan code (TStdScanCode).
       
   196  \param aModifiersMap
       
   197  \param aModifier 
       
   198  \retval Returns true if aKey was succesfully removed from the capturing system, otherwise returns false.
       
   199  */
       
   200 bool XqKeyCapture::cancelCaptureKeyUpAndDowns(TUint aKey,
       
   201     Qt::KeyboardModifiers aModifiersMap, Qt::KeyboardModifiers aModifier)
       
   202 {
       
   203     return d->cancelCaptureKeyUpAndDowns(aKey, aModifiersMap, aModifier);
       
   204 }
       
   205 
       
   206 /*!
       
   207  Returns latest error string.
       
   208  \retval Latest error string.
       
   209  */
    74 QString XqKeyCapture::errorString() const
   210 QString XqKeyCapture::errorString() const
    75 {
   211 {
    76     return d->errorString();
   212     return d->errorString();
    77 }
   213 }
    78 
   214 
       
   215 /*!
       
   216  Returns latest error id.
       
   217  \retval Latest error id.
       
   218  */
    79 int XqKeyCapture::errorId() const
   219 int XqKeyCapture::errorId() const
    80 {
   220 {
    81     return d->errorId();
   221     return d->errorId();
    82 }
   222 }