|
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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef _TRANSITIONCONTROL_H |
|
17 #define _TRANSITIONCONTROL_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <w32std.h> |
|
21 #include <vwsdef.h> |
|
22 |
|
23 #include "TransitionParticipant.h" |
|
24 #include "GfxTransDataType.h" |
|
25 |
|
26 |
|
27 class CRegisteredControl; |
|
28 class CTransitionControl; |
|
29 class CCoeControl; |
|
30 class CTransitionParticipant; |
|
31 |
|
32 /** |
|
33 stack for controls that has got a begin, but not yet an end. |
|
34 |
|
35 @internalTechnology |
|
36 */ |
|
37 class RActiveStack : public RPointerArray<CTransitionControl> |
|
38 { |
|
39 public: |
|
40 TInt Push(CTransitionControl* aTransControl); |
|
41 TInt PushLC(CTransitionControl* aTransControl); |
|
42 CTransitionControl* Pop(); |
|
43 CTransitionControl* Top(); |
|
44 |
|
45 TInt ClearAbove(TInt aIndex); |
|
46 TInt Find(const CCoeControl* aControl) const; |
|
47 TInt Find(const CRegisteredControl* aRegControl) const; |
|
48 TInt FindView(TVwsViewId const &aView) const; |
|
49 TInt Find(TInt aHandle) const; |
|
50 private: |
|
51 static void CleanupOperation(TAny* aAny); |
|
52 }; |
|
53 |
|
54 /** |
|
55 list of controls currently transitioning/animating. |
|
56 */ |
|
57 class RInTransitionList : public RPointerArray<CTransitionControl> |
|
58 { |
|
59 public: |
|
60 TInt Append(CTransitionControl* aTransControl); |
|
61 void Remove(TInt aIndex); |
|
62 |
|
63 TInt Find(const CRegisteredControl* aRegControl) const; |
|
64 TInt Find(TInt aHandle) const; |
|
65 }; |
|
66 |
|
67 class MTransitionControlObserver |
|
68 { |
|
69 public: |
|
70 virtual void ParticipantUpdated(CTransitionControl* aTransControl, CTransitionParticipant* aParticipant, |
|
71 RWsGraphicMsgBuf* aCommandBuffer, const TRect& aDrawRect, const TRect& aBoundingRect) = 0; |
|
72 }; |
|
73 |
|
74 /** |
|
75 keeps the data defining a specific transition instance. |
|
76 */ |
|
77 NONSHARABLE_CLASS(CTransitionControl) : public CBase |
|
78 { |
|
79 public: |
|
80 friend class RActiveStack; |
|
81 |
|
82 static CTransitionControl* New( CRegisteredControl* aRegControl, MTransitionControlObserver* aObserver, |
|
83 TUint aAction, TPolicy aPolicy, TInt aHandle); |
|
84 ~CTransitionControl(); |
|
85 void Reset(); |
|
86 //getters |
|
87 inline CRegisteredControl* RegControl() const; |
|
88 inline TUint Action() const; |
|
89 inline TInt Handle() const; |
|
90 inline TBool Failed() const; |
|
91 inline TPolicy Policy() const; |
|
92 inline CWsScreenDevice* ScreenDevice(); |
|
93 |
|
94 //capture |
|
95 void CaptureBegin(); |
|
96 void CaptureEnd(); |
|
97 //demarcation |
|
98 void DoSetDemarcation(const CCoeControl* aKey, TRect aDemarcation); |
|
99 void DoSetDemarcation(const CCoeControl* aKey, const CCoeControl* aSrc, TRect aDemarcation); |
|
100 void DoSetBeginDemarcation(const CCoeControl* aKey, TRect aDemarcation); |
|
101 void DoSetEndDemarcation(const CCoeControl* aKey, TRect aDemarcation); |
|
102 // hints |
|
103 void Invalidate(const CCoeControl* aKey); |
|
104 void SetHints(const CCoeControl* aKey, TUid aLayerType); |
|
105 void SetHints(const CCoeControl* aKey, TUint aFlags); |
|
106 TUint GetHints(const CCoeControl* aKey); |
|
107 // |
|
108 void SetTransitionData(TUint aType, const TDesC8& aData); |
|
109 void GetTransitionData(const CTransitionData*& aTransData); |
|
110 TInt GetUpdatedRegion(RRegion& aRegion); |
|
111 |
|
112 //participant callback |
|
113 void ParticipantUpdated(CTransitionParticipant* aParticipant, RWsGraphicMsgBuf* aCommandBuffer, |
|
114 const TRect& aDrawRect, const TRect& aBoundingRect); |
|
115 void SetListenForUpdates(TBool aListen); |
|
116 private: |
|
117 MTransitionControlObserver* iObserver; |
|
118 //private functions |
|
119 CTransitionControl(CRegisteredControl* aRegControl, MTransitionControlObserver* aObserver, TInt aHandle); |
|
120 void Fallback(); |
|
121 TInt FindParticipant(const CCoeControl* aKey); |
|
122 CTransitionParticipant* CreateSubControl(const CCoeControl* aKey, TUint aFlags); |
|
123 //data |
|
124 CTransitionData* iData; |
|
125 CRegisteredControl* iRegControl; //not owning |
|
126 CTransitionParticipant* iBaseControl; |
|
127 RPointerArray<CTransitionParticipant> iSubControls; |
|
128 |
|
129 //transition info |
|
130 TInt iHandle; |
|
131 |
|
132 CWsScreenDevice* iScreenDevice; //not owning |
|
133 friend class RActiveStack; |
|
134 friend class RInTransitionList; |
|
135 //helpers |
|
136 TBool iHasBeginWOPos; |
|
137 TBool iOnCleanupStack; |
|
138 }; |
|
139 |
|
140 //getters/setters. |
|
141 CRegisteredControl* CTransitionControl::RegControl() const |
|
142 { |
|
143 return iRegControl; |
|
144 } |
|
145 TUint CTransitionControl::Action() const |
|
146 { |
|
147 return iData->iAction; |
|
148 } |
|
149 |
|
150 TInt CTransitionControl::Handle() const |
|
151 { |
|
152 return iHandle; |
|
153 } |
|
154 |
|
155 TBool CTransitionControl::Failed() const |
|
156 { |
|
157 return iData->iFailed; |
|
158 } |
|
159 |
|
160 TPolicy CTransitionControl::Policy() const |
|
161 { |
|
162 return iData->iPolicy; |
|
163 } |
|
164 |
|
165 CWsScreenDevice* CTransitionControl::ScreenDevice() |
|
166 { |
|
167 return iScreenDevice; |
|
168 } |
|
169 |
|
170 #endif |
|
171 |