|
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: Listbox array for podcast collection view. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CMPXPODCASTCOLLECTIONVIEWLISTBOXARRAY_H |
|
20 #define C_CMPXPODCASTCOLLECTIONVIEWLISTBOXARRAY_H |
|
21 |
|
22 #include "mpxcommonlistboxarraybase.h" |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class TAknsItemID; |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Listbox array for collection view container. |
|
31 * Creates item text descriptors according to the list model. |
|
32 */ |
|
33 NONSHARABLE_CLASS( CMPXPodcastCollectionViewListBoxArray ): public CMPXCommonListBoxArrayBase |
|
34 { |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * |
|
40 * @since 3.0 |
|
41 * @return Pointer to newly created object. |
|
42 */ |
|
43 static CMPXPodcastCollectionViewListBoxArray* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CMPXPodcastCollectionViewListBoxArray(); |
|
49 |
|
50 /** |
|
51 * Sets playback status with item id |
|
52 * |
|
53 * @since 3.1 |
|
54 * @param aId item id of the song |
|
55 * @param aStatus status of the song |
|
56 * @return The index of episode |
|
57 */ |
|
58 TInt SetPlaybackStatusByIdL( TMPXItemId aId, TMPXPlaybackState aStatus ); |
|
59 |
|
60 /** |
|
61 * Gets the index for the song that's currently playing |
|
62 * |
|
63 * @return The index for the song that's currently playing |
|
64 */ |
|
65 TInt GetPlaybackIndex() const; |
|
66 |
|
67 /** |
|
68 * Get array of indicator icon indices at the specified index |
|
69 */ |
|
70 RArray<TInt> IndicatorIconIndicesL( TInt aIndex ); |
|
71 |
|
72 public: // Functions from base classes |
|
73 |
|
74 /** |
|
75 * From MDesCArray, indexes into a descriptor array. |
|
76 * @param aIndex The position of the descriptor element within a descriptor array. |
|
77 * @return Descriptor element located at position aIndex within a descriptor array |
|
78 */ |
|
79 TPtrC MdcaPoint( TInt aIndex ) const; |
|
80 |
|
81 /** |
|
82 * Creates icon array |
|
83 * |
|
84 */ |
|
85 CAknIconArray* CreateIconArrayL(); |
|
86 |
|
87 /** |
|
88 * Appends media array to the current array |
|
89 * |
|
90 * @param aMedia media array to append |
|
91 */ |
|
92 void AppendMediaL( const CMPXMedia& aMedia ); |
|
93 |
|
94 public: // new functions |
|
95 |
|
96 /** |
|
97 * Checks if the item is a broken link, ETrue if broken |
|
98 * |
|
99 * @param aIndex index of the item |
|
100 */ |
|
101 TBool IsItemBrokenLinkL( TInt aIndex ); |
|
102 |
|
103 /** |
|
104 * Checks if the item is corrupted, ETrue if corrupted |
|
105 * |
|
106 * @param aIndex index of the item |
|
107 */ |
|
108 TBool IsItemCorruptedL( TInt aIndex ); |
|
109 |
|
110 private: // constructors |
|
111 |
|
112 /** |
|
113 * C++ default constructor. |
|
114 */ |
|
115 CMPXPodcastCollectionViewListBoxArray(); |
|
116 |
|
117 /** |
|
118 * By default Symbian 2nd phase constructor is private. |
|
119 */ |
|
120 void ConstructL(); |
|
121 |
|
122 /** |
|
123 * Handle MdcaPoint |
|
124 * @param aIndex The position of the descriptor element within a descriptor array. |
|
125 * @return Descriptor element located at position aIndex within a descriptor array |
|
126 */ |
|
127 TPtrC DoMdcaPointL( TInt aIndex ) const; |
|
128 |
|
129 private: // new functions |
|
130 |
|
131 /** |
|
132 * Load an icon and append it to an icon array. |
|
133 * @param aArray pointer to the icon array |
|
134 * @param aID skin id of the icon |
|
135 * @param aColorId Item ID of the color table. |
|
136 * @param aColorIndex Index in the color table. |
|
137 * @param aMbmFile path to the mbm/mif file containing the icon |
|
138 * @param aBitmapId mbm id of the bitmap |
|
139 * @param aMaskId mbm id of the mask |
|
140 */ |
|
141 void AppendColorIconToArrayL( |
|
142 CAknIconArray* aArray, |
|
143 const TAknsItemID& aID, |
|
144 const TAknsItemID& aColorId, |
|
145 TInt aColorIndex, |
|
146 const TDesC& aMbmFile, |
|
147 TInt aBitmapId, |
|
148 TInt aMaskId ); |
|
149 |
|
150 /** |
|
151 * Maps list box index to array index in reorder mode |
|
152 * |
|
153 * @aIndex listbox index |
|
154 */ |
|
155 TInt MapListBoxIndexToArrayIndex( TInt aIndex ) const; |
|
156 |
|
157 /** |
|
158 * Sets playback status |
|
159 * |
|
160 * @param aIndex index of the song to set |
|
161 * @param aStatus status of the song |
|
162 * @return The index of episode |
|
163 */ |
|
164 TInt SetPlaybackStatusByIndex( TInt aIndex, TMPXPlaybackState aStatus ); |
|
165 |
|
166 private: // data |
|
167 TBool iReorder; |
|
168 TInt iOriginalIndex; |
|
169 TInt iMovedIndex; |
|
170 TInt iMMCDrive; |
|
171 }; |
|
172 |
|
173 #endif // C_CMPXPODCASTCOLLECTIONVIEWLISTBOXARRAY_H |
|
174 |
|
175 // End of File |