|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Transition effect framework |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_ALFTRANSEFFECT_H |
|
22 #define C_ALFTRANSEFFECT_H |
|
23 |
|
24 #include <uiacceltk/HuiEnv.h> |
|
25 #include <uiacceltk/huigifanimationtexture.h> |
|
26 |
|
27 #include "alf/AlfTransEffectPlugin.h" |
|
28 |
|
29 class CAlfCenRep; |
|
30 |
|
31 /** |
|
32 * This class implements an effect framework that can be used to integrate |
|
33 * effects to Alf server. The class will call ECom plugins for actual effect |
|
34 * implementations. |
|
35 * |
|
36 */ |
|
37 NONSHARABLE_CLASS( CAlfSrvTransEffect ) : public CBase |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Destructor |
|
43 */ |
|
44 ~CAlfSrvTransEffect(); |
|
45 |
|
46 /** |
|
47 * Constructor |
|
48 */ |
|
49 static CAlfSrvTransEffect* NewL(); |
|
50 |
|
51 /** |
|
52 * Returns the state of the effect system. |
|
53 * |
|
54 * @return Effect system boolean state. |
|
55 */ |
|
56 TBool CAlfSrvTransEffect::IsEnabled(); |
|
57 |
|
58 /** |
|
59 * Starts a new phase in the effect. |
|
60 * |
|
61 * @param aPhaseId Phase that is started. |
|
62 * @param aContext Effect context. |
|
63 * @param aEffectEnv Effect environment for this session. |
|
64 * @param aUidValue UID which effect is related to (e.g. current application UID). |
|
65 * @param aKey Key which effect is related to (e.g. current application window group). |
|
66 * @param aUidValue2 UID which effect is related to (e.g. previous application UID). |
|
67 * @param aKey2 Key which effect is related to (e.g. previous application window group). |
|
68 * @param aParams Other parameters. |
|
69 * @return System error code. |
|
70 */ |
|
71 TInt StartPhase( TInt aPhaseId, |
|
72 TInt aContext, |
|
73 CAlfSrvEffectEnv& aEffectEnv, |
|
74 TInt aUidValue = 0, |
|
75 TInt aKey = 0, |
|
76 TInt aUidValue2 = 0, |
|
77 TInt aKey2 = 0, |
|
78 const TDesC8* aParams = NULL); |
|
79 |
|
80 /** |
|
81 * Returns an available control group based on its index. Zero as a parameter means "all". |
|
82 * |
|
83 * Not yet implemnted |
|
84 * |
|
85 * @param aContext Effect context that will be aborted. |
|
86 * @param aUidValue UID which effect is related to (e.g. current application UID). |
|
87 * @param aKey Key which effect is related to (e.g. current application window group). |
|
88 * @return System error code. |
|
89 */ |
|
90 TInt Abort( TInt aContext = 0, |
|
91 TInt aUidValue = 0, |
|
92 TInt aKey = 0 ); |
|
93 |
|
94 /** |
|
95 * Not yet implemented |
|
96 */ |
|
97 TInt SetProperty( TInt aProperty, TInt aValue, TInt aUidValue = 0, TInt aKey = 0 ); |
|
98 |
|
99 /** |
|
100 * Not yet implemented |
|
101 */ |
|
102 TInt GetProperty( TInt aProperty, TInt& aValue, TInt aUidValue = 0, TInt aKey = 0 ); |
|
103 |
|
104 /** |
|
105 * Not yet implemented |
|
106 */ |
|
107 TInt AddEventObserver( |
|
108 MAlfTransEffectObserver* aObserver, |
|
109 TInt aEvents, |
|
110 const TDesC8* aParams = NULL ); |
|
111 |
|
112 /** |
|
113 * Not yet implemented |
|
114 */ |
|
115 TInt RemoveEventObserver( MAlfTransEffectObserver* aObserver, TInt aEvents ); |
|
116 |
|
117 /** |
|
118 * Not yet implemented |
|
119 */ |
|
120 TInt GetEventState( TInt aEvent, TInt* aState, TDes8* aParams = NULL ); |
|
121 |
|
122 private: |
|
123 |
|
124 /** |
|
125 * Not yet implemented |
|
126 */ |
|
127 struct TEffectMapItem |
|
128 { |
|
129 TEffectMapItem( TInt aEffectId, MAlfTransEffectPlugin* aPluginPtr) |
|
130 :iEffectId( aEffectId ), iPluginPtr( aPluginPtr ) |
|
131 {}; |
|
132 TInt iEffectId; |
|
133 MAlfTransEffectPlugin* iPluginPtr; |
|
134 }; |
|
135 |
|
136 private: |
|
137 |
|
138 /** |
|
139 * Constructor |
|
140 */ |
|
141 CAlfSrvTransEffect(); |
|
142 |
|
143 /** |
|
144 * Second phase constructor. |
|
145 */ |
|
146 void ConstructL(); |
|
147 |
|
148 /** |
|
149 * Fills the effect plugins and effect map arrays. |
|
150 */ |
|
151 void PopulateEffectArrayL(); |
|
152 |
|
153 /** |
|
154 * Find the correct effect implementations for the context. |
|
155 */ |
|
156 TInt FindPlugin( TInt aContext, MAlfTransEffectPlugin** aPlugIn ); |
|
157 |
|
158 |
|
159 private: // Data |
|
160 |
|
161 // All effect plugins |
|
162 RPointerArray<MAlfTransEffectPlugin> iEffectPlugins; |
|
163 |
|
164 // Map for linking contexts to the effect implementations. |
|
165 RArray<CAlfSrvTransEffect::TEffectMapItem> iEffectMap; |
|
166 |
|
167 // Listener for Avkon effect state |
|
168 CAlfCenRep* iAvkonTfxStateListener; |
|
169 |
|
170 // Whether the effect system is enabled |
|
171 TBool iIsEnabled; |
|
172 |
|
173 // Current context |
|
174 TInt iCurrContext; |
|
175 |
|
176 // Current phase |
|
177 TInt iCurrPhase; |
|
178 }; |
|
179 |
|
180 #endif // C_ALFTRANSEFFECT_H |