coreapplicationuis/SysAp/Src/sysapremconobserver.cpp
branchRCL_3
changeset 19 924385140d98
parent 18 0818dd463d41
child 20 c2c61fdca848
equal deleted inserted replaced
18:0818dd463d41 19:924385140d98
     1 /*
     1 /*
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007 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();
    50     }
    56     }
    51 
    57 
    52 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
    53 // CSysApRemConObserver::NewL
    59 // CSysApRemConObserver::NewL
    54 // Two-phased constructor.
    60 // Two-phased constructor.
    73 // -----------------------------------------------------------------------------
    79 // -----------------------------------------------------------------------------
    74 //
    80 //
    75 CSysApRemConObserver::~CSysApRemConObserver()
    81 CSysApRemConObserver::~CSysApRemConObserver()
    76     {
    82     {
    77     TRACES( RDebug::Print( _L("CSysApRemConObserver::~CSysApRemConObserver") ) );
    83     TRACES( RDebug::Print( _L("CSysApRemConObserver::~CSysApRemConObserver") ) );
       
    84     delete iInterfaceSelector; // Internally deletes iCoreTarget 
    78     }
    85     }
    79     
    86     
    80 // -----------------------------------------------------------------------------
    87 // -----------------------------------------------------------------------------
    81 // CSysApRemConObserver::MrccatoCommand
    88 // CSysApRemConObserver::MrccatoCommand
    82 // Handles remote key event
    89 // Handles remote key event
   103                 }
   110                 }
   104 	        }
   111 	        }
   105 	    }
   112 	    }
   106 	}
   113 	}
   107 
   114 
   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 
       
   135 //  End of File 
   115 //  End of File