1 /* |
|
2 * Copyright (c) 2005 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: Base class for control groups |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAMMSCONTROLGROUP_H |
|
20 #define CAMMSCONTROLGROUP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "mammscontrolgroup.h" |
|
25 #include "ammsconstants.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MAMMSControllable; |
|
29 class CMMAControl; |
|
30 class CMMAPlayer; |
|
31 class CAMMSPlayerStateListener; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * Base class for control groups |
|
36 * |
|
37 * @since 3.0 |
|
38 */ |
|
39 NONSHARABLE_CLASS(CAMMSControlGroup): public CBase, public MAMMSControlGroup |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Destructor. |
|
45 */ |
|
46 virtual ~CAMMSControlGroup(); |
|
47 |
|
48 public: // New functions |
|
49 |
|
50 /** |
|
51 * This function is called when state of a player has changed. |
|
52 * |
|
53 * @param aPlayer Player whose state has changed. |
|
54 * @param aNewState State that the player has now. |
|
55 */ |
|
56 void PlayerStateChangedL(CMMAPlayer* aPlayer, |
|
57 TInt aNewState); |
|
58 |
|
59 protected: // New functions |
|
60 |
|
61 /** |
|
62 * 2nd phase constructor. |
|
63 */ |
|
64 void ConstructL(); |
|
65 |
|
66 /** |
|
67 * Returns the total count of controls in this group. |
|
68 * |
|
69 * @return Count of the controls. |
|
70 */ |
|
71 TInt ControlCount() const; |
|
72 |
|
73 /** |
|
74 * Gets control. Ownership is not tranferred. |
|
75 * |
|
76 * @param aIndex Control index. |
|
77 * |
|
78 * @return the control at given index |
|
79 */ |
|
80 CMMAControl* Control(TInt aIndex) const; |
|
81 |
|
82 /** |
|
83 * Called by PlayerAddedL when new player is added |
|
84 * |
|
85 * @param aPlayer The player being added |
|
86 * @param aControl The player's control relevant to this group |
|
87 */ |
|
88 virtual void NotifyPlayerAddedL(CMMAPlayer* aPlayer, CMMAControl* aControl); |
|
89 |
|
90 /** |
|
91 * Called by PlayerRemoved when new player is removed |
|
92 * |
|
93 * @param aPlayer The player being removed |
|
94 * @param aControl The player's control relevant to this group |
|
95 */ |
|
96 virtual void NotifyPlayerRemoved(CMMAPlayer* aPlayer, CMMAControl* aControl); |
|
97 |
|
98 public: // From MAMMSControlGroup |
|
99 |
|
100 /** |
|
101 * Called by the owning module when a player is added |
|
102 * |
|
103 * @param aPlayer The player being added |
|
104 */ |
|
105 void PlayerAddedL(CMMAPlayer *aPlayer); |
|
106 |
|
107 /** |
|
108 * Called by the owning module when a player is removed |
|
109 * |
|
110 * @param aPlayer The player being removed |
|
111 */ |
|
112 void PlayerRemoved(CMMAPlayer *aPlayer); |
|
113 |
|
114 protected: |
|
115 /** |
|
116 * C++ default constructor. |
|
117 * |
|
118 * @param aName The name of the corresponding amms control |
|
119 * (doesn't take a copy!) |
|
120 * @param aControlType Special AMMS type of the Control |
|
121 */ |
|
122 CAMMSControlGroup( |
|
123 const TDesC& aName, |
|
124 TAMMSControlTypes aControlType = EAMMSBaseControl); |
|
125 |
|
126 protected: // Data |
|
127 |
|
128 // Listeners for player state changes, owned. |
|
129 CArrayPtrSeg< CAMMSPlayerStateListener >* iPlayerStateListeners; |
|
130 |
|
131 // Grouped controls, not owned |
|
132 RArray< CMMAControl* > iControls; |
|
133 |
|
134 // The name of contained controls, not owned |
|
135 const TDesC& iName; |
|
136 |
|
137 // The type of the actual Control |
|
138 TAMMSControlTypes iControlType; |
|
139 |
|
140 // Controllable object. Not owned. (Global manager) |
|
141 MAMMSControllable* iAMMSControllable; |
|
142 |
|
143 }; |
|
144 |
|
145 #endif // CAMMSCONTROLGROUP_H |
|
146 |
|
147 |
|