qtmobileextensions/src/keycapture/tsrc/mytestwindowgroup.h
branchRCL_3
changeset 10 cd2778e5acfe
parent 9 5d007b20cfd0
child 11 19a54be74e5e
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  *
       
     5  * This program is free software: you can redistribute it and/or modify
       
     6  * it under the terms of the GNU Lesser General Public License as published by
       
     7  * the Free Software Foundation, version 2.1 of the License.
       
     8  * 
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU Lesser General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU Lesser General Public License
       
    15  * along with this program.  If not, 
       
    16  * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17  *
       
    18  * Description:
       
    19  *
       
    20  */
       
    21  
       
    22 #ifndef MYTESTWINDOWGROUP_H
       
    23 #define MYTESTWINDOWGROUP_H
       
    24 
       
    25 #include <qnamespace.h>
       
    26 #include <QString>
       
    27 #include <QList>
       
    28 #include <qobject>
       
    29 #include <W32STD.H>
       
    30 
       
    31     enum WindowGroupActionType {
       
    32         WGATCaptureKey,
       
    33         WGATCaptureLongKey,
       
    34         WGATCaptureKeyUpAndDowns,
       
    35         WGATCancelCaptureKey,
       
    36         WGATCancelCaptureKeyUpAndDowns,
       
    37         WGATCancelCaptureLongKey
       
    38         };
       
    39 
       
    40 class MyTestWindowGroup : public QObject {
       
    41     Q_OBJECT
       
    42 
       
    43 public:
       
    44     static MyTestWindowGroup* Instance();
       
    45     
       
    46 
       
    47     void setRequestNumber( long int req ) {
       
    48         requestNumber = req;
       
    49         };
       
    50     
       
    51     TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier){
       
    52         QList<unsigned int> arglist;
       
    53         arglist << aKeycode << aModifierMask << aModifier;
       
    54         emit windowGroupAction( WGATCaptureKey, arglist );
       
    55         return requestNumber;
       
    56     };
       
    57     
       
    58     TInt32 CaptureLongKey(TUint aInputKeyCode,TUint aOutputKeyCode,TUint aModifierMask,TUint aModifier ,TInt aPriority,TUint aFlags){
       
    59         QList<unsigned int> arglist;
       
    60         arglist << aInputKeyCode << aOutputKeyCode << aModifierMask << aModifier << aPriority << aFlags;
       
    61         emit windowGroupAction( WGATCaptureLongKey, arglist );
       
    62         return requestNumber;
       
    63     };
       
    64     
       
    65     TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier){
       
    66         QList<unsigned int> arglist;
       
    67         arglist << aScanCode << aModifierMask << aModifier;
       
    68         emit windowGroupAction( WGATCaptureKeyUpAndDowns, arglist );
       
    69         return requestNumber;
       
    70     };
       
    71     
       
    72     void CancelCaptureKey(TInt32 aCaptureKey){
       
    73         QList<long int> arglist;
       
    74         arglist << aCaptureKey ;
       
    75         emit windowGroupActionCancel( WGATCancelCaptureKey, arglist );
       
    76     };
       
    77     
       
    78     void CancelCaptureKeyUpAndDowns(TInt32 aCaptureKey){
       
    79         QList<long int> arglist;
       
    80         arglist << aCaptureKey ;
       
    81         emit windowGroupActionCancel( WGATCancelCaptureKeyUpAndDowns, arglist );
       
    82     };
       
    83     
       
    84     void CancelCaptureLongKey(TInt32 aCaptureKey){
       
    85         QList<long int> arglist;
       
    86         arglist << aCaptureKey ;
       
    87         emit windowGroupActionCancel( WGATCancelCaptureLongKey, arglist );
       
    88     };
       
    89     
       
    90 signals:
       
    91     void windowGroupAction( WindowGroupActionType, QList<unsigned int> );
       
    92     void windowGroupActionCancel( WindowGroupActionType, QList<long int> );
       
    93     
       
    94 protected:
       
    95     MyTestWindowGroup() : requestNumber(0) {};
       
    96     ~MyTestWindowGroup();
       
    97     
       
    98 private:
       
    99     //static MyTestWindowGroup* instance;
       
   100     long int requestNumber;
       
   101 };
       
   102 
       
   103 
       
   104 
       
   105 #endif /* MYTESTWINDOWGROUP_H */