Update contrib.
1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // CWsSprite and associated classes definitions
26 class CWsSpriteMember : public CBase
31 TBool SetL(const TCmdSpriteMember &aCmdSpriteMember);
34 CFbsBitmap *iMaskBitmap;
36 CGraphicsContext::TDrawMode iDrawMode;
38 TTimeIntervalMicroSeconds32 iInterval;
44 class CWsSpriteBase : public CWsScreenObject
47 enum {ENoChildPriorityBoost=1,EPointerPriorityBoost=2};
49 friend class CWsSpriteTimer;
51 friend class TCursorSprite;
53 static void InitStaticsL();
54 static void DeleteStatics();
56 CWsSpriteBase(CWsClient *aOwner, WH_HANDLES aType);
62 void SetPos(const TPoint &Pos);
66 inline TBool IsActive();
67 inline TBool IsFlashingEnabled();
68 TBool CanBeSeen() const;
70 CWsSpriteBase * Next() { return iNext; }
71 void SetNext(CWsSpriteBase * aNext) { iNext = aNext; }
72 void Redraw(CFbsBitGc * aGc, const TRegion& aRegion);
74 inline const CWsWindow* Win();
75 TBool IsActivated() const;
76 TBool HasSpriteMember() const { return iMembers->Count(); }
78 void ConstructL(TUint aFlags, CWsWindow *aWindow);
79 void CommandL(TInt aOpcode, const TAny *aCmdData);
80 void AppendMemberL(const TCmdSpriteMember &aCmdSpriteMember);
81 virtual void CompleteL();
82 void SetMember(TInt aIndex);
84 TBool UpdateMemberL(CWsSpriteMember *aMember, const TCmdSpriteMember &aCmdSpriteMember);
85 void QueueDeltaTimer();
88 CWsWindowGroup *iGroupWin;
90 TPoint iPos; // Combined position and offset
95 CArrayPtrFlat<CWsSpriteMember> *iMembers;
97 TWsDeltaTimerEntry iDeltaTimerEntry;
98 TDisplayMode iDisplayMode;
102 CWsSpriteBase * iNext; // linked list per window
107 static CWsDeltaTimer *iDeltaTimer;
112 These can be combined with each other and TSpriteFlags using a bit-wise OR operation.
116 @see RWsPointerCursor::Construct()
117 @see RWsSprite::Construct() */
118 enum TSystemSpriteFlags
120 ESpriteNonSystemFlags=0x0000FFFF,
121 ESpriteSystemFlags= 0xFFFF0000,
122 ESpritePointer=0x10000,
124 ESpriteDisabled=0x40000,
125 ESpriteActive=0x80000,
126 ESpriteDirty=0x100000
130 // CWsSpriteBase inlines
132 inline TBool CWsSpriteBase::IsActive()
134 return iNext != NULL;
136 inline TBool CWsSpriteBase::IsFlashingEnabled()
138 return (iFlags&ESpriteFlash);
140 inline const CWsWindow* CWsSpriteBase::Win()
148 class CWsSprite : public CWsSpriteBase
151 CWsSprite(CWsClient *aOwner);
153 void ConstructL(const TWsClCmdCreateSprite &aParams);
154 void CommandL(TInt aOpcode, const TAny *aCmdData);
156 void Update(TInt aMember,TRect aRect,TBool aFullUpdate);
158 CWsAnim *iAnim; // The AnimDLL on this sprite if there is one.
164 class CWsSpriteManager : public CBase
168 static CWsSpriteManager* NewL();
169 void DrawFloatingSprites(CFbsBitGc* aGc,const TRegion& aRegion);
170 void AddFloatingSprite(CWsSpriteBase* aSprite);
171 void RemoveFloatingSprite(CWsSpriteBase* aSprite);
172 void Schedule(CWsSpriteBase* aSprite, TRect* aRect = 0);
173 TFlashState CurrentSpriteFlashState(const CWsSpriteBase* aSprite) const;
174 TFlashState CurrentCursorFlashState() const;
175 TInt SpriteCount() const { return iFloatingSprites.Count(); }
176 TTimeIntervalMicroSeconds NextCursorFlashStateChange() const;
177 void CalcFloatingSpriteRgn( TRegion& aResultRgn, const TRect& aDefaultRect );
181 TTimeIntervalMicroSeconds NextSpriteFlashStateChange(const CWsSpriteBase* aSprite) const;
182 TTimeIntervalMicroSeconds CalculateTimeToNextFlash(TTimeIntervalMicroSeconds aTime) const;
184 RPointerArray<CWsSpriteBase> iFloatingSprites;