coreapplicationuis/SysAp/Src/sysapremconobserver.cpp
branchRCL_3
changeset 63 c2c61fdca848
parent 62 924385140d98
child 82 4610cd70c542
equal deleted inserted replaced
62:924385140d98 63:c2c61fdca848
     1 /*
     1 /*
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include <remconcoreapitarget.h>
    20 #include <remconcoreapitarget.h>
    21 #include <remconinterfaceselector.h>
    21 #include <remconinterfaceselector.h>
    22 //#include <aknconsts.h>
    22 #include <aknconsts.h>
    23 #include "sysapremconobserver.h"
    23 #include "sysapremconobserver.h"
    24 #include "SysApAppUi.h"
    24 #include "SysApAppUi.h"
    25 
    25 
    26 // ============================ MEMBER FUNCTIONS ===============================
    26 // ============================ MEMBER FUNCTIONS ===============================
    27 
    27 
    45 // -----------------------------------------------------------------------------
    45 // -----------------------------------------------------------------------------
    46 //
    46 //
    47 void CSysApRemConObserver::ConstructL()
    47 void CSysApRemConObserver::ConstructL()
    48     {
    48     {
    49     TRACES( RDebug::Print( _L("CSysApRemConObserver::ConstructL") ) );  
    49     TRACES( RDebug::Print( _L("CSysApRemConObserver::ConstructL") ) );  
    50     
       
    51     iInterfaceSelector = CRemConInterfaceSelector::NewL();
       
    52     
       
    53     iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
       
    54     
       
    55     iInterfaceSelector->OpenTargetL();
       
    56     }
    50     }
    57 
    51 
    58 // -----------------------------------------------------------------------------
    52 // -----------------------------------------------------------------------------
    59 // CSysApRemConObserver::NewL
    53 // CSysApRemConObserver::NewL
    60 // Two-phased constructor.
    54 // Two-phased constructor.
    79 // -----------------------------------------------------------------------------
    73 // -----------------------------------------------------------------------------
    80 //
    74 //
    81 CSysApRemConObserver::~CSysApRemConObserver()
    75 CSysApRemConObserver::~CSysApRemConObserver()
    82     {
    76     {
    83     TRACES( RDebug::Print( _L("CSysApRemConObserver::~CSysApRemConObserver") ) );
    77     TRACES( RDebug::Print( _L("CSysApRemConObserver::~CSysApRemConObserver") ) );
    84     delete iInterfaceSelector; // Internally deletes iCoreTarget 
       
    85     }
    78     }
    86     
    79     
    87 // -----------------------------------------------------------------------------
    80 // -----------------------------------------------------------------------------
    88 // CSysApRemConObserver::MrccatoCommand
    81 // CSysApRemConObserver::MrccatoCommand
    89 // Handles remote key event
    82 // Handles remote key event
   110                 }
   103                 }
   111 	        }
   104 	        }
   112 	    }
   105 	    }
   113 	}
   106 	}
   114 
   107 
       
   108 /**
       
   109  * Reserve the volume keys
       
   110  */
       
   111 void CSysApRemConObserver::StartRemconInterfaceL()
       
   112     {
       
   113     TRACES( RDebug::Print( _L("CSysApRemConObserver::BlockKeys")));
       
   114     if(!iInterfaceSelector)
       
   115         {
       
   116         iInterfaceSelector = CRemConInterfaceSelector::NewL();
       
   117         iCoreTarget = CRemConCoreApiTarget::NewL( *iInterfaceSelector, *this );
       
   118         iInterfaceSelector->OpenTargetL();
       
   119         }
       
   120     }
       
   121 
       
   122 /**
       
   123  * Release the volume keys for other application like phone app during call
       
   124  */
       
   125 void CSysApRemConObserver::StopRemconInterface()
       
   126     {
       
   127     TRACES( RDebug::Print( _L("CSysApRemConObserver::UnBlockKeys")));
       
   128     if(iInterfaceSelector)
       
   129         {
       
   130         delete iInterfaceSelector;
       
   131         iInterfaceSelector = NULL;
       
   132         }
       
   133     }
       
   134 
   115 //  End of File 
   135 //  End of File