qtmobileextensions/src/keycapture/targetwrapper.h
changeset 14 6fbed849b4f4
child 15 1f895d8a5b2b
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
       
     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 TARGETWRAPPER_H_
       
    23 #define TARGETWRAPPER_H_
       
    24 
       
    25 #include <remconcoreapi.h>
       
    26 #include <remconinterfaceselector.h>
       
    27 #include <remconcoreapitarget.h>
       
    28 #include <remconcoreapitargetobserver.h>    
       
    29 #include <remconcoreapitargetobserver.h>    
       
    30 #include <remconcallhandlingtargetobserver.h>
       
    31 #include <remconcallhandlingtarget.h>
       
    32 
       
    33 #include <QMainWindow>
       
    34 #include <QMap>
       
    35 
       
    36 #include <e32base.h>
       
    37 
       
    38 #include <XqKeyCapture>
       
    39 
       
    40 class QPlainTextEdit;
       
    41 class QAction;
       
    42 class QWidget;
       
    43 class QMenu;
       
    44 
       
    45 #ifdef XQKEYCAPTURE_LIBRARY
       
    46 #define XQKEYCAPTURE_EXPORT Q_DECL_EXPORT
       
    47 #else
       
    48 #define XQKEYCAPTURE_EXPORT Q_DECL_IMPORT
       
    49 #endif
       
    50 
       
    51 
       
    52 class ResponseHandler;
       
    53 class ResponseHandlerEx;
       
    54 
       
    55 class TargetWrapper : public MRemConCoreApiTargetObserver, public MRemConCallHandlingTargetObserver
       
    56 {
       
    57 public:
       
    58     TargetWrapper();
       
    59     
       
    60     ~TargetWrapper();
       
    61     
       
    62     void init();
       
    63 
       
    64 public:
       
    65     // -- MRemConCoreApiTargetObserver overloaded methods --    
       
    66     void MrccatoCommand(TRemConCoreApiOperationId aOperationId, TRemConCoreApiButtonAction aButtonAct);
       
    67     
       
    68     // -- MRemConCallHandlingTargetObserver overloaded methods --    
       
    69     
       
    70      void AnswerCall();
       
    71 
       
    72      void EndCall();
       
    73     
       
    74      void AnswerEndCall();
       
    75     
       
    76      void VoiceDial( const TBool aActivate );
       
    77     
       
    78      void LastNumberRedial();
       
    79     
       
    80      void DialCall( const TDesC8& aTelNumber );
       
    81     
       
    82      void MultipartyCalling( const TDesC8& aData );
       
    83     
       
    84      void GenerateDTMF( const TChar aChar );
       
    85     
       
    86      void SpeedDial( const TInt aIndex );    
       
    87      
       
    88      void setBasicApi(bool);
       
    89 
       
    90      void setCallHandlingApi(bool);
       
    91     
       
    92 protected:    
       
    93      
       
    94     void initMapping();
       
    95 
       
    96     QWidget *getTargetWidget();
       
    97     
       
    98     void sendPressKey(Qt::Key key, Qt::KeyboardModifiers modFlags);
       
    99 
       
   100     void sendReleaseKey(Qt::Key key, Qt::KeyboardModifiers modFlags);
       
   101 
       
   102     Qt::Key mapKey(TRemConCoreApiOperationId aOperationId);
       
   103 
       
   104 private:
       
   105     CRemConInterfaceSelector *selector;
       
   106     
       
   107     bool basicApi;
       
   108     bool callHandlingApi;
       
   109 
       
   110     CRemConCoreApiTarget *target;
       
   111     CRemConCallHandlingTarget *targetEx;
       
   112 
       
   113     ResponseHandler *handler;
       
   114     ResponseHandlerEx *handlerEx;
       
   115     
       
   116     QMap<TRemConCoreApiOperationId, Qt::Key> keyMapping;
       
   117 };
       
   118 
       
   119 #endif /* TARGETWRAPPER_H_ */