|
1 /* |
|
2 * Copyright (c) 2008 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: Effect manager. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CXNEFFECTMANAGER_H |
|
21 #define CXNEFFECTMANAGER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // CLASS DECLARATION |
|
27 class CXnPluginData; |
|
28 class CXnViewData; |
|
29 class CXnNode; |
|
30 |
|
31 /** |
|
32 * Struct which holds needed info of effect. |
|
33 */ |
|
34 NONSHARABLE_STRUCT( TXnEffect ) |
|
35 { |
|
36 CXnNode* iNode; |
|
37 TInt iState; |
|
38 TInt iType; |
|
39 TInt iId; |
|
40 }; |
|
41 |
|
42 /** |
|
43 * Effect manager. |
|
44 * Handles starting and ending effects. |
|
45 * |
|
46 * @since S60 v5.0 |
|
47 */ |
|
48 NONSHARABLE_CLASS( CXnEffectManager ) : public CBase |
|
49 { |
|
50 public: |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * @return new instance of CXnEffectManager. |
|
54 */ |
|
55 static CXnEffectManager* NewL(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CXnEffectManager(); |
|
61 |
|
62 /** |
|
63 * Begin handling of control effect. |
|
64 * @param aId effect id |
|
65 * @aPlugin Plugin data |
|
66 */ |
|
67 void BeginControlEffectL( TInt aId, CXnPluginData& aPlugin ); |
|
68 |
|
69 /** |
|
70 * Begin handling of control effect. |
|
71 * @param aId effect id |
|
72 * @aPlugins Array of plugin datas |
|
73 */ |
|
74 void BeginControlEffectL( TInt aId, RPointerArray<CXnPluginData>& aPlugins ); |
|
75 |
|
76 /** |
|
77 * Begin handling of fullscreen effect. |
|
78 * @param aId effect id |
|
79 * @aView view data |
|
80 */ |
|
81 void BeginFullscreenEffectL( TInt aId, CXnViewData& aView ); |
|
82 |
|
83 /** |
|
84 * When UiRendered is called effect is ended and will be drawn |
|
85 */ |
|
86 void UiRendered(); |
|
87 |
|
88 /** |
|
89 * When UiLayouted is called effect is started if it was not started earlier. |
|
90 */ |
|
91 void UiLayouted(); |
|
92 |
|
93 private: |
|
94 /** |
|
95 * Starts fullscreen effect. |
|
96 * @param aEffect effect data |
|
97 */ |
|
98 void DoBeginFullscreenEffect( TXnEffect& aEffect ); |
|
99 |
|
100 /** |
|
101 * Starts control effect. |
|
102 * @param aEffect effect data |
|
103 */ |
|
104 void DoBeginControlEffect( TXnEffect& aEffect ); |
|
105 |
|
106 /** |
|
107 * Removes and destroys effect from effect list. |
|
108 * @param aEffect effect data |
|
109 */ |
|
110 void RemoveEffect( TXnEffect* aEffect ); |
|
111 |
|
112 /** |
|
113 * Return number of ongoing effects of given type. |
|
114 * @param aType effect type, fullscreen or control |
|
115 * |
|
116 * @return Number of ongoing effects of given type |
|
117 */ |
|
118 TInt EffectCount( TInt aType ); |
|
119 |
|
120 /** |
|
121 * C++ default constructor. |
|
122 */ |
|
123 CXnEffectManager(); |
|
124 |
|
125 /** |
|
126 * By default Symbian 2nd phase constructor is private. |
|
127 */ |
|
128 void ConstructL(); |
|
129 |
|
130 private: // data |
|
131 /** |
|
132 * List of started effects. |
|
133 */ |
|
134 RPointerArray<TXnEffect> iEffects; |
|
135 }; |
|
136 |
|
137 #endif // CXNEFFECTMANAGER_H |
|
138 |
|
139 // End of File |