landmarksui/msgviewer/src/CLmkMsgViewerAppView.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2002 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:    LandmarksUi Content File -    Application view control.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 // INCLUDE FILES
       
    26 #include <coemain.h>
       
    27 #include <aknlists.h>
       
    28 #include <barsread.h>
       
    29 
       
    30 #include <AknsDrawUtils.h>
       
    31 #include <AknsBasicBackgroundControlContext.h>
       
    32 
       
    33 #include "CLmkMsgViewerAppView.h"
       
    34 
       
    35 // ============================ MEMBER FUNCTIONS ===============================
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CLmkMsgViewerAppView::NewL()
       
    39 // Two-phased constructor.
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CLmkMsgViewerAppView* CLmkMsgViewerAppView::NewL( const TRect& aRect )
       
    43     {
       
    44     CLmkMsgViewerAppView* self = CLmkMsgViewerAppView::NewLC( aRect );
       
    45     CleanupStack::Pop( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CLmkMsgViewerAppView::NewLC()
       
    51 // Two-phased constructor.
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 CLmkMsgViewerAppView* CLmkMsgViewerAppView::NewLC( const TRect& aRect )
       
    55     {
       
    56     CLmkMsgViewerAppView* self = new ( ELeave ) CLmkMsgViewerAppView;
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL( aRect );
       
    59     return self;
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // CLmkMsgViewerAppView::ConstructL()
       
    64 // Symbian 2nd phase constructor can leave.
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 void CLmkMsgViewerAppView::ConstructL( const TRect& aRect )
       
    68     {
       
    69     // Create a window for this application view
       
    70     CreateWindowL();
       
    71 
       
    72     // Set the windows size
       
    73     SetRect( aRect );
       
    74 
       
    75     // Get the skin instance
       
    76     iSkinInstance = AknsUtils::SkinInstance();
       
    77 
       
    78     // Create background control context for skinning the background
       
    79     iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL(
       
    80                     KAknsIIDQsnBgAreaMain, aRect, ETrue );
       
    81 
       
    82     // Activate the window, which makes it ready to be drawn
       
    83     ActivateL();
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CLmkMsgViewerAppView::CLmkMsgViewerAppView()
       
    88 // C++ default constructor can NOT contain any code, that might leave.
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CLmkMsgViewerAppView::CLmkMsgViewerAppView()
       
    92     {
       
    93     // No implementation required
       
    94     }
       
    95 
       
    96 
       
    97 // -----------------------------------------------------------------------------
       
    98 // CLmkMsgViewerAppView::~CLmkMsgViewerAppView()
       
    99 // Destructor.
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 CLmkMsgViewerAppView::~CLmkMsgViewerAppView()
       
   103     {
       
   104     delete iBackgroundSkinContext;
       
   105     CloseWindow();
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // CLmkMsgViewerAppView::CountComponentControls()
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 TInt CLmkMsgViewerAppView::CountComponentControls() const
       
   113     {
       
   114     return 0;
       
   115     }
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // CLmkMsgViewerAppView::ComponentControl()
       
   119 // -----------------------------------------------------------------------------
       
   120 //
       
   121 CCoeControl* CLmkMsgViewerAppView::ComponentControl(TInt /*aIndex*/) const
       
   122     {
       
   123     return NULL;
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // CLmkMsgViewerAppView::Draw()
       
   128 // Draws the display.
       
   129 // -----------------------------------------------------------------------------
       
   130 //
       
   131 void CLmkMsgViewerAppView::Draw( const TRect& /*aRect*/ ) const
       
   132     {
       
   133     // Get the standard graphics context
       
   134     CWindowGc& gc = SystemGc();
       
   135 
       
   136     AknsDrawUtils::Background(
       
   137         iSkinInstance, iBackgroundSkinContext, this, gc, Rect());
       
   138     }
       
   139 
       
   140 // End of File