|
1 /* |
|
2 * Copyright (c) 2007-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: Default effect manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CSHWDEFAULTEFFECTMANAGER_H__ |
|
22 #define __CSHWDEFAULTEFFECTMANAGER_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <e32base.h> |
|
27 |
|
28 #include "shweffectmanager.h" |
|
29 #include "shweffectinfo.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class MShwEffect; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CShwDefaultEffectManager |
|
38 */ |
|
39 NONSHARABLE_CLASS( CShwDefaultEffectManager ) : public CBase, public MShwEffectManager |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Constructor. |
|
45 * @param aVisualList, the list that this view control manages |
|
46 */ |
|
47 static CShwDefaultEffectManager* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 ~CShwDefaultEffectManager(); |
|
53 |
|
54 private: |
|
55 |
|
56 /** |
|
57 * Constructor |
|
58 */ |
|
59 CShwDefaultEffectManager(); |
|
60 |
|
61 public: // from MShwEffectManager |
|
62 |
|
63 /// @ref MShwEffectManager::AddEffectL |
|
64 void AddEffectL( MShwEffect* aEffect ); |
|
65 /// @ref MShwEffectManager::CurrentEffect |
|
66 MShwEffect* CurrentEffect(); |
|
67 /// @ref MShwEffectManager::Effect |
|
68 MShwEffect* Effect( TInt aDirection); |
|
69 /// @ref MShwEffectManager::ProceedToEffect |
|
70 void ProceedToEffect( TInt aDirection ); |
|
71 /// @ref MShwEffectManager::SetEffectOrder |
|
72 void SetEffectOrder(TShwEffectOrder aOrder); |
|
73 /// @ref MShwEffectManager::EffectOrder |
|
74 TShwEffectOrder EffectOrder(); |
|
75 /** @todo: confirm how to programme effects */ |
|
76 /// @ref MShwEffectManager::SetProgrammedEffects |
|
77 void SetProgrammedEffects( RArray< TShwEffectInfo >& aEffects ); |
|
78 /// @ref MShwEffectManager::SetDefaultEffect |
|
79 void SetDefaultEffectL(TShwEffectInfo aInfo); |
|
80 /// @ref MShwEffectManager::GetActiveEffectsL |
|
81 void GetActiveEffectsL( RPointerArray< MShwEffect >& aEffects ); |
|
82 |
|
83 private: // Implementation |
|
84 |
|
85 // Default to "forwards" direction. Use negative value for "backwards" |
|
86 void CalculateEffects( TInt aDirection = 1 ); |
|
87 void ResetAndDestroyEffects(RArray< MShwEffect* >& aArray); |
|
88 TInt CalculateNextEffectIndex( TInt aDirection ); |
|
89 |
|
90 private: // Data |
|
91 |
|
92 /// Own: The effects in use |
|
93 RArray< MShwEffect* > iEffects; |
|
94 /// Own: The entire selection of effects |
|
95 RArray< MShwEffect* > iAvailableEffects; |
|
96 /// Own: current effect number |
|
97 TInt iCurrentEffect; |
|
98 /// Own: next effect number |
|
99 TInt iNextEffect; |
|
100 /// Own: the order that the effects are played in |
|
101 MShwEffectManager::TShwEffectOrder iEffectOrder; |
|
102 |
|
103 }; |
|
104 |
|
105 #endif // __CSHWDEFAULTEFFECTMANAGER_H__ |