1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/MBMANIM.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,86 @@
1.4 +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Demonstration handwriting class
1.18 +//
1.19 +//
1.20 +
1.21 +#if !defined(__MBMANIM_H__)
1.22 +#define __MBMANIM_H__
1.23 +
1.24 +#if !defined(__E32STD_H__)
1.25 +#include <e32std.h>
1.26 +#endif
1.27 +#if !defined(__E32BASE_H__)
1.28 +#include <e32base.h>
1.29 +#endif
1.30 +#if !defined(__FBS_H__)
1.31 +#include <fbs.h>
1.32 +#endif
1.33 +#if !defined(__W32ADLL_H__)
1.34 +#include <w32adll.h>
1.35 +#endif
1.36 +
1.37 +
1.38 +class CAnimateMbmAnimDll : public CAnimDll
1.39 + {
1.40 +public:
1.41 + CAnim *CreateInstanceL(TInt aType);
1.42 + };
1.43 +
1.44 +class MAnimTimer
1.45 + {
1.46 +public:
1.47 + virtual void Animate()=0;
1.48 + };
1.49 +
1.50 +class CAnimTimer : public CTimer
1.51 + {
1.52 +public:
1.53 + inline CAnimTimer(MAnimTimer* aAnimator) :CTimer(0), iAnimator(aAnimator) {}
1.54 + void ConstructL();
1.55 + //pure virtual functions from CActive
1.56 + void DoCancel();
1.57 + void RunL();
1.58 +private:
1.59 + MAnimTimer* iAnimator;
1.60 + };
1.61 +
1.62 +class CAnimateMbm : public CFreeTimerWindowAnim, MAnimTimer
1.63 + {
1.64 +public:
1.65 + ~CAnimateMbm();
1.66 + //pure virtual functions from MAnimTimer
1.67 + void Animate();
1.68 + //pure virtual functions from MEventHandler
1.69 + TBool OfferRawEvent(const TRawEvent &aRawEvent);
1.70 + //pure virtual functions from CAnim
1.71 + void ConstructL(TAny *aArgs, TBool aHasFocus);
1.72 + void Animate(TDateTime *aDateTime);
1.73 + void Redraw();
1.74 + void Command(TInt aOpcode, TAny *aArgs);
1.75 + TInt CommandReplyL(TInt aOpcode, TAny *aArgs);
1.76 + void FocusChanged(TBool aState);
1.77 +private:
1.78 + inline TInt LoadBitmap() {return LoadBitmap(iIndex);}
1.79 + inline TInt LoadBitmap(TInt aIndex) {return iBitmap->Load(iName,aIndex);}
1.80 +private:
1.81 + CAnimTimer* iTimer;
1.82 + CFbsBitmap* iBitmap;
1.83 + TBuf<32> iName;
1.84 + TInt iIndex;
1.85 + TBool iRunning;
1.86 + TTimeIntervalMicroSeconds32 iInterval;
1.87 + };
1.88 +
1.89 +#endif