phonebookui/Phonebook2/ccapplication/ccapp/ccapputil/src/ccappviewpluginakncontainer.cpp
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CCoeControl tailored for the needs of CCApp plugins.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "ccapputilheaders.h"
       
    21 
       
    22 // ================= MEMBER FUNCTIONS =======================
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 // CCCAppViewPluginAknContainer::CCCAppViewPluginAknContainer
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C CCCAppViewPluginAknContainer::CCCAppViewPluginAknContainer()
       
    29     {
       
    30     CCA_DP(KCCAppUtilLogFile, CCA_L("CCCAppViewPluginAknContainer::CCCAppViewPluginAknContainer()"));    
       
    31     }
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // CCCAppViewPluginAknContainer::~CCCAppViewPluginAknContainer
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 EXPORT_C CCCAppViewPluginAknContainer::~CCCAppViewPluginAknContainer()
       
    38     {
       
    39     CCA_DP(KCCAppUtilLogFile, CCA_L("CCCAppViewPluginAknContainer::~CCCAppViewPluginAknContainer()"));    
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CCCAppViewPluginAknContainer::BaseConstructL
       
    44 // ---------------------------------------------------------------------------
       
    45 void CCCAppViewPluginAknContainer::BaseConstructL( 
       
    46     const TRect& aRect,
       
    47     CCoeAppUi& aAppUi )
       
    48     {
       
    49     CCA_DP(KCCAppUtilLogFile, CCA_L("->CCCAppViewPluginAknContainer::BaseConstructL()"));    
       
    50     iAppUi = &aAppUi;
       
    51     
       
    52     CreateWindowL();
       
    53     CCA_DP(KCCAppUtilLogFile, CCA_L("::BaseConstructL() - CreateWindowL called"));    
       
    54     ConstructL();
       
    55     CCA_DP(KCCAppUtilLogFile, CCA_L("::BaseConstructL() - sub-class ConstructL called"));    
       
    56     
       
    57     SetRect( aRect );
       
    58     ActivateL();
       
    59     CCA_DP(KCCAppUtilLogFile, CCA_L("->CCCAppViewPluginAknContainer::BaseConstructL()"));    
       
    60     }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // CCCAppViewPluginAknContainer::OfferKeyEventL
       
    64 // ---------------------------------------------------------------------------
       
    65 EXPORT_C TKeyResponse CCCAppViewPluginAknContainer::OfferKeyEventL(
       
    66     const TKeyEvent& aKeyEvent,
       
    67     TEventCode aType )
       
    68     {
       
    69     CCA_DP(KCCAppUtilLogFile, CCA_L("->CCCAppViewPluginAknContainer::OfferKeyEventL()"));    
       
    70     TKeyResponse returnValue = EKeyWasNotConsumed;
       
    71 
       
    72     // Let AppUi check the key-event for the reserved keys
       
    73     if ( EEventKey == aType )
       
    74         returnValue = static_cast<CCCAAppAppUi*>( iAppUi )
       
    75             ->HandleKeyEventL( aKeyEvent, aType );
       
    76 
       
    77     CCA_DP(KCCAppUtilLogFile, CCA_L("::OfferKeyEventL() - returnValue : %d"), (TInt)returnValue );    
       
    78     CCA_DP(KCCAppUtilLogFile, CCA_L("<-CCCAppViewPluginAknContainer::OfferKeyEventL()"));    
       
    79     return returnValue;
       
    80     }
       
    81 
       
    82 // ---------------------------------------------------------------------------
       
    83 // CCCAppViewPluginAknContainer::HandleResourceChange
       
    84 // ---------------------------------------------------------------------------
       
    85 EXPORT_C void CCCAppViewPluginAknContainer::HandleResourceChange( TInt aType )
       
    86     {
       
    87     CCA_DP(KCCAppUtilLogFile, CCA_L("->CCCAppViewPluginAknContainer::HandleResourceChange()"));    
       
    88     CCoeControl::HandleResourceChange( aType );
       
    89     if ( aType == KAknsMessageSkinChange ||
       
    90          aType == KEikDynamicLayoutVariantSwitch )
       
    91         {
       
    92         TRect mainPaneRect;
       
    93         AknLayoutUtils::LayoutMetricsRect( 
       
    94             AknLayoutUtils::EMainPane,
       
    95             mainPaneRect);
       
    96         SetRect( mainPaneRect );
       
    97         }
       
    98     CCA_DP(KCCAppUtilLogFile, CCA_L("<-CCCAppViewPluginAknContainer::HandleResourceChange()"));    
       
    99     }
       
   100 
       
   101 //  End of File