pkiutilities/CertSaver/src/CertSaverContainer.cpp
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003-2007 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:   Implementation of CCertSaverContainer class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <AknDef.h>
       
    21 #include <AknsDrawUtils.h>
       
    22 #include <AknUtils.h>
       
    23 #include "CertSaverContainer.h"
       
    24 
       
    25 
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 //
       
    29 // ----------------------------------------------------------
       
    30 // CCertSaverContainer::ConstructL()
       
    31 // EPOC second phase constructor.
       
    32 // ----------------------------------------------------------
       
    33 //
       
    34 void CCertSaverContainer::ConstructL( const TRect& aRect )
       
    35     {
       
    36     iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain,
       
    37                    Rect(), EFalse );
       
    38 
       
    39     CreateWindowL();
       
    40     SetRect(aRect);
       
    41     ActivateL();
       
    42     }
       
    43 
       
    44 // ----------------------------------------------------
       
    45 // CCertSaverContainer::~CCertSaverAppUi()
       
    46 // Destructor
       
    47 // Frees reserved resources
       
    48 // ----------------------------------------------------
       
    49 //
       
    50 CCertSaverContainer::~CCertSaverContainer()
       
    51     {
       
    52     delete iBgContext;
       
    53     }
       
    54 
       
    55 
       
    56 // ----------------------------------------------------
       
    57 // CCertSaverContainer::CountComponentControls()
       
    58 // Return count of control components.
       
    59 // ----------------------------------------------------
       
    60 //
       
    61 TInt CCertSaverContainer::CountComponentControls() const
       
    62     {
       
    63     return 0;
       
    64     }
       
    65 
       
    66 
       
    67 // ----------------------------------------------------
       
    68 // CCertSaverContainer::ComponentControl()
       
    69 // Return control pointer.
       
    70 // ----------------------------------------------------
       
    71 //
       
    72 CCoeControl* CCertSaverContainer::ComponentControl( TInt /*aIndex*/ ) const
       
    73     {
       
    74     return NULL;
       
    75     }
       
    76 
       
    77 // ----------------------------------------------------
       
    78 // CCertSaverContainer::Draw()
       
    79 // Clear whole screen.
       
    80 // ----------------------------------------------------
       
    81 //
       
    82 void CCertSaverContainer::Draw( const TRect& aRect ) const
       
    83     {
       
    84     CWindowGc& gc = SystemGc();
       
    85 
       
    86     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
    87     MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
       
    88 
       
    89     AknsDrawUtils::Background( skin, cc, this, gc, aRect );
       
    90     }
       
    91 
       
    92 
       
    93 // ----------------------------------------------------
       
    94 // CCertSaverContainer::HandleResourceChange()
       
    95 // Notifier for changing language
       
    96 // ----------------------------------------------------
       
    97 //
       
    98 void CCertSaverContainer::HandleResourceChange( TInt aType )
       
    99     {
       
   100     CCoeControl::HandleResourceChange( aType );
       
   101 
       
   102     if ( aType == KEikDynamicLayoutVariantSwitch )
       
   103         {
       
   104         TRect mainPaneRect;
       
   105         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
       
   106         SetRect( mainPaneRect );
       
   107         DrawNow();
       
   108         }
       
   109     }
       
   110 
       
   111 // ----------------------------------------------------
       
   112 // CCertSaverContainer::SizeChanged()
       
   113 // Control size is set
       
   114 // ----------------------------------------------------
       
   115 //
       
   116 void CCertSaverContainer::SizeChanged()
       
   117     {
       
   118     iBgContext->SetRect( Rect() );
       
   119     }
       
   120 
       
   121 // ----------------------------------------------------
       
   122 // CCertSaverContainer::MopSupplyObject()
       
   123 // Pass skin information if need.
       
   124 // ----------------------------------------------------
       
   125 //
       
   126 TTypeUid::Ptr CCertSaverContainer::MopSupplyObject( TTypeUid aId )
       
   127     {
       
   128     if( aId.iUid == MAknsControlContext::ETypeId )
       
   129       {
       
   130       return MAknsControlContext::SupplyMopObject( aId, iBgContext );
       
   131       }
       
   132     return CCoeControl::MopSupplyObject( aId );
       
   133     }
       
   134 
       
   135 // End of File