|
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 add tracks dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CMPXADDTRACKSLBXARRAY_H |
|
20 #define C_CMPXADDTRACKSLBXARRAY_H |
|
21 |
|
22 // FORWARD DECLARATIONS |
|
23 class CGulIcon; |
|
24 class CAknIconArray; |
|
25 class CMPXAddTracksListModel; |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * Listbox array for add tracks dialog. |
|
31 * Creates item text descriptors according to the list model. |
|
32 */ |
|
33 NONSHARABLE_CLASS( CMPXAddTracksLbxArray ) : public CBase, |
|
34 public MDesCArray |
|
35 { |
|
36 public: |
|
37 |
|
38 // Listbox icons |
|
39 enum TMPXATLbxIcons |
|
40 { |
|
41 EMPXATLbxIconTrackExpand = 0, |
|
42 EMPXATLbxIconTrackCollapse, |
|
43 EMPXATLbxIconArtistExpand, |
|
44 EMPXATLbxIconArtistCollapse, |
|
45 EMPXATLbxIconEmpty, |
|
46 EMPXATLbxIconSongAddedAnim1, |
|
47 EMPXATLbxIconSongAddedAnim2, |
|
48 EMPXATLbxIconSongAddedAnim3, |
|
49 EMPXATLbxIconSongAddedAnim4, |
|
50 EMPXATLbxIconMMC, |
|
51 EMPXATLbxIconsCount |
|
52 }; |
|
53 |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * @param aModel List model of Add tracks dialog. |
|
59 * @return A pointer to a newly created object |
|
60 */ |
|
61 static CMPXAddTracksLbxArray* NewL( |
|
62 CMPXAddTracksListModel* aModel ); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CMPXAddTracksLbxArray(); |
|
68 |
|
69 public: // New functions |
|
70 |
|
71 /** |
|
72 * Creates new icon array. Ownership is transferred to caller. |
|
73 * @return New icon array. |
|
74 */ |
|
75 CArrayPtr<CGulIcon>* CreateIconArrayL(); |
|
76 |
|
77 public: // Functions from base classes |
|
78 |
|
79 /** |
|
80 * From MDesCArray, returns the number of descriptor elements |
|
81 * in a descriptor |
|
82 * @return The number of descriptor elements in a descriptor array. |
|
83 */ |
|
84 TInt MdcaCount() const; |
|
85 |
|
86 /** |
|
87 * From MDesCArray, indexes into a descriptor array. |
|
88 * @param aIndex The position of the descriptor element within a descriptor array. |
|
89 * @return Descriptor element located at position aIndex within a descriptor array |
|
90 */ |
|
91 TPtrC MdcaPoint( TInt aIndex ) const; |
|
92 |
|
93 private: // Constructors |
|
94 |
|
95 /** |
|
96 * C++ default constructor. |
|
97 * @param aModel List model of Add tracks dialog. |
|
98 */ |
|
99 CMPXAddTracksLbxArray( |
|
100 CMPXAddTracksListModel* aModel ); |
|
101 |
|
102 /** |
|
103 * By default Symbian 2nd phase constructor is private. |
|
104 */ |
|
105 void ConstructL(); |
|
106 |
|
107 private: // New functions |
|
108 |
|
109 /** |
|
110 * Load an icon and append it to an icon array. |
|
111 * @param aArray pointer to the icon array |
|
112 * @param aID skin id of the icon |
|
113 * @param aColorId Item ID of the color table. |
|
114 * @param aColorIndex Index in the color table. |
|
115 * @param aMbmFile path to the mbm/mif file containing the icon |
|
116 * @param aBitmapId mbm id of the bitmap |
|
117 * @param aMaskId mbm id of the mask |
|
118 */ |
|
119 void AppendColorIconToArrayL( |
|
120 CAknIconArray* aArray, |
|
121 const TAknsItemID& aID, |
|
122 const TAknsItemID& aColorId, |
|
123 TInt aColorIndex, |
|
124 const TDesC& aMbmFile, |
|
125 TInt aBitmapId, |
|
126 TInt aMaskId ); |
|
127 |
|
128 private: // Data |
|
129 |
|
130 CMPXAddTracksListModel* iModel; // Not owned |
|
131 HBufC* iItem; |
|
132 }; |
|
133 |
|
134 #endif // C_CMPXADDTRACKSLBXARRAY_H |
|
135 |
|
136 // End of File |