examples/sfexamples/vibrapool/inc/moveball.h

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:  Class to animate the pool ball on the pool table.
00015 // 
00016 // 
00017 
00018 
00019 #ifndef __MOVEBALL_H__
00020 #define __MOVEBALL_H__
00021 
00022 #include <e32base.h>
00023 #include <coecntrl.h>
00024 
00025 // Observer class to update the screen container
00026 class MUpdateContainer
00027         {
00028         public:
00029                 virtual void UpdateScreen() = 0;
00030         };
00031         
00032 // Asynchronous class based on a timer to facilitate the animation of the ball.
00033 class CMoveBall : public CTimer
00034         {
00035         // Constructors
00036         public:
00037                 static CMoveBall* NewL(MUpdateContainer&);
00038                 CMoveBall(MUpdateContainer&);
00039                 ~CMoveBall();
00040         private:        
00041                 void ConstructL();
00042         
00043         // Animation controlers.
00044         public:
00045                 void StartMovingBall();
00046                 void StopMoveBall();
00047         
00048         // Pure virtual functions from CTImer
00049         private:
00050                 void RunL();
00051                 void DoCancel();
00052         
00053         // Member variables
00054         private:
00055                 TPoint iLoc;                                    // Ball location on screen
00056                 MUpdateContainer& iUpdater;             // Screen call back controller
00057         };
00058         
00059 #endif
00060         

Generated by  doxygen 1.6.2