author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:57:31 +0300 | |
branch | RCL_3 |
changeset 22 | f5c50b8af68c |
parent 21 | 65326cf895ed |
permissions | -rw-r--r-- |
21 | 1 |
/* |
2 |
* Copyright (c) 2006-2007 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: Base class for all file manager containers |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include <aknlists.h> |
|
22 |
#include <eikclbd.h> |
|
23 |
#include <StringLoader.h> |
|
24 |
#include <FileManagerUID.h> |
|
25 |
#include "CFileManagerContainerBase.h" |
|
26 |
#include "FileManager.hrh" |
|
27 |
||
28 |
||
29 |
// ============================ MEMBER FUNCTIONS =============================== |
|
30 |
||
31 |
// ----------------------------------------------------------------------------- |
|
32 |
// CFileManagerContainerBase::CFileManagerContainerBase |
|
33 |
// C++ default constructor can NOT contain any code, that |
|
34 |
// might leave. |
|
35 |
// ----------------------------------------------------------------------------- |
|
36 |
// |
|
37 |
CFileManagerContainerBase::CFileManagerContainerBase() |
|
38 |
{ |
|
39 |
} |
|
40 |
||
41 |
// ----------------------------------------------------------------------------- |
|
42 |
// CFileManagerContainerBase::ConstructL |
|
43 |
// |
|
44 |
// ----------------------------------------------------------------------------- |
|
45 |
// |
|
46 |
void CFileManagerContainerBase::ConstructL( |
|
47 |
const TRect& aRect, |
|
48 |
const TInt aFocusedIndex ) |
|
49 |
{ |
|
50 |
CreateWindowL(); |
|
51 |
iListBox = CreateListBoxL(); |
|
52 |
if ( !iListBox ) |
|
53 |
{ |
|
54 |
User::Leave( KErrGeneral ); |
|
55 |
} |
|
56 |
SetListEmptyL(); |
|
57 |
iListBox->CreateScrollBarFrameL( ETrue ); |
|
58 |
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( |
|
59 |
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); |
|
60 |
iListBox->SetObserver( this ); |
|
61 |
iListBox->SetListBoxObserver( this ); |
|
22
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
62 |
iListBox->SetMarkingModeObserver( this ); |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
63 |
|
21 | 64 |
SetIndex( aFocusedIndex ); |
65 |
iListBox->SetFocus( ETrue ); |
|
66 |
iListBox->AddSelectionObserverL( this ); |
|
67 |
SetRect( aRect ); |
|
68 |
ActivateL(); |
|
69 |
} |
|
70 |
||
71 |
// ----------------------------------------------------------------------------- |
|
72 |
// CFileManagerContainerBase::~CFileManagerContainerBase |
|
73 |
// |
|
74 |
// ----------------------------------------------------------------------------- |
|
75 |
// |
|
76 |
CFileManagerContainerBase::~CFileManagerContainerBase() |
|
77 |
{ |
|
78 |
delete iListBox; |
|
79 |
delete iEmptyText; |
|
80 |
} |
|
81 |
||
82 |
// ----------------------------------------------------------------------------- |
|
83 |
// CFileManagerContainerBase::SizeChanged |
|
84 |
// |
|
85 |
// ----------------------------------------------------------------------------- |
|
86 |
// |
|
87 |
void CFileManagerContainerBase::SizeChanged() |
|
88 |
{ |
|
89 |
if ( iListBox ) |
|
90 |
{ |
|
91 |
iListBox->SetRect( Rect() ); |
|
92 |
} |
|
93 |
} |
|
94 |
||
95 |
// ----------------------------------------------------------------------------- |
|
96 |
// CFileManagerContainerBase::CountComponentControls |
|
97 |
// |
|
98 |
// ----------------------------------------------------------------------------- |
|
99 |
// |
|
100 |
TInt CFileManagerContainerBase::CountComponentControls() const |
|
101 |
{ |
|
102 |
return iListBox ? 1 : 0; |
|
103 |
} |
|
104 |
||
105 |
// ----------------------------------------------------------------------------- |
|
106 |
// CFileManagerContainerBase::ComponentControl |
|
107 |
// |
|
108 |
// ----------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
CCoeControl* CFileManagerContainerBase::ComponentControl( |
|
111 |
TInt /* aIndex */ ) const |
|
112 |
{ |
|
113 |
return iListBox; |
|
114 |
} |
|
115 |
||
116 |
// ----------------------------------------------------------------------------- |
|
117 |
// CFileManagerContainerBase::OfferKeyEventL |
|
118 |
// |
|
119 |
// ----------------------------------------------------------------------------- |
|
120 |
// |
|
121 |
TKeyResponse CFileManagerContainerBase::OfferKeyEventL( |
|
122 |
const TKeyEvent& aKeyEvent, TEventCode aType ) |
|
123 |
{ |
|
124 |
return iListBox->OfferKeyEventL( aKeyEvent, aType ); |
|
125 |
} |
|
126 |
||
127 |
// ----------------------------------------------------------------------------- |
|
128 |
// CFileManagerContainerBase::ListBox |
|
129 |
// |
|
130 |
// ----------------------------------------------------------------------------- |
|
131 |
// |
|
132 |
CEikListBox& CFileManagerContainerBase::ListBox() |
|
133 |
{ |
|
134 |
return *iListBox; |
|
135 |
} |
|
136 |
||
137 |
// ----------------------------------------------------------------------------- |
|
138 |
// CFileManagerContainerBase::RefreshListL |
|
139 |
// |
|
140 |
// ----------------------------------------------------------------------------- |
|
141 |
// |
|
142 |
void CFileManagerContainerBase::RefreshListL( TInt aFocusedIndex ) |
|
143 |
{ |
|
144 |
if ( !iListBox ) |
|
145 |
{ |
|
146 |
return; |
|
147 |
} |
|
148 |
||
149 |
TBool isEmpty( ETrue ); |
|
150 |
if ( iArray ) |
|
151 |
{ |
|
152 |
if ( iArray->MdcaCount() ) |
|
153 |
{ |
|
154 |
isEmpty = EFalse; |
|
155 |
iListBox->Model()->SetItemTextArray( iArray ); |
|
156 |
// Remove ownership from listbox. |
|
157 |
iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
158 |
} |
|
159 |
} |
|
160 |
if ( isEmpty ) |
|
161 |
{ |
|
162 |
SetEmptyArrayL(); |
|
163 |
} |
|
164 |
||
165 |
iListBox->Reset(); |
|
166 |
SetIndex( aFocusedIndex ); |
|
167 |
iListBox->UpdateScrollBarsL(); |
|
168 |
iListBox->SetFocus( ETrue ); |
|
169 |
||
170 |
if ( iEmptyText ) |
|
171 |
{ |
|
172 |
iListBox->View()->SetListEmptyTextL( *iEmptyText ); |
|
173 |
} |
|
174 |
else |
|
175 |
{ |
|
176 |
iListBox->View()->SetListEmptyTextL( KNullDesC ); |
|
177 |
} |
|
178 |
iListBox->DrawDeferred(); |
|
179 |
} |
|
180 |
||
181 |
// ----------------------------------------------------------------------------- |
|
182 |
// CFileManagerContainerBase::SetListEmptyL |
|
183 |
// |
|
184 |
// ----------------------------------------------------------------------------- |
|
185 |
// |
|
186 |
void CFileManagerContainerBase::SetListEmptyL() |
|
187 |
{ |
|
188 |
if ( !iListBox ) |
|
189 |
{ |
|
190 |
return; |
|
191 |
} |
|
192 |
SetEmptyArrayL(); |
|
193 |
iListBox->View()->SetListEmptyTextL( KNullDesC ); |
|
194 |
} |
|
195 |
||
196 |
// ----------------------------------------------------------------------------- |
|
197 |
// CFileManagerContainerBase::SetIndex |
|
198 |
// |
|
199 |
// ----------------------------------------------------------------------------- |
|
200 |
// |
|
201 |
void CFileManagerContainerBase::SetIndex( TInt aFocusedIndex ) |
|
202 |
{ |
|
203 |
if ( !iListBox ) |
|
204 |
{ |
|
205 |
return; |
|
206 |
} |
|
207 |
// Check that given index is valid |
|
208 |
if ( aFocusedIndex >= 0 && |
|
209 |
aFocusedIndex < iListBox->Model()->NumberOfItems() ) |
|
210 |
{ |
|
211 |
iListBox->SetCurrentItemIndex( aFocusedIndex ); |
|
212 |
} |
|
213 |
else |
|
214 |
{ |
|
215 |
// if list is empty or value is negative then set focus to 0 |
|
216 |
if ( !iListBox->Model()->NumberOfItems() || aFocusedIndex < 0 ) |
|
217 |
{ |
|
218 |
iListBox->SetCurrentItemIndex( 0 ); |
|
219 |
} |
|
220 |
else |
|
221 |
{ |
|
222 |
// Something has been deleted in the end of the list |
|
223 |
// set focus to last one so the focus doesn't jump around |
|
224 |
iListBox->SetCurrentItemIndex( |
|
225 |
iListBox->Model()->NumberOfItems() - 1 ); |
|
226 |
} |
|
227 |
} |
|
228 |
} |
|
229 |
||
230 |
// ----------------------------------------------------------------------------- |
|
231 |
// CFileManagerContainerBase::SetTextArray |
|
232 |
// |
|
233 |
// ----------------------------------------------------------------------------- |
|
234 |
// |
|
235 |
void CFileManagerContainerBase::SetTextArray( MDesCArray* aArray ) |
|
236 |
{ |
|
237 |
iArray = aArray; |
|
238 |
} |
|
239 |
||
240 |
// ----------------------------------------------------------------------------- |
|
241 |
// CFileManagerContainerBase::SetEmptyTextL |
|
242 |
// |
|
243 |
// ----------------------------------------------------------------------------- |
|
244 |
// |
|
245 |
void CFileManagerContainerBase::SetEmptyTextL( TInt aTextId ) |
|
246 |
{ |
|
247 |
delete iEmptyText; |
|
248 |
iEmptyText = NULL; |
|
249 |
||
250 |
if ( aTextId ) |
|
251 |
{ |
|
252 |
iEmptyText = StringLoader::LoadL( aTextId ); |
|
253 |
} |
|
254 |
} |
|
255 |
||
256 |
// ----------------------------------------------------------------------------- |
|
257 |
// CFileManagerContainerBase::SetHelpContext |
|
258 |
// |
|
259 |
// ----------------------------------------------------------------------------- |
|
260 |
// |
|
261 |
void CFileManagerContainerBase::SetHelpContext( |
|
262 |
const TDesC& aHelpContext ) |
|
263 |
{ |
|
264 |
iHelpContext = aHelpContext; |
|
265 |
} |
|
266 |
||
267 |
// ----------------------------------------------------------------------------- |
|
268 |
// CFileManagerContainerBase::HandleListBoxEventL |
|
269 |
// |
|
270 |
// ----------------------------------------------------------------------------- |
|
271 |
// |
|
272 |
void CFileManagerContainerBase::HandleListBoxEventL( |
|
273 |
CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) |
|
274 |
{ |
|
275 |
switch ( aEventType ) |
|
276 |
{ |
|
277 |
case EEventItemSingleClicked: // FALLTHROUGH |
|
278 |
case EEventEnterKeyPressed: |
|
279 |
{ |
|
280 |
static_cast< CAknAppUi* >( ControlEnv()->AppUi() )-> |
|
281 |
ProcessCommandL( EFileManagerSelectionKey ); |
|
282 |
break; |
|
283 |
} |
|
284 |
default: |
|
285 |
{ |
|
286 |
break; |
|
287 |
} |
|
288 |
} |
|
289 |
} |
|
290 |
||
291 |
// ----------------------------------------------------------------------------- |
|
292 |
// CFileManagerContainerBase::HandleControlEventL |
|
293 |
// |
|
294 |
// ----------------------------------------------------------------------------- |
|
295 |
// |
|
296 |
void CFileManagerContainerBase::HandleControlEventL( |
|
297 |
CCoeControl* /* aControl*/, TCoeEvent /*aEventType*/ ) |
|
298 |
{ |
|
299 |
} |
|
300 |
||
301 |
// ----------------------------------------------------------------------------- |
|
302 |
// CFileManagerContainerBase::FocusChanged |
|
303 |
// |
|
304 |
// ----------------------------------------------------------------------------- |
|
305 |
// |
|
306 |
void CFileManagerContainerBase::FocusChanged( TDrawNow aDrawNow ) |
|
307 |
{ |
|
308 |
CCoeControl::FocusChanged( aDrawNow ); |
|
309 |
||
310 |
if ( iListBox ) |
|
311 |
{ |
|
312 |
iListBox->SetFocus( IsFocused(), aDrawNow ); |
|
313 |
} |
|
314 |
} |
|
315 |
||
316 |
// ----------------------------------------------------------------------------- |
|
317 |
// CFileManagerContainerBase::GetHelpContext |
|
318 |
// |
|
319 |
// ----------------------------------------------------------------------------- |
|
320 |
// |
|
321 |
void CFileManagerContainerBase::GetHelpContext( |
|
322 |
TCoeHelpContext& aContext ) const |
|
323 |
{ |
|
324 |
if ( iHelpContext.Length() ) |
|
325 |
{ |
|
326 |
aContext.iMajor = TUid::Uid( KFileManagerUID3 ); |
|
327 |
aContext.iContext = iHelpContext; |
|
328 |
} |
|
329 |
else |
|
330 |
{ |
|
331 |
CCoeControl::GetHelpContext( aContext ); |
|
332 |
} |
|
333 |
} |
|
334 |
||
335 |
// ----------------------------------------------------------------------------- |
|
336 |
// CFileManagerContainerBase::ListBoxExists |
|
337 |
// |
|
338 |
// ----------------------------------------------------------------------------- |
|
339 |
// |
|
340 |
TBool CFileManagerContainerBase::ListBoxExists() const |
|
341 |
{ |
|
342 |
return iListBox ? ETrue : EFalse; |
|
343 |
} |
|
344 |
||
345 |
// ----------------------------------------------------------------------------- |
|
346 |
// CFileManagerContainerBase::SetEmptyArrayL |
|
347 |
// |
|
348 |
// ----------------------------------------------------------------------------- |
|
349 |
// |
|
350 |
void CFileManagerContainerBase::SetEmptyArrayL() |
|
351 |
{ |
|
352 |
CDesCArray* empty = new( ELeave ) CDesCArrayFlat( 1 ); |
|
353 |
iListBox->Model()->SetItemTextArray( empty ); |
|
354 |
// Transfer ownership to listbox. |
|
355 |
iListBox->Model()->SetOwnershipType( ELbmOwnsItemArray ); |
|
356 |
} |
|
357 |
||
358 |
// ----------------------------------------------------------------------------- |
|
359 |
// CFileManagerContainerBase::ProcessCommandL |
|
360 |
// |
|
361 |
// ----------------------------------------------------------------------------- |
|
362 |
// |
|
22
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
363 |
void CFileManagerContainerBase::ProcessCommandL( TInt /* aCommandId */ ) |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
364 |
{ |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
365 |
} |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
366 |
|
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
367 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
368 |
// CFileManagerContainerBase::MarkingModeStatusChanged() |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
369 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
370 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
371 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
372 |
void CFileManagerContainerBase::MarkingModeStatusChanged( TBool aActivated ) |
21 | 373 |
{ |
22
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
374 |
// Set flag to indicate marking model is activated or not |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
375 |
iMarkingModeActivated = aActivated; |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
376 |
} |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
377 |
|
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
378 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
379 |
// CFileManagerContainerBase::ExitMarkingMode() |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
380 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
381 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
382 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
383 |
TBool CFileManagerContainerBase::ExitMarkingMode() const |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
384 |
{ |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
385 |
return iAllowMarkingModeExit; |
21 | 386 |
} |
387 |
||
388 |
// ----------------------------------------------------------------------------- |
|
389 |
// CFileManagerContainerBase::SelectionModeChanged |
|
390 |
// |
|
391 |
// ----------------------------------------------------------------------------- |
|
392 |
// |
|
393 |
void CFileManagerContainerBase::SelectionModeChanged( |
|
394 |
CEikListBox* aListBox, TBool aSelectionModeEnabled ) |
|
395 |
{ |
|
396 |
if ( iListBox == aListBox && |
|
397 |
iSelectionModeEnabled != aSelectionModeEnabled ) |
|
398 |
{ |
|
399 |
iSelectionModeEnabled = aSelectionModeEnabled; |
|
400 |
if ( !iSelectionModeEnabled ) |
|
401 |
{ |
|
402 |
// Update cba after selection mode gets done |
|
403 |
UpdateCba(); |
|
404 |
} |
|
405 |
} |
|
406 |
} |
|
407 |
||
408 |
// ----------------------------------------------------------------------------- |
|
409 |
// CFileManagerContainerBase::SelectionModeEnabled |
|
410 |
// |
|
411 |
// ----------------------------------------------------------------------------- |
|
412 |
// |
|
413 |
TBool CFileManagerContainerBase::SelectionModeEnabled() const |
|
414 |
{ |
|
415 |
return iSelectionModeEnabled; |
|
416 |
} |
|
417 |
||
418 |
// ----------------------------------------------------------------------------- |
|
22
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
419 |
// CFileManagerContainerBase::IsMarkingModeActivated |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
420 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
421 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
422 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
423 |
TBool CFileManagerContainerBase::IsMarkingModeActivated() const |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
424 |
{ |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
425 |
return iMarkingModeActivated; |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
426 |
} |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
427 |
// ----------------------------------------------------------------------------- |
21 | 428 |
// CFileManagerContainerBase::UpdateCba |
429 |
// |
|
430 |
// ----------------------------------------------------------------------------- |
|
431 |
// |
|
432 |
void CFileManagerContainerBase::UpdateCba() |
|
433 |
{ |
|
434 |
} |
|
435 |
||
436 |
// ----------------------------------------------------------------------------- |
|
437 |
// CFileManagerContainerBase::ListBoxCurrentItemIndex |
|
438 |
// |
|
439 |
// ----------------------------------------------------------------------------- |
|
440 |
// |
|
441 |
TInt CFileManagerContainerBase::ListBoxCurrentItemIndex() |
|
442 |
{ |
|
443 |
return iListBox->CurrentItemIndex(); |
|
444 |
} |
|
445 |
||
446 |
// ----------------------------------------------------------------------------- |
|
447 |
// CFileManagerContainerBase::ListBoxNumberOfItems |
|
448 |
// |
|
449 |
// ----------------------------------------------------------------------------- |
|
450 |
// |
|
451 |
TInt CFileManagerContainerBase::ListBoxNumberOfItems() |
|
452 |
{ |
|
453 |
return iListBox->Model()->NumberOfItems(); |
|
454 |
} |
|
455 |
||
456 |
// ----------------------------------------------------------------------------- |
|
457 |
// CFileManagerContainerBase::ListBoxSelectionIndexes |
|
458 |
// |
|
459 |
// ----------------------------------------------------------------------------- |
|
460 |
// |
|
461 |
const CArrayFix< TInt >* CFileManagerContainerBase::ListBoxSelectionIndexes() |
|
462 |
{ |
|
463 |
return iListBox->SelectionIndexes(); |
|
464 |
} |
|
465 |
||
466 |
// ----------------------------------------------------------------------------- |
|
467 |
// CFileManagerContainerBase::ListBoxSelectionIndexesCount |
|
468 |
// |
|
469 |
// ----------------------------------------------------------------------------- |
|
470 |
// |
|
471 |
TInt CFileManagerContainerBase::ListBoxSelectionIndexesCount() |
|
472 |
{ |
|
473 |
return iListBox->SelectionIndexes()->Count(); |
|
474 |
} |
|
475 |
||
476 |
// ----------------------------------------------------------------------------- |
|
477 |
// CFileManagerContainerBase::ListBoxToggleItemL |
|
478 |
// |
|
479 |
// ----------------------------------------------------------------------------- |
|
480 |
// |
|
481 |
void CFileManagerContainerBase::ListBoxToggleItemL( TInt aIndex ) |
|
482 |
{ |
|
483 |
iListBox->View()->ToggleItemL( aIndex ); |
|
484 |
} |
|
485 |
||
486 |
// ----------------------------------------------------------------------------- |
|
487 |
// CFileManagerContainerBase::ListBoxIsItemSelected |
|
488 |
// |
|
489 |
// ----------------------------------------------------------------------------- |
|
490 |
// |
|
491 |
TBool CFileManagerContainerBase::ListBoxIsItemSelected( TInt aIndex ) |
|
492 |
{ |
|
493 |
return iListBox->View()->ItemIsSelected( aIndex ); |
|
494 |
} |
|
495 |
||
496 |
// ----------------------------------------------------------------------------- |
|
497 |
// CFileManagerContainerBase::ListBoxSelectAllL |
|
498 |
// |
|
499 |
// ----------------------------------------------------------------------------- |
|
500 |
// |
|
501 |
void CFileManagerContainerBase::ListBoxSelectAllL() |
|
502 |
{ |
|
503 |
TInt count( ListBoxNumberOfItems() ); |
|
504 |
if ( count > 0 ) |
|
505 |
{ |
|
506 |
CArrayFixFlat<TInt>* array = |
|
507 |
new( ELeave ) CArrayFixFlat< TInt >( count ); |
|
508 |
CleanupStack::PushL( array ); |
|
509 |
for ( TInt i( 0 ); i < count; ++i ) |
|
510 |
{ |
|
511 |
array->AppendL( i ); |
|
512 |
} |
|
513 |
iListBox->View()->SetSelectionIndexesL( array ); |
|
514 |
CleanupStack::PopAndDestroy( array ); |
|
515 |
} |
|
516 |
} |
|
517 |
||
518 |
// ----------------------------------------------------------------------------- |
|
519 |
// CFileManagerContainerBase::ListBoxClearSelection |
|
520 |
// |
|
521 |
// ----------------------------------------------------------------------------- |
|
522 |
// |
|
523 |
void CFileManagerContainerBase::ListBoxClearSelection() |
|
524 |
{ |
|
525 |
iListBox->View()->ClearSelection(); |
|
526 |
} |
|
527 |
||
528 |
// ----------------------------------------------------------------------------- |
|
529 |
// CFileManagerContainerBase::ListBoxSetTextL |
|
530 |
// |
|
531 |
// ----------------------------------------------------------------------------- |
|
532 |
// |
|
533 |
void CFileManagerContainerBase::ListBoxSetTextL( const TDesC& aText ) |
|
534 |
{ |
|
535 |
iListBox->View()->SetListEmptyTextL( aText ); |
|
536 |
iListBox->DrawDeferred(); |
|
537 |
} |
|
538 |
||
539 |
// ----------------------------------------------------------------------------- |
|
540 |
// CFileManagerContainerBase::IsSearchFieldVisible |
|
541 |
// |
|
542 |
// ----------------------------------------------------------------------------- |
|
543 |
// |
|
544 |
TBool CFileManagerContainerBase::IsSearchFieldVisible() const |
|
545 |
{ |
|
546 |
return EFalse; |
|
547 |
} |
|
548 |
||
549 |
// ----------------------------------------------------------------------------- |
|
550 |
// CFileManagerContainerBase::EnableSearchFieldL |
|
551 |
// |
|
552 |
// ----------------------------------------------------------------------------- |
|
553 |
// |
|
554 |
void CFileManagerContainerBase::EnableSearchFieldL( |
|
555 |
TBool /*aEnable*/, const TDesC& /*aSearchText^*/ ) |
|
556 |
{ |
|
557 |
} |
|
558 |
||
559 |
// ----------------------------------------------------------------------------- |
|
560 |
// CFileManagerContainerBase::SetCurrentItemIndexAfterSearch |
|
561 |
// |
|
562 |
// ----------------------------------------------------------------------------- |
|
563 |
// |
|
564 |
void CFileManagerContainerBase::SetCurrentItemIndexAfterSearch( |
|
565 |
TInt /*aIndex*/ ) |
|
566 |
{ |
|
567 |
} |
|
568 |
||
569 |
// ----------------------------------------------------------------------------- |
|
570 |
// CFileManagerContainerBase::ListBoxSelectItemL |
|
571 |
// |
|
572 |
// ----------------------------------------------------------------------------- |
|
573 |
// |
|
574 |
void CFileManagerContainerBase::ListBoxSelectItemL( TInt aIndex ) |
|
575 |
{ |
|
576 |
iListBox->View()->SelectItemL( aIndex ); |
|
577 |
} |
|
578 |
||
579 |
// ----------------------------------------------------------------------------- |
|
580 |
// CFileManagerContainerBase::ListBoxDeselectItem |
|
581 |
// |
|
582 |
// ----------------------------------------------------------------------------- |
|
583 |
// |
|
584 |
void CFileManagerContainerBase::ListBoxDeselectItem( TInt aIndex ) |
|
585 |
{ |
|
586 |
iListBox->View()->DeselectItem( aIndex ); |
|
587 |
} |
|
588 |
||
589 |
// ----------------------------------------------------------------------------- |
|
590 |
// CFileManagerContainerBase::ListBoxSetSelectionIndexesL |
|
591 |
// |
|
592 |
// ----------------------------------------------------------------------------- |
|
593 |
// |
|
594 |
void CFileManagerContainerBase::ListBoxSetSelectionIndexesL(const CArrayFixFlat<TInt>* |
|
595 |
aSelectionIndexes) |
|
596 |
{ |
|
597 |
iListBox->View()->SetSelectionIndexesL( aSelectionIndexes ); |
|
598 |
} |
|
599 |
||
600 |
// ----------------------------------------------------------------------------- |
|
601 |
// CFileManagerContainerBase::SearchFieldToListBoxIndex |
|
602 |
// |
|
603 |
// ----------------------------------------------------------------------------- |
|
604 |
// |
|
605 |
TInt CFileManagerContainerBase::SearchFieldToListBoxIndex( TInt aIndex ) |
|
606 |
{ |
|
607 |
return 0; |
|
608 |
} |
|
22
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
609 |
|
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
610 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
611 |
// CFileManagerContainerBase::AllowMarkingModeExit |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
612 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
613 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
614 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
615 |
void CFileManagerContainerBase::AllowMarkingModeExit( TBool aAllowExit ) |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
616 |
{ |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
617 |
iAllowMarkingModeExit = aAllowExit; |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
618 |
} |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
619 |
|
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
620 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
621 |
// CFileManagerContainerBase::SetMarkingMode |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
622 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
623 |
// ----------------------------------------------------------------------------- |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
624 |
// |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
625 |
void CFileManagerContainerBase::SetMarkingMode( TBool aEnable ) |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
626 |
{ |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
627 |
iListBox->SetMarkingMode( aEnable ); |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
628 |
} |
f5c50b8af68c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
21
diff
changeset
|
629 |
|
21 | 630 |
// End of File |