|
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Demonstration handwriting class |
|
15 // |
|
16 // |
|
17 |
|
18 #if !defined(__MBMANIM_H__) |
|
19 #define __MBMANIM_H__ |
|
20 |
|
21 #if !defined(__E32STD_H__) |
|
22 #include <e32std.h> |
|
23 #endif |
|
24 #if !defined(__E32BASE_H__) |
|
25 #include <e32base.h> |
|
26 #endif |
|
27 #if !defined(__FBS_H__) |
|
28 #include <fbs.h> |
|
29 #endif |
|
30 #if !defined(__W32ADLL_H__) |
|
31 #include <w32adll.h> |
|
32 #endif |
|
33 |
|
34 |
|
35 class CAnimateMbmAnimDll : public CAnimDll |
|
36 { |
|
37 public: |
|
38 CAnim *CreateInstanceL(TInt aType); |
|
39 }; |
|
40 |
|
41 class MAnimTimer |
|
42 { |
|
43 public: |
|
44 virtual void Animate()=0; |
|
45 }; |
|
46 |
|
47 class CAnimTimer : public CTimer |
|
48 { |
|
49 public: |
|
50 inline CAnimTimer(MAnimTimer* aAnimator) :CTimer(0), iAnimator(aAnimator) {} |
|
51 void ConstructL(); |
|
52 //pure virtual functions from CActive |
|
53 void DoCancel(); |
|
54 void RunL(); |
|
55 private: |
|
56 MAnimTimer* iAnimator; |
|
57 }; |
|
58 |
|
59 class CAnimateMbm : public CFreeTimerWindowAnim, MAnimTimer |
|
60 { |
|
61 public: |
|
62 ~CAnimateMbm(); |
|
63 //pure virtual functions from MAnimTimer |
|
64 void Animate(); |
|
65 //pure virtual functions from MEventHandler |
|
66 TBool OfferRawEvent(const TRawEvent &aRawEvent); |
|
67 //pure virtual functions from CAnim |
|
68 void ConstructL(TAny *aArgs, TBool aHasFocus); |
|
69 void Animate(TDateTime *aDateTime); |
|
70 void Redraw(); |
|
71 void Command(TInt aOpcode, TAny *aArgs); |
|
72 TInt CommandReplyL(TInt aOpcode, TAny *aArgs); |
|
73 void FocusChanged(TBool aState); |
|
74 private: |
|
75 inline TInt LoadBitmap() {return LoadBitmap(iIndex);} |
|
76 inline TInt LoadBitmap(TInt aIndex) {return iBitmap->Load(iName,aIndex);} |
|
77 private: |
|
78 CAnimTimer* iTimer; |
|
79 CFbsBitmap* iBitmap; |
|
80 TBuf<32> iName; |
|
81 TInt iIndex; |
|
82 TBool iRunning; |
|
83 TTimeIntervalMicroSeconds32 iInterval; |
|
84 }; |
|
85 |
|
86 #endif |