Nokia N97 SDK
Example Applications Guide

OomExampleAppView.cpp

00001 /*
00002  * ============================================================================
00003  *  Name        : OomExampleAppView.cpp
00004  *  Part of     : OomMonitor Example Application
00005  *  Description : ?Description
00006  *  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
00007  *
00008  *  Copyright © 2009 Nokia.  All rights reserved.
00009  *  This material, including documentation and any related computer
00010  *  programs, is protected by copyright controlled by Nokia.  All
00011  *  rights are reserved.  Copying, including reproducing, storing,
00012  *  adapting or translating, any or all of this material requires the
00013  *  prior written consent of Nokia.  This material also contains
00014  *  confidential information which may not be disclosed to others
00015  *  without the prior written consent of Nokia.
00016  * ============================================================================
00017  * Template version: 4.2
00018  */
00019 
00020 #include <coemain.h>
00021 #include "OomExampleAppView.h"
00022 
00023 COomExampleAppView* COomExampleAppView::NewL( const TRect& aRect )
00024     {
00025     COomExampleAppView* self = COomExampleAppView::NewLC( aRect );
00026     CleanupStack::Pop( self );
00027     return self;
00028     }
00029 
00030 COomExampleAppView* COomExampleAppView::NewLC(const TRect& aRect)
00031     {
00032     COomExampleAppView* self = new (ELeave) COomExampleAppView;
00033     CleanupStack::PushL(self);
00034     self->ConstructL(aRect);
00035     return self;
00036     }
00037 
00038 void COomExampleAppView::ConstructL(const TRect& aRect)
00039     {
00040     // Create a window for this application view
00041     CreateWindowL();
00042 
00043     // Set the windows size
00044     SetRect(aRect);
00045 
00046     // Activate the window, which makes it ready to be drawn
00047     ActivateL();
00048     }
00049 
00050 COomExampleAppView::COomExampleAppView()
00051     {
00052     // No implementation required
00053     }
00054 
00055 COomExampleAppView::~COomExampleAppView()
00056     {
00057     // No implementation required
00058     }
00059 
00060 void COomExampleAppView::Draw(const TRect& /*aRect*/) const
00061     {
00062     // Get the standard graphics context
00063     CWindowGc& gc = SystemGc();
00064 
00065     // Gets the control's extent
00066     TRect drawRect(Rect());
00067 
00068     // Clears the screen
00069     gc.Clear(drawRect);
00070 
00071     }
00072 
00073 void COomExampleAppView::SizeChanged()
00074     {
00075     DrawNow();
00076     }
00077 
00078 void COomExampleAppView::HandlePointerEventL(
00079         const TPointerEvent& aPointerEvent)
00080     {
00081 
00082     // Call base class HandlePointerEventL()
00083     CCoeControl::HandlePointerEventL(aPointerEvent);
00084     }

© Nokia 2009

Back to top