sysresmonitoring/oommonitor/tsrc/oomtest/t_oomdummyapp/src/t_oomdummyappAppView.cpp
branchRCL_3
changeset 1 0fdb7f6b0309
child 19 924385140d98
equal deleted inserted replaced
0:2e3d3ce01487 1:0fdb7f6b0309
       
     1 /*
       
     2 * Copyright (c) 2006 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <coemain.h>
       
    24 #include "t_oomdummyappAppView.h"
       
    25 
       
    26 // ============================ MEMBER FUNCTIONS ===============================
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // Ct_oomdummyappAppView::NewL()
       
    30 // Two-phased constructor.
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 Ct_oomdummyappAppView* Ct_oomdummyappAppView::NewL(const TRect& aRect)
       
    34 	{
       
    35 	Ct_oomdummyappAppView* self = Ct_oomdummyappAppView::NewLC(aRect);
       
    36 	CleanupStack::Pop(self);
       
    37 	return self;
       
    38 	}
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // Ct_oomdummyappAppView::NewLC()
       
    42 // Two-phased constructor.
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 Ct_oomdummyappAppView* Ct_oomdummyappAppView::NewLC(const TRect& aRect)
       
    46 	{
       
    47 	Ct_oomdummyappAppView* self = new (ELeave) Ct_oomdummyappAppView;
       
    48 	CleanupStack::PushL(self);
       
    49 	self->ConstructL(aRect);
       
    50 	return self;
       
    51 	}
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // Ct_oomdummyappAppView::ConstructL()
       
    55 // Symbian 2nd phase constructor can leave.
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 void Ct_oomdummyappAppView::ConstructL(const TRect& aRect)
       
    59 	{
       
    60 	// Create a window for this application view
       
    61 	CreateWindowL();
       
    62 
       
    63 	// Set the windows size
       
    64 	SetRect(aRect);
       
    65 
       
    66 	// Activate the window, which makes it ready to be drawn
       
    67 	ActivateL();
       
    68 	}
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // Ct_oomdummyappAppView::Ct_oomdummyappAppView()
       
    72 // C++ default constructor can NOT contain any code, that might leave.
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 Ct_oomdummyappAppView::Ct_oomdummyappAppView()
       
    76 	{
       
    77 	// No implementation required
       
    78 	}
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // Ct_oomdummyappAppView::~Ct_oomdummyappAppView()
       
    82 // Destructor.
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 Ct_oomdummyappAppView::~Ct_oomdummyappAppView()
       
    86 	{
       
    87 	// No implementation required
       
    88 	}
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // Ct_oomdummyappAppView::Draw()
       
    92 // Draws the display.
       
    93 // -----------------------------------------------------------------------------
       
    94 //
       
    95 void Ct_oomdummyappAppView::Draw(const TRect& /*aRect*/) const
       
    96 	{
       
    97 	// Get the standard graphics context
       
    98 	CWindowGc& gc = SystemGc();
       
    99 
       
   100 	// Gets the control's extent
       
   101 	TRect drawRect(Rect());
       
   102 
       
   103 	// Clears the screen
       
   104 	gc.Clear(drawRect);
       
   105 
       
   106 	}
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // Ct_oomdummyappAppView::SizeChanged()
       
   110 // Called by framework when the view size is changed.
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 void Ct_oomdummyappAppView::SizeChanged()
       
   114 	{
       
   115 	DrawNow();
       
   116 	}
       
   117 // End of File