|
1 /* |
|
2 * Copyright (c) 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: CMSMultiselectionPopup class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMSMULTISELECTIONPOPUP_H |
|
20 #define CMSMULTISELECTIONPOPUP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknIconArray.h> // CAknIconArray |
|
24 #include <aknlistquerydialog.h> //CAknListQueryDialog |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * CMSMultiselectionPopup dialog class |
|
30 * @since S60 5.1 |
|
31 */ |
|
32 NONSHARABLE_CLASS( CMSMultiselectionPopup ) : public CAknListQueryDialog |
|
33 { |
|
34 |
|
35 public: // Constructors and destructor |
|
36 |
|
37 /** |
|
38 * Two-phased constructor. |
|
39 * |
|
40 * @since S60 v5.1 |
|
41 * @param aMediaServerArray, array of servers to show |
|
42 * @param aSelectionIndexArray, currently selected servers |
|
43 * @return CMSMultiselectionPopup*, the new CMSMultiselectionPopup object |
|
44 */ |
|
45 static CMSMultiselectionPopup* NewL( |
|
46 TBool aUploadCapabilitySupport, |
|
47 RPointerArray<CCmMediaServerFull>* aMediaServerArray, |
|
48 CListBoxView::CSelectionIndexArray* aSelectionIndexArray ); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * |
|
53 * @since S60 v5.1 |
|
54 * @param aMediaServerArray, array of servers to show |
|
55 * @param aSelectionIndexArray, currently selected servers |
|
56 * @return CMSMultiselectionPopup*, the new CMSMultiselectionPopup object |
|
57 */ |
|
58 static CMSMultiselectionPopup* NewLC( |
|
59 TBool aUploadCapabilitySupport, |
|
60 RPointerArray<CCmMediaServerFull>* aMediaServerArray, |
|
61 CListBoxView::CSelectionIndexArray* aSelectionIndexArray ); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CMSMultiselectionPopup(); |
|
67 |
|
68 /** |
|
69 * Updates the list of servers. |
|
70 * |
|
71 * @since S60 v5.1 |
|
72 * @param aMediaServer, found server |
|
73 */ |
|
74 void UpdateAndDrawPopupL( CCmMediaServerFull* aMediaServer ); |
|
75 |
|
76 /** |
|
77 * Handles pointer event on touchscreen |
|
78 * |
|
79 * @param aPointerEvent, touchscreen key event |
|
80 */ |
|
81 void HandlePointerEventL ( const TPointerEvent& aPointerEvent ); |
|
82 |
|
83 protected: |
|
84 |
|
85 /** |
|
86 * 2nd phase constructor. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 |
|
91 // From base class CAknSelectionListDialog |
|
92 /** |
|
93 * From CAknSelectionListDialog |
|
94 * See base class definition |
|
95 */ |
|
96 void PreLayoutDynInitL(); |
|
97 |
|
98 /** |
|
99 * From CAknSelectionListDialog |
|
100 * See base class definition |
|
101 */ |
|
102 void PostLayoutDynInitL(); |
|
103 |
|
104 /** |
|
105 * From CAknSelectionListDialog |
|
106 * See base class definition |
|
107 */ |
|
108 TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, |
|
109 TEventCode aType ); |
|
110 /** |
|
111 * From CAknSelectionListDialog |
|
112 * See base class definition |
|
113 */ |
|
114 TBool OkToExitL( TInt aButtonId ); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 * C++ default constructor. |
|
120 */ |
|
121 CMSMultiselectionPopup( |
|
122 TBool aUploadCapabilitySupport, |
|
123 RPointerArray<CCmMediaServerFull>* aMediaServerArray, |
|
124 CListBoxView::CSelectionIndexArray* aSelectionIndexArray ); |
|
125 |
|
126 |
|
127 /** |
|
128 * Loads a possibly skinned icon and adds it to icon array |
|
129 * |
|
130 * @since S60 v5.1 |
|
131 * @param CAknIconArray, array of icons |
|
132 * @param MAknsSkinInstance, skin instance |
|
133 * @param TDesC, reference to icon file |
|
134 * @param TAknsItemID, skinned icon id |
|
135 * @param TInt, bitmap id |
|
136 * @param TInt, bitmap mask id |
|
137 */ |
|
138 void AppendIconToArrayL( CAknIconArray* aArray, |
|
139 MAknsSkinInstance* aSkin, |
|
140 const TDesC& aMbmFile, |
|
141 const TAknsItemID& aID, |
|
142 TInt aBitmapId, |
|
143 TInt aMaskId ) const; |
|
144 |
|
145 /** |
|
146 * Sets the list of servers for the listbox. |
|
147 * @since S60 v5.1 |
|
148 */ |
|
149 void AppendMediaServersL(); |
|
150 |
|
151 /** |
|
152 * Creates listbox item string |
|
153 * @since S60 v5.1 |
|
154 * @param aServer, server info |
|
155 * @return HBufC*, listbox item |
|
156 */ |
|
157 HBufC* CreateListBoxItemLC( const CCmMediaServerFull* aServer ); |
|
158 |
|
159 // Enumerations |
|
160 |
|
161 // icons indexes for the listbox |
|
162 enum TIconList |
|
163 { |
|
164 ECheckedBox = 0, |
|
165 EUnCheckedBox, |
|
166 EUploadCapability, |
|
167 EIconLast |
|
168 }; |
|
169 |
|
170 private: // data |
|
171 |
|
172 /** |
|
173 * Dialog control item |
|
174 */ |
|
175 CEikListBox* iListBox; // not owned |
|
176 |
|
177 /** |
|
178 * Indicates if upload capability is needed |
|
179 */ |
|
180 TBool iUploadCapabilitySupport; |
|
181 |
|
182 /** |
|
183 * Media servers |
|
184 */ |
|
185 RPointerArray<CCmMediaServerFull>* iServers; // not owned |
|
186 |
|
187 /** |
|
188 * Previously selected indexes |
|
189 */ |
|
190 CArrayFix<TInt>* iPreviousSelection; // not owned |
|
191 }; |
|
192 |
|
193 #endif // CMSMULTISELECTIONPOPUP_H |
|
194 |
|
195 // End of File |