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: CMSMultiselectionDialog class implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MSMULTISELECTIONDIALOG_H |
|
20 #define MSMULTISELECTIONDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <AknDialog.h> |
|
24 #include <aknselectionlist.h> |
|
25 #include <aknsfld.h> |
|
26 #include <aknnavide.h> |
|
27 #include <AknIconArray.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CAknColumnListBox; |
|
31 class CAknSearchField; |
|
32 class CSelectionItemList; |
|
33 class CAknTitlePane; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * CMSMultiselectionDialog dialog class |
|
39 * |
|
40 * @since S60 5.1 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CMSMultiselectionDialog ) : |
|
43 public CAknSelectionListDialog |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * |
|
50 * @since S60 5.1 |
|
51 * @param aItemArray, list of items |
|
52 * @param aTitle, dialog title |
|
53 */ |
|
54 static CMSMultiselectionDialog* NewL( |
|
55 CSelectionItemList* aItemArray, |
|
56 const TDesC& aTitle ); |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. |
|
60 * |
|
61 * @since S60 5.1 |
|
62 * @param aItemArray, list of items |
|
63 * @param aTitle, dialog title |
|
64 */ |
|
65 static CMSMultiselectionDialog* NewLC( |
|
66 CSelectionItemList* aItemArray, |
|
67 const TDesC& aTitle ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CMSMultiselectionDialog(); |
|
73 |
|
74 |
|
75 protected: // New functions |
|
76 |
|
77 void ConstructL( const TDesC& aTitle ); |
|
78 |
|
79 /** |
|
80 * Loads a possibly skinned icon and adds it to icon array |
|
81 * |
|
82 * @since S60 5.1 |
|
83 * @param aArray, array of icons |
|
84 * @param aSkin, skin instance |
|
85 * @param aMbmFile, reference to icon file |
|
86 * @param aID, skinned icon id |
|
87 * @param aBitmapId, bitmap id |
|
88 * @param aMaskId, bitmap mask id |
|
89 */ |
|
90 void AppendIconToArrayL( CAknIconArray* aArray, |
|
91 MAknsSkinInstance* aSkin, |
|
92 const TDesC& aMbmFile, |
|
93 const TAknsItemID& aID, |
|
94 TInt aBitmapId, |
|
95 TInt aMaskId) const; |
|
96 |
|
97 |
|
98 /** |
|
99 * Appends first item ("share all files") to the listbox |
|
100 * |
|
101 * @since S60 5.1 |
|
102 * @param CDesCArray, listbox array |
|
103 * @return None |
|
104 */ |
|
105 void AppendShareAllSelectionL(CDesCArray* aListBoxArray) const; |
|
106 |
|
107 |
|
108 protected: |
|
109 |
|
110 // From base class CAknSelectionListDialog |
|
111 |
|
112 /** |
|
113 * From CAknSelectionListDialog |
|
114 * See base class definition |
|
115 */ |
|
116 void PreLayoutDynInitL(); |
|
117 |
|
118 /** |
|
119 * From CAknSelectionListDialog |
|
120 * See base class definition |
|
121 */ |
|
122 TBool OkToExitL( TInt aButtonId ); |
|
123 |
|
124 |
|
125 private: |
|
126 /** |
|
127 * Performs the first phase of two phase construction. |
|
128 * |
|
129 * @since S60 5.1 |
|
130 * @param aItemArray, list item array |
|
131 * @return None |
|
132 */ |
|
133 CMSMultiselectionDialog( CSelectionItemList* aItemArray ); |
|
134 |
|
135 /** |
|
136 * Generates text array for listbox |
|
137 * |
|
138 * @since S60 5.1 |
|
139 * @param None |
|
140 * @return None |
|
141 */ |
|
142 void GenerateInternalArrayL(); |
|
143 |
|
144 /** |
|
145 * Sets checkbox statas |
|
146 * |
|
147 * @since S60 5.1 |
|
148 * @param None |
|
149 * @return None |
|
150 */ |
|
151 void SetAllSelectionsL(); |
|
152 |
|
153 /** |
|
154 * Deselects other items if first one is selected |
|
155 * |
|
156 * @since S60 5.1 |
|
157 * @param None |
|
158 * @return None |
|
159 */ |
|
160 void HandleSelectionsL(); |
|
161 |
|
162 /** |
|
163 * Updates item array selections |
|
164 * |
|
165 * @since S60 5.1 |
|
166 * @param None |
|
167 * @return None |
|
168 */ |
|
169 void UpdateAllSelectionsL(); |
|
170 |
|
171 /** |
|
172 * handle for the pointer device input |
|
173 * |
|
174 * @since S60 5.1 |
|
175 * @param aPointerEvent, pointerevent |
|
176 * @return None |
|
177 */ |
|
178 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
179 |
|
180 |
|
181 /** |
|
182 * Handeles selection key press |
|
183 * |
|
184 * @since S60 5.1 |
|
185 * @param None |
|
186 * @return None |
|
187 */ |
|
188 void HandleSelectionKeyPressL(); |
|
189 |
|
190 private: |
|
191 |
|
192 /** |
|
193 * dialog control |
|
194 */ |
|
195 CAknColumnListBox* iListBox; // owned |
|
196 |
|
197 /** |
|
198 * title pane |
|
199 */ |
|
200 CAknTitlePane* iTitlePane; // not owned |
|
201 |
|
202 /** |
|
203 * previous view title |
|
204 */ |
|
205 HBufC* iPreviousTitle; // owned |
|
206 |
|
207 /** |
|
208 * selected item - needed for creation of CAknSelectionListDialog |
|
209 */ |
|
210 TInt iSelectedItem; |
|
211 |
|
212 /** |
|
213 * array for listbox items |
|
214 */ |
|
215 CSelectionItemList* iItemArray; // not owned |
|
216 |
|
217 /** |
|
218 * internal array for listbox item texts |
|
219 */ |
|
220 CDesCArrayFlat* iInternalItemArray; // owned |
|
221 |
|
222 /** |
|
223 * First item selection status |
|
224 */ |
|
225 TBool iFirstItemSelected; |
|
226 /** |
|
227 * iNaviPane |
|
228 */ |
|
229 CAknNavigationControlContainer* iNaviPane; // not owned |
|
230 |
|
231 /** |
|
232 * navi decorator |
|
233 */ |
|
234 CAknNavigationDecorator* iNaviDecorator; // owned |
|
235 }; |
|
236 |
|
237 #endif // MSMULTISELECTIONDIALOG_H |
|
238 |
|
239 // End of File |
|