Nokia N97 SDK
Example Applications Guide

animationappview.cpp

00001 /*
00002 * ==============================================================================
00003 *  Name        : animationappview.cpp
00004 *  Part of     : Animation example
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2004 - 2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 // INCLUDE FILES
00017 #include <coemain.h>
00018 #include <eikenv.h>
00019 
00020 #include "AnimationAppView.h"
00021 
00022 // ============================ MEMBER FUNCTIONS ===============================
00023 
00024 // -----------------------------------------------------------------------------
00025 // CAnimationAppView::CAnimationAppView()
00026 // C++ default constructor can NOT contain any code, that might leave.
00027 // -----------------------------------------------------------------------------
00028 //
00029 CAnimationAppView::CAnimationAppView()
00030     {
00031     // No implementation required
00032     }
00033 
00034 // -----------------------------------------------------------------------------
00035 // CAnimationAppView::NewL()
00036 // Two-phased constructor.
00037 // -----------------------------------------------------------------------------
00038 //
00039 CAnimationAppView* CAnimationAppView::NewL( const TRect& aRect )
00040     {
00041     CAnimationAppView* self = CAnimationAppView::NewLC( aRect );
00042     CleanupStack::Pop();
00043     return self;
00044     }
00045 
00046 // -----------------------------------------------------------------------------
00047 // CAnimationAppView::NewLC()
00048 // Two-phased constructor.
00049 // -----------------------------------------------------------------------------
00050 //
00051 CAnimationAppView* CAnimationAppView::NewLC( const TRect& aRect )
00052     {
00053     CAnimationAppView* self = new ( ELeave ) CAnimationAppView();
00054     CleanupStack::PushL( self );
00055     self->ConstructL( aRect );
00056     return self;
00057     }
00058 
00059 // -----------------------------------------------------------------------------
00060 // CAnimationAppView::ConstructL()
00061 // Symbian 2nd phase constructor can leave.
00062 // -----------------------------------------------------------------------------
00063 //
00064 void CAnimationAppView::ConstructL( const TRect& aRect )
00065     {
00066     // Create a window for this application view
00067     CreateWindowL();
00068 
00069     // Set the windows size
00070     SetRect( aRect );
00071 
00072     // Activate the window, which makes it ready to be drawn
00073     ActivateL();
00074     }
00075 
00076 void CAnimationAppView::HandleResolutionChange(TRect aRect)
00077     {
00078     SetRect( aRect );
00079     }
00080 
00081 // -----------------------------------------------------------------------------
00082 // CAnimationAppView::~CAnimationAppView()
00083 // Destructor.
00084 // -----------------------------------------------------------------------------
00085 //
00086 CAnimationAppView::~CAnimationAppView()
00087     {
00088     // No implementation required
00089     }
00090 
00091 // -----------------------------------------------------------------------------
00092 // CAnimationAppView::Draw()
00093 // Draws the display.
00094 // -----------------------------------------------------------------------------
00095 //
00096 void CAnimationAppView::Draw( const TRect& /*aRect*/ ) const
00097     {
00098     // Clear the screen
00099     CWindowGc& gc = SystemGc();
00100     TRect drawRect( Rect() );
00101     gc.Clear( drawRect );
00102     }
00103 
00104 // End of File

© Nokia 2009

Back to top