securitydialogs/simlockui/src/SimLockUIBackgroundControl.cpp
branchRCL_3
changeset 20 63339781d179
parent 5 3b17fc5c9564
equal deleted inserted replaced
19:94b923fa11ed 20:63339781d179
    39 static const TInt KSkinLayoutOption = 2;
    39 static const TInt KSkinLayoutOption = 2;
    40 
    40 
    41 // ---------------------------------------------------------------------------
    41 // ---------------------------------------------------------------------------
    42 // CSimLockUIBackgroundControl::NewL
    42 // CSimLockUIBackgroundControl::NewL
    43 // ---------------------------------------------------------------------------
    43 // ---------------------------------------------------------------------------
    44 CSimLockUIBackgroundControl* CSimLockUIBackgroundControl::NewL( const TRect& aRect )
    44 CSimLockUIBackgroundControl* CSimLockUIBackgroundControl::NewL()
    45     {
    45     {
    46     CSimLockUIBackgroundControl* self = CSimLockUIBackgroundControl::NewLC( aRect );
    46     CSimLockUIBackgroundControl* self = CSimLockUIBackgroundControl::NewLC();
    47     CleanupStack::Pop( self );
    47     CleanupStack::Pop( self );
    48     return self;
    48     return self;
    49     }
    49     }
    50 
    50 
    51 // ---------------------------------------------------------------------------
    51 // ---------------------------------------------------------------------------
    52 // CSimLockUIBackgroundControl::NewLC
    52 // CSimLockUIBackgroundControl::NewLC
    53 // ---------------------------------------------------------------------------
    53 // ---------------------------------------------------------------------------
    54 CSimLockUIBackgroundControl* CSimLockUIBackgroundControl::NewLC( const TRect& aRect )
    54 CSimLockUIBackgroundControl* CSimLockUIBackgroundControl::NewLC()
    55     {
    55     {
    56     CSimLockUIBackgroundControl* self = new ( ELeave ) CSimLockUIBackgroundControl;
    56     CSimLockUIBackgroundControl* self = new ( ELeave ) CSimLockUIBackgroundControl;
    57     CleanupStack::PushL( self );
    57     CleanupStack::PushL( self );
    58     self->ConstructL( aRect );
    58     self->ConstructL();
    59     return self;
    59     return self;
    60     }
    60     }
    61 
    61 
    62 // ---------------------------------------------------------------------------
    62 // ---------------------------------------------------------------------------
    63 // CSimLockUIBackgroundControl::~CSimLockUIBackgroundControl
    63 // CSimLockUIBackgroundControl::~CSimLockUIBackgroundControl
    81     }
    81     }
    82 
    82 
    83 // ---------------------------------------------------------------------------
    83 // ---------------------------------------------------------------------------
    84 // CSimLockUIBackgroundControl::ConstructL
    84 // CSimLockUIBackgroundControl::ConstructL
    85 // ---------------------------------------------------------------------------
    85 // ---------------------------------------------------------------------------
    86 void CSimLockUIBackgroundControl::ConstructL( const TRect& aRect )
    86 void CSimLockUIBackgroundControl::ConstructL()
    87     {
    87     {
    88     // Create a window for this application view
    88     // Create a window for this application view
    89     CreateWindowL();
    89     CreateWindowL();
       
    90     SetExtentToWholeScreen();
    90 
    91 
    91     iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL(
    92     iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL(
    92             KAknsIIDQsnBgAreaMain, aRect, EFalse );
    93             KAknsIIDQsnBgAreaMain, Rect(), EFalse );
    93 
       
    94     // Set the windows size
       
    95     SetRect( aRect );
       
    96 
    94 
    97     // Activate the window, which makes it ready to be drawn
    95     // Activate the window, which makes it ready to be drawn
    98     ActivateL();
    96     ActivateL();
    99     }
    97     }
   100 
    98 
   102 // CSimLockUIBackgroundControl::SizeChanged
   100 // CSimLockUIBackgroundControl::SizeChanged
   103 // ---------------------------------------------------------------------------
   101 // ---------------------------------------------------------------------------
   104 void CSimLockUIBackgroundControl::SizeChanged()
   102 void CSimLockUIBackgroundControl::SizeChanged()
   105     {
   103     {
   106     // Background skin.
   104     // Background skin.
   107     iBackgroundSkinContext->SetRect( Rect() );
   105     if ( iBackgroundSkinContext )
       
   106         iBackgroundSkinContext->SetRect( Rect() );
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------------------------
       
   110 // CSimLockUIBackgroundControl::HandleResourceChange()
       
   111 // ---------------------------------------------------------------------------
       
   112 //
       
   113 void CSimLockUIBackgroundControl::HandleResourceChange( TInt aType )
       
   114     {
       
   115     CCoeControl::HandleResourceChange( aType );
       
   116 
       
   117     if ( aType == KEikDynamicLayoutVariantSwitch )
       
   118         {
       
   119         SetExtentToWholeScreen();
       
   120         }
   108     }
   121     }
   109 
   122 
   110 
   123 
   111 // ---------------------------------------------------------------------------
   124 // ---------------------------------------------------------------------------
   112 // CSimLockUIBackgroundControl::Draw
   125 // CSimLockUIBackgroundControl::Draw