|
1 /* |
|
2 * Copyright (c) 2005-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: Implementation of winscw player manager stub |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMPXPLAYERMANAGERSTUB_H |
|
20 #define CMPXPLAYERMANAGERSTUB_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <mpxplaybackutility.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 |
|
28 /** |
|
29 * CMPXPlayerManagerStub |
|
30 * |
|
31 * Stub for player manager in Winscw |
|
32 * @since S60 3.1 |
|
33 */ |
|
34 NONSHARABLE_CLASS(CMPXPlayerManagerStub) : public CActive, public MMPXPlayerManager |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * C++ default constructor. |
|
39 */ |
|
40 CMPXPlayerManagerStub(); |
|
41 |
|
42 /** |
|
43 * Symbian OS constructor. |
|
44 */ |
|
45 void ConstructL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CMPXPlayerManagerStub(); |
|
51 |
|
52 public: // New functions |
|
53 |
|
54 /** |
|
55 * Typically, a client will obtain the list of all the (non-duplicated) |
|
56 * player 'types' in the system from GetPlayerTypesL and present localized |
|
57 * type names (e.g. "Local","Home network", if possible, else if |
|
58 * non-standard type,should use PlayerTypeDisplayNameL to get text from |
|
59 * player). |
|
60 * |
|
61 * User should be given opportunity to choose IF there is more than one |
|
62 * type available, or if there is one type but more than one sub players, |
|
63 * the user could be presented with the sub player list. |
|
64 * |
|
65 * @param aTypes the list of player types |
|
66 */ |
|
67 virtual void GetPlayerTypesL(RArray<TMPXPlaybackPlayerType>& aTypes); |
|
68 |
|
69 /** |
|
70 * Returns display name for custom types; standard types should be |
|
71 * recognized by client and localized - calling this method would then not |
|
72 * be required |
|
73 * |
|
74 * @param aType playback type |
|
75 */ |
|
76 virtual HBufC* PlayerTypeDisplayNameL(TMPXPlaybackPlayerType aType); |
|
77 |
|
78 /** |
|
79 * Get the list of UIDs of all players |
|
80 * |
|
81 * @param aPlayers All the players' uids in the system |
|
82 */ |
|
83 virtual void GetPlayerListL(RArray<TUid>& aPlayers); |
|
84 |
|
85 /** |
|
86 * Get the list of UIDs of players with the specific type |
|
87 * |
|
88 * @param aPlayers All the players' uids with the same type |
|
89 * @param aType the type of players |
|
90 */ |
|
91 virtual void GetPlayerListL(RArray<TUid>& aPlayers, |
|
92 TMPXPlaybackPlayerType aType); |
|
93 |
|
94 /** |
|
95 * Get the list of sub player names, Async |
|
96 * |
|
97 * @param aCallback sub players returned in call back interface |
|
98 * @param aPlayer UID of the player |
|
99 */ |
|
100 virtual void SubPlayerNamesL(MMPXPlaybackCallback& aCallback, |
|
101 TUid aPlayer); |
|
102 |
|
103 /** |
|
104 * Client selects all players with the type aType, the specific player used |
|
105 * then being resolved on the basis of the content. |
|
106 * |
|
107 * @param aType the type of player |
|
108 */ |
|
109 virtual void SelectPlayersL(TMPXPlaybackPlayerType aType); |
|
110 |
|
111 /** |
|
112 * Client selects specific player aPlayer and sub player aSubPlayerIndex |
|
113 * from array returned by SubPlayerNamesL |
|
114 * |
|
115 * @param aPlayer the UID of player |
|
116 * @param aSubPlayerIndex the index of the sub player |
|
117 */ |
|
118 virtual void SelectSubPlayerL(TUid aPlayer, TInt aSubPlayerIndex); |
|
119 |
|
120 /** |
|
121 * Client selects a specific player |
|
122 * |
|
123 * @param aPlayer the UID of the player |
|
124 */ |
|
125 virtual void SelectPlayerL(TUid aPlayer); |
|
126 |
|
127 /** |
|
128 * Clears all selection criteria. Essentially the same as |
|
129 * SelectPlayersL(EPbLocal). |
|
130 */ |
|
131 virtual void ClearSelectPlayersL(); |
|
132 |
|
133 /** |
|
134 * Retreives the current selection: KNullUid and KErrNotFound are possible |
|
135 * return values for aPlayer and aSubPlayerIndex respectively if none are |
|
136 * explicitly selected |
|
137 * |
|
138 * @param aType player type |
|
139 * @param aPlayer the UID of player |
|
140 * @param aSubPlayerIndex index of the subplayer |
|
141 */ |
|
142 virtual void GetSelectionL(TMPXPlaybackPlayerType& aType, |
|
143 TUid& aPlayer, |
|
144 TInt& aSubPlayerIndex, |
|
145 HBufC*& aSubPlayerName); |
|
146 |
|
147 /** |
|
148 * The current player, may change with each song, NULL if none found |
|
149 * |
|
150 * @return object of current player |
|
151 */ |
|
152 virtual MMPXPlayer* CurrentPlayer(); |
|
153 |
|
154 /** |
|
155 * From MMPXPlayerManager |
|
156 * Get the name of the current sub player |
|
157 * |
|
158 * @param aSubPlayerIndex the index of the sub player |
|
159 * @return friendly name of the sub player |
|
160 */ |
|
161 virtual HBufC* GetSelectedSubPlayerNameL(TInt aSubPlayerIndex); |
|
162 |
|
163 private: |
|
164 /** |
|
165 * @see CActive::RunL() |
|
166 */ |
|
167 void RunL(); |
|
168 |
|
169 /** |
|
170 * @see CActive::DoCancel() |
|
171 */ |
|
172 void DoCancel(); |
|
173 |
|
174 private: // Data |
|
175 MMPXPlaybackCallback* iCallback; |
|
176 CDesCArrayFlat* iSubPlayersNamesArray; |
|
177 TUid iUid; |
|
178 }; |
|
179 |
|
180 #endif // CMPXPLAYERMANAGERSTUB_H |
|
181 |
|
182 // End of File |