54
|
1 |
/*
|
|
2 |
* Copyright (c) 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: View class to display a thumbnail grid after burst capture*
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
// INCLUDE FILES
|
|
19 |
|
|
20 |
#include <eikmenub.h>
|
|
21 |
#include <StringLoader.h>
|
|
22 |
#include <AknQueryDialog.h>
|
|
23 |
#include <TSendingCapabilities.h>
|
|
24 |
#include <cameraapp.rsg>
|
|
25 |
#include <vgacamsettings.rsg>
|
|
26 |
#include <sendnorm.rsg>
|
|
27 |
#include <sendui.h>
|
|
28 |
#include <SenduiMtmUids.h>
|
|
29 |
#include <CMessageData.h>
|
|
30 |
#include <aknlayoutscalable_apps.cdl.h> // AknLayoutScalable_Apps
|
|
31 |
//#include <SFIUtilsAppInterface.h>
|
|
32 |
#include <aknnotewrappers.h> // CAknInformationNote
|
|
33 |
#include <akntoolbar.h> // CAknToolbar
|
|
34 |
#include <aknbutton.h>
|
|
35 |
#include <eiksoftkeypostingtransparency.h> // EikSoftkeyPostingTransparency
|
|
36 |
|
|
37 |
#include "CamAppUi.h"
|
|
38 |
#include "CamUtility.h"
|
|
39 |
//#include "camproductvariant.h"
|
|
40 |
#include "CamBurstThumbnailView.h"
|
|
41 |
#include "CamAppUiBase.h"
|
|
42 |
#include "CamBurstThumbnailContainer.h"
|
|
43 |
#include "Cam.hrh"
|
|
44 |
#include "CamBurstThumbnailGridModel.h"
|
|
45 |
#include "CamBurstThumbnailGrid.h"
|
|
46 |
#include "CamBurstCaptureArray.h"
|
|
47 |
#include "camoneclickuploadutility.h"
|
|
48 |
#include "CameraUiConfigManager.h"
|
|
49 |
#include "OstTraceDefinitions.h"
|
|
50 |
#ifdef OST_TRACE_COMPILER_IN_USE
|
|
51 |
#include "CamBurstThumbnailViewTraces.h"
|
|
52 |
#endif
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
//CONSTANTS
|
|
57 |
_LIT( KCamImageMimeType, "image/jpeg" );
|
|
58 |
|
|
59 |
// ========================= MEMBER FUNCTIONS ================================
|
|
60 |
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
// CCamBurstThumbnailView::NewLC
|
|
63 |
// Symbian OS two-phased constructor
|
|
64 |
// ---------------------------------------------------------------------------
|
|
65 |
//
|
|
66 |
CCamBurstThumbnailView* CCamBurstThumbnailView::NewLC( CCamAppController& aController )
|
|
67 |
{
|
|
68 |
CCamBurstThumbnailView* self =
|
|
69 |
new( ELeave ) CCamBurstThumbnailView( aController );
|
|
70 |
|
|
71 |
CleanupStack::PushL( self );
|
|
72 |
self->ConstructL();
|
|
73 |
|
|
74 |
return self;
|
|
75 |
}
|
|
76 |
|
|
77 |
// ---------------------------------------------------------------------------
|
|
78 |
// CCamBurstThumbnailView destructor
|
|
79 |
//
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
CCamBurstThumbnailView::~CCamBurstThumbnailView()
|
|
83 |
{
|
|
84 |
PRINT( _L("Camera => ~CCamBurstThumbnailView") );
|
|
85 |
// Free some space by deleting the model
|
|
86 |
delete iGridModel;
|
|
87 |
|
|
88 |
// NOTE: iAiwServiceHandler owned and deleted by base class
|
|
89 |
PRINT( _L("Camera <= ~CCamBurstThumbnailView") );
|
|
90 |
}
|
|
91 |
|
|
92 |
// ---------------------------------------------------------------------------
|
|
93 |
// CCamBurstThumbnailView::Id
|
|
94 |
// Returns UID of view
|
|
95 |
// ---------------------------------------------------------------------------
|
|
96 |
//
|
|
97 |
TUid CCamBurstThumbnailView::Id() const
|
|
98 |
{
|
|
99 |
return TUid::Uid( ECamViewIdBurstThumbnail );
|
|
100 |
}
|
|
101 |
|
|
102 |
|
|
103 |
// ---------------------------------------------------------------------------
|
|
104 |
// CCamBurstThumbnailView::DynInitMenuPaneL
|
|
105 |
// Changes MenuPane dynamically
|
|
106 |
// ---------------------------------------------------------------------------
|
|
107 |
//
|
|
108 |
void CCamBurstThumbnailView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
|
|
109 |
{
|
|
110 |
PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL"))
|
|
111 |
|
|
112 |
// initializes the aiw service parameters for aiw commands
|
|
113 |
DynInitAiwMenuPaneL( aResourceId, aMenuPane );
|
|
114 |
|
|
115 |
if ( iAiwServiceHandler )
|
|
116 |
{
|
|
117 |
// handle any AIW menu cascades
|
|
118 |
if ( iAiwServiceHandler->HandleSubmenuL( *aMenuPane ) )
|
|
119 |
{
|
|
120 |
return;
|
|
121 |
}
|
|
122 |
}
|
|
123 |
|
|
124 |
if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
|
|
125 |
{
|
|
126 |
// If there are >1 images marked remove the
|
|
127 |
// open image item.
|
|
128 |
if ( iGridModel->NoOfMarkedImages() > 1 )
|
|
129 |
{
|
|
130 |
aMenuPane->SetItemDimmed( ECamCmdOpenPhoto, ETrue );
|
|
131 |
TInt itemPos = 0;
|
|
132 |
if( aMenuPane->MenuItemExists( KAiwCmdUpload, itemPos ) )
|
|
133 |
{
|
|
134 |
PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL SetItemDimmed: KAiwCmdUpload"))
|
|
135 |
aMenuPane->SetItemDimmed(
|
|
136 |
KAiwCmdUpload, ETrue );
|
|
137 |
}
|
|
138 |
if( aMenuPane->MenuItemExists( ECamCmdShareOnOvi, itemPos ) )
|
|
139 |
{
|
|
140 |
PRINT( _L("Camera => CCamBurstThumbnailView::DynInitMenuPaneL SetItemDimmed: ECamCmdShareOnOvi"))
|
|
141 |
aMenuPane->SetItemDimmed(
|
|
142 |
ECamCmdShareOnOvi, ETrue );
|
|
143 |
}
|
|
144 |
}
|
|
145 |
|
|
146 |
// In touch ui the delete option is available on the fixed toolbar
|
|
147 |
// there is no need to display it in the options menu
|
|
148 |
if ( iController.IsTouchScreenSupported() )
|
|
149 |
{
|
|
150 |
TInt itemPos = 0;
|
|
151 |
if ( aMenuPane->MenuItemExists( ECamCmdDelete, itemPos ) )
|
|
152 |
{
|
|
153 |
aMenuPane->SetItemDimmed( ECamCmdDelete, ETrue );
|
|
154 |
}
|
|
155 |
}
|
|
156 |
} // ends: if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
|
|
157 |
|
|
158 |
|
|
159 |
// ------------------------------------------------------------------
|
|
160 |
if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU ||
|
|
161 |
aResourceId == R_CAM_BURST_THUMBNAIL_OK_MENU )
|
|
162 |
{
|
|
163 |
TBool showSend = ETrue;
|
|
164 |
TBool showSendToCaller = EFalse;
|
|
165 |
|
|
166 |
/*#ifndef __WINS__
|
|
167 |
if ( iSFIUtils->IsCLIValidL() )
|
|
168 |
{
|
|
169 |
showSend = EFalse;
|
|
170 |
showSendToCaller = ETrue;
|
|
171 |
|
|
172 |
if ( iGridModel->NoOfMarkedImages() > 1 )
|
|
173 |
{
|
|
174 |
// Send to caller is disabled if multiple images
|
|
175 |
// have been marked.
|
|
176 |
showSendToCaller = EFalse;
|
|
177 |
}
|
|
178 |
}
|
|
179 |
#endif*/
|
|
180 |
|
|
181 |
if ( iController.IsTouchScreenSupported() &&
|
|
182 |
!iOneClickUploadUtility->OneClickUploadSupported() &&
|
|
183 |
aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
|
|
184 |
{
|
|
185 |
// In touch UI, when one click upload is not supported,
|
|
186 |
// there will be a Send button in the fixed toolbar. Options
|
|
187 |
// menu items are not needed. Send is kept in the context menu.
|
|
188 |
showSend = EFalse;
|
|
189 |
showSendToCaller = EFalse;
|
|
190 |
}
|
|
191 |
|
|
192 |
TInt itemPos = 0;
|
|
193 |
if( aMenuPane->MenuItemExists( ECamCmdSendToCallerMultimedia, itemPos ) )
|
|
194 |
{
|
|
195 |
aMenuPane->SetItemDimmed(
|
|
196 |
ECamCmdSendToCallerMultimedia, !showSendToCaller );
|
|
197 |
}
|
|
198 |
|
|
199 |
if( aMenuPane->MenuItemExists( ECamCmdSend, itemPos ) )
|
|
200 |
{
|
|
201 |
aMenuPane->SetItemDimmed(
|
|
202 |
ECamCmdSend, !showSend );
|
|
203 |
}
|
|
204 |
}
|
|
205 |
|
|
206 |
if ( aResourceId == R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION )
|
|
207 |
{
|
|
208 |
if ( iGridModel->IsMarkedL( iGridModel->HighlightedGridIndex() ) )
|
|
209 |
{
|
|
210 |
// If marked, hide the MARK option
|
|
211 |
aMenuPane->SetItemDimmed( EAknCmdMark, ETrue );
|
|
212 |
}
|
|
213 |
else
|
|
214 |
{
|
|
215 |
// If unmarked, hide the UNMARK option
|
|
216 |
aMenuPane->SetItemDimmed( EAknCmdUnmark, ETrue );
|
|
217 |
}
|
|
218 |
|
|
219 |
if ( iGridModel->NoOfMarkedImages() == 0 )
|
|
220 |
{
|
|
221 |
// If NO marked cells, hide the UNMARK ALL option
|
|
222 |
aMenuPane->SetItemDimmed( EAknUnmarkAll, ETrue );
|
|
223 |
}
|
|
224 |
|
|
225 |
if ( iGridModel->NoOfMarkedImages() == iGridModel->NoOfValidCells() )
|
|
226 |
{
|
|
227 |
// If ALL cells are marked, hide the MARKALL option
|
|
228 |
aMenuPane->SetItemDimmed( EAknMarkAll, ETrue );
|
|
229 |
}
|
|
230 |
}
|
|
231 |
|
|
232 |
PRINT( _L("Camera <= CCamBurstThumbnailView::DynInitMenuPaneL"))
|
|
233 |
}
|
|
234 |
|
|
235 |
// -----------------------------------------------------------------------------
|
|
236 |
// CCamBurstThumbnailView::HandleCommandL
|
|
237 |
// Handle commands
|
|
238 |
// -----------------------------------------------------------------------------
|
|
239 |
//
|
|
240 |
void CCamBurstThumbnailView::HandleCommandL( TInt aCommand )
|
|
241 |
{
|
|
242 |
|
|
243 |
PRINT1( _L("Camera => CCamBurstThumbnailView::HandleCommandL (aCommand: %d)"), aCommand )
|
|
244 |
|
|
245 |
// sometimes commands come even after DoDeactivate() has been called.
|
|
246 |
// this makes sure that those are ignored.
|
|
247 |
if ( iGridModel == NULL )
|
|
248 |
{
|
|
249 |
return;
|
|
250 |
}
|
|
251 |
|
|
252 |
switch ( aCommand )
|
|
253 |
{
|
|
254 |
case ECamCmdOneClickUpload:
|
|
255 |
{
|
|
256 |
TInt markedItems = iGridModel->NoOfMarkedImages();
|
|
257 |
// If there are no images marked use the highlighted image
|
|
258 |
// set it now for safety just in case no marked images are found
|
|
259 |
iController.SetAsCurrentImage(
|
|
260 |
iGridModel->HighlightedBurstIndex() );
|
|
261 |
|
|
262 |
if ( markedItems > 0 )
|
|
263 |
{
|
|
264 |
// Upload marked images
|
|
265 |
|
|
266 |
CDesC16ArrayFlat* fileNames =
|
|
267 |
new ( ELeave ) CDesC16ArrayFlat( markedItems );
|
|
268 |
CleanupStack::PushL( fileNames );
|
|
269 |
|
|
270 |
for ( TInt i = 0; i < iGridModel->NoOfImages(); i++ )
|
|
271 |
{
|
|
272 |
if ( iGridModel->IsMarkedL( i ) )
|
|
273 |
{
|
|
274 |
fileNames->AppendL( iGridModel->ImageFileName( i ) );
|
|
275 |
}
|
|
276 |
}
|
|
277 |
iOneClickUploadUtility->UploadL(
|
|
278 |
*fileNames );
|
|
279 |
CleanupStack::PopAndDestroy( fileNames );
|
|
280 |
}
|
|
281 |
else
|
|
282 |
{
|
|
283 |
// Upload highlighted image
|
|
284 |
iOneClickUploadUtility->UploadL(
|
|
285 |
iController.CurrentFullFileName() );
|
|
286 |
}
|
|
287 |
break;
|
|
288 |
}
|
|
289 |
case ECamCmdRenameImage:
|
|
290 |
{
|
|
291 |
iController.SetAsCurrentImage(
|
|
292 |
iGridModel->ConvertFromValidToGlobalIndex (
|
|
293 |
SingleSelectionGridIndexL() ) );
|
|
294 |
QueryRenameL( ECamControllerImage );
|
|
295 |
break;
|
|
296 |
}
|
|
297 |
|
|
298 |
case ECamCmdDelete:
|
|
299 |
{
|
|
300 |
if ( DisplayDeleteNoteL() )
|
|
301 |
{
|
|
302 |
DoDeleteL();
|
|
303 |
}
|
|
304 |
|
|
305 |
break;
|
|
306 |
}
|
|
307 |
|
|
308 |
case ECamCmdNewPhoto:
|
|
309 |
{
|
|
310 |
// the thumbnail scaling needs to be stopped in
|
|
311 |
// preparation for the app ui switching the view
|
|
312 |
iGridModel->CancelThumbnails();
|
|
313 |
CCamViewBase::HandleCommandL( aCommand ); // Pass on to AppUi
|
|
314 |
break;
|
|
315 |
}
|
|
316 |
|
|
317 |
case ECamCmdToolbarMarkUnmark:
|
|
318 |
{
|
|
319 |
TBool mark = iGridModel->IsMarkedL( iGridModel->HighlightedGridIndex() );
|
|
320 |
iGridModel->SetCurrentMark( !mark );
|
|
321 |
// UpdateOneClickUploadButton();
|
|
322 |
break;
|
|
323 |
}
|
|
324 |
|
|
325 |
case EAknCmdMark:
|
|
326 |
{
|
|
327 |
iGridModel->SetCurrentMark( ETrue );
|
|
328 |
// UpdateOneClickUploadButton();
|
|
329 |
break;
|
|
330 |
}
|
|
331 |
|
|
332 |
case EAknCmdUnmark:
|
|
333 |
{
|
|
334 |
iGridModel->SetCurrentMark( EFalse );
|
|
335 |
// UpdateOneClickUploadButton();
|
|
336 |
break;
|
|
337 |
}
|
|
338 |
|
|
339 |
case EAknMarkAll:
|
|
340 |
{
|
|
341 |
iGridModel->MarkAll( ETrue );
|
|
342 |
// UpdateOneClickUploadButton();
|
|
343 |
break;
|
|
344 |
}
|
|
345 |
|
|
346 |
case EAknUnmarkAll:
|
|
347 |
{
|
|
348 |
iGridModel->MarkAll( EFalse );
|
|
349 |
// UpdateOneClickUploadButton();
|
|
350 |
break;
|
|
351 |
}
|
|
352 |
|
|
353 |
case EAknSoftkeyBack:
|
|
354 |
{
|
|
355 |
// the thumbnail scaling needs to be stopped in
|
|
356 |
// preparation for the app ui switching the view
|
|
357 |
iGridModel->CancelThumbnails();
|
|
358 |
// About to be closed by user, so will want to delete the model
|
|
359 |
// on deactivation
|
|
360 |
if ( IsForeground() )
|
|
361 |
{
|
|
362 |
iResetModelOnDeactivate = ETrue;
|
|
363 |
}
|
|
364 |
CCamViewBase::HandleCommandL( aCommand ); // Pass on to AppUi
|
|
365 |
break;
|
|
366 |
}
|
|
367 |
case ECamMSKCmdAppChange:
|
|
368 |
case EAknSoftkeySelect:
|
|
369 |
{
|
|
370 |
if ( iGridModel->NoOfMarkedImages() == 0 )
|
|
371 |
{
|
|
372 |
// select the focused item and open it to still postcapture
|
|
373 |
iResetModelOnDeactivate = EFalse;
|
|
374 |
|
|
375 |
// This selects the highlighted image
|
|
376 |
iController.SetAsCurrentImage( iGridModel->HighlightedGridIndex() );
|
|
377 |
// ConvertFromValidToGlobalIndex used so that appropriate images are displayed
|
|
378 |
iController.SetAsCurrentImage( iGridModel->ConvertFromValidToGlobalIndex( iGridModel->HighlightedGridIndex() ) );
|
|
379 |
CCamViewBase::HandleCommandL( ECamCmdOpenPhoto );
|
|
380 |
}
|
|
381 |
else
|
|
382 |
{
|
|
383 |
// If at least one image is marked, open context sensitive menu
|
|
384 |
CEikMenuBar* menuBar = MenuBar();
|
|
385 |
if ( menuBar )
|
|
386 |
{
|
|
387 |
menuBar->SetMenuTitleResourceId( R_CAM_BURST_THUMBNAIL_OK_MENUBAR);
|
|
388 |
menuBar->SetMenuType( CEikMenuBar::EMenuContext );
|
|
389 |
menuBar->TryDisplayMenuBarL();
|
|
390 |
// Here we again set back the type of menu to "Options" when pressed LSK
|
|
391 |
menuBar->SetMenuType( CEikMenuBar::EMenuOptions );
|
|
392 |
menuBar->SetMenuTitleResourceId( R_CAM_BURST_THUMBNAIL_MENUBAR);
|
|
393 |
}
|
|
394 |
}
|
|
395 |
break;
|
|
396 |
}
|
|
397 |
|
|
398 |
case EAknSoftkeyOptions:
|
|
399 |
{
|
|
400 |
// do nothing - handled by the framework
|
|
401 |
break;
|
|
402 |
}
|
|
403 |
|
|
404 |
case EAknSoftkeyCancel:
|
|
405 |
{
|
|
406 |
// do nothing - handled by framework
|
|
407 |
break;
|
|
408 |
}
|
|
409 |
|
|
410 |
case ECamCmdSend:
|
|
411 |
{
|
|
412 |
CCamPostCaptureViewBase::HandleCommandL( aCommand );
|
|
413 |
break;
|
|
414 |
}
|
|
415 |
|
|
416 |
case ECamCmdSendToCallerMultimedia:
|
|
417 |
{
|
|
418 |
/*#ifndef __WINS__
|
|
419 |
DoInCallSendL();
|
|
420 |
#endif*/
|
|
421 |
}
|
|
422 |
break;
|
|
423 |
|
|
424 |
case ECamCmdQuickSend:
|
|
425 |
{
|
|
426 |
/*#ifndef __WINS__
|
|
427 |
if( iSFIUtils->IsCLIValidL() )
|
|
428 |
{
|
|
429 |
// only do send to caller if no images are marked
|
|
430 |
// or one image is marked
|
|
431 |
if ( iGridModel->NoOfMarkedImages() < 2 )
|
|
432 |
{
|
|
433 |
DoInCallSendL();
|
|
434 |
}
|
|
435 |
}
|
|
436 |
else
|
|
437 |
#endif // __WINS__*/
|
|
438 |
//{
|
|
439 |
DoSendAsL();
|
|
440 |
//}
|
|
441 |
}
|
|
442 |
break;
|
|
443 |
|
|
444 |
case ECamCmdExitStandby:
|
|
445 |
{
|
|
446 |
PRINT( _L("Camera :: CCamBurstThumbnailView::HandleCommandL ECamCmdExitStandby in") )
|
|
447 |
CCamViewBase::ExitStandbyModeL();
|
|
448 |
PRINT( _L("Camera :: CCamBurstThumbnailView::HandleCommandL ECamCmdExitStandby out") )
|
|
449 |
break;
|
|
450 |
}
|
|
451 |
|
|
452 |
case ECamCmdOpenPhoto:
|
|
453 |
{
|
|
454 |
iResetModelOnDeactivate = EFalse;
|
|
455 |
TInt markedItems = iGridModel->NoOfMarkedImages();
|
|
456 |
// If there are no images marked use the highlighted image
|
|
457 |
// set it now for safety just in case no marked images are found
|
|
458 |
iController.SetAsCurrentImage( iGridModel->HighlightedBurstIndex() );
|
|
459 |
|
|
460 |
if ( markedItems != 0 ) // this command should never be available if there is >1 marked item
|
|
461 |
{
|
|
462 |
TInt totalItems = iGridModel->NoOfImages();
|
|
463 |
TInt index = 0;
|
|
464 |
TBool found = EFalse;
|
|
465 |
while ( index < totalItems && !found )
|
|
466 |
{
|
|
467 |
if ( iGridModel->IsMarkedL( index ) )
|
|
468 |
{
|
|
469 |
found = ETrue;
|
|
470 |
iController.SetAsCurrentImage( index );
|
|
471 |
}
|
|
472 |
index++;
|
|
473 |
}
|
|
474 |
}
|
|
475 |
}
|
|
476 |
//lint -fallthrough
|
|
477 |
default:
|
|
478 |
{
|
|
479 |
// Handle AIW commands
|
|
480 |
TInt aiwServiceCmd = iAiwServiceHandler->ServiceCmdByMenuCmd( aCommand );
|
|
481 |
if ( aiwServiceCmd != KAiwCmdNone )
|
|
482 |
{
|
|
483 |
CAiwGenericParamList& inParams = iAiwServiceHandler->InParamListL();
|
|
484 |
CAiwGenericParamList& outParams = iAiwServiceHandler->OutParamListL();
|
|
485 |
// Add file path/s to AIW parameters
|
|
486 |
TInt markedItems = iGridModel->NoOfMarkedImages();
|
|
487 |
// If there are no images marked use the highlighted image
|
|
488 |
if ( markedItems == 0 )
|
|
489 |
{
|
|
490 |
TAiwVariant variant( iGridModel->ImageFileName(
|
|
491 |
iGridModel->HighlightedBurstIndex() ) );
|
|
492 |
TAiwGenericParam param( EGenericParamFile, variant );
|
|
493 |
inParams.AppendL( param );
|
|
494 |
|
|
495 |
// Set as contact call iamge needs image MIME type as AIW param
|
|
496 |
// Set as wall paper requires MIME type also.
|
|
497 |
TAiwVariant variant2( KCamImageMimeType );
|
|
498 |
TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
|
|
499 |
inParams.AppendL( param2 );
|
|
500 |
|
|
501 |
}
|
|
502 |
else // there are marked items, add them to the list
|
|
503 |
{
|
|
504 |
TInt totalItems = iGridModel->NoOfImages();
|
|
505 |
TInt index = 0;
|
|
506 |
TInt found = 0;
|
|
507 |
while ( index < totalItems && found < markedItems )
|
|
508 |
{
|
|
509 |
if ( iGridModel->IsMarkedL( index ) )
|
|
510 |
{
|
|
511 |
found++;
|
|
512 |
TAiwVariant variant( iGridModel->ImageFileName( index ) );
|
|
513 |
TAiwGenericParam param( EGenericParamFile, variant );
|
|
514 |
inParams.AppendL( param );
|
|
515 |
|
|
516 |
// Set as contact call iamge needs image MIME type as AIW param
|
|
517 |
// Set as wall paper requires MIME type also.
|
|
518 |
TAiwVariant variant2( KCamImageMimeType );
|
|
519 |
TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
|
|
520 |
inParams.AppendL( param2 );
|
|
521 |
}
|
|
522 |
index++;
|
|
523 |
}
|
|
524 |
}
|
|
525 |
|
|
526 |
iAiwServiceHandler->ExecuteMenuCmdL( aCommand, inParams, outParams, 0, this );
|
|
527 |
}
|
|
528 |
else
|
|
529 |
{
|
|
530 |
CCamViewBase::HandleCommandL( aCommand );
|
|
531 |
}
|
|
532 |
break;
|
|
533 |
}
|
|
534 |
}
|
|
535 |
|
|
536 |
PRINT1( _L("Camera <= CCamBurstThumbnailView::HandleCommandL (aCommand: %d)"), aCommand )
|
|
537 |
}
|
|
538 |
|
|
539 |
|
|
540 |
// ---------------------------------------------------------------------------
|
|
541 |
// CCamBurstThumbnailView::HandleNotifyL
|
|
542 |
// Handles any notification caused by asynchronous ExecuteCommandL
|
|
543 |
// or event.
|
|
544 |
// ---------------------------------------------------------------------------
|
|
545 |
//
|
|
546 |
TInt CCamBurstThumbnailView::HandleNotifyL(
|
|
547 |
TInt /*aCmdId*/,
|
|
548 |
TInt aEventId,
|
|
549 |
CAiwGenericParamList& /*aEventParamList*/,
|
|
550 |
const CAiwGenericParamList& /*aInParamList*/ )
|
|
551 |
{
|
|
552 |
//AIW fails to assign. eg. the contact is locked for being used now.
|
|
553 |
if ( aEventId == KAiwEventError && iController.IsAppUiAvailable() )
|
|
554 |
{
|
|
555 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( AppUi() );
|
|
556 |
TRAP_IGNORE( appUi->HandleCameraErrorL( KErrInUse ) );
|
|
557 |
}
|
|
558 |
|
|
559 |
return 0;
|
|
560 |
}
|
|
561 |
|
|
562 |
// -----------------------------------------------------------------------------
|
|
563 |
// CCamBurstThumbnailView::DisplayDeleteNoteL()
|
|
564 |
// Display confirmation note for deletion of images
|
|
565 |
// -----------------------------------------------------------------------------
|
|
566 |
//
|
|
567 |
TBool CCamBurstThumbnailView::DisplayDeleteNoteL()
|
|
568 |
{
|
|
569 |
// Display the delete confirmation note
|
|
570 |
HBufC* confirmationText;
|
|
571 |
|
|
572 |
// Find the number of images marked, to work out which note to display.
|
|
573 |
TInt noteText = 0;
|
|
574 |
TInt noteDlg = 0;
|
|
575 |
TInt noOfMarkedImages = iGridModel->NoOfMarkedImages();
|
|
576 |
|
|
577 |
// Check if no of marked images is zero (if we are to delete the current
|
|
578 |
// highlighted object) or one (if we are to delete a single marked item).
|
|
579 |
if ( noOfMarkedImages <= 1)
|
|
580 |
{
|
|
581 |
noteText = R_CAM_STILL_POST_CAPTURE_DELETE_NOTE_TEXT;
|
|
582 |
noteDlg = R_CAM_STILL_POST_CAPTURE_DELETE_NOTE;
|
|
583 |
confirmationText = StringLoader::LoadLC( noteText );
|
|
584 |
}
|
|
585 |
else // noOfMarkedImages > 1
|
|
586 |
{
|
|
587 |
noteText = R_CAM_BURST_DELETE_MULTIPLE_NOTE_TEXT;
|
|
588 |
noteDlg = R_CAM_BURST_DELETE_MULTIPLE_NOTE;
|
|
589 |
confirmationText = StringLoader::LoadLC( noteText, noOfMarkedImages );
|
|
590 |
}
|
|
591 |
|
|
592 |
// Create the dialog with the text, and show it to the user
|
|
593 |
CAknQueryDialog* confirmationDialog = new( ELeave )CAknQueryDialog( *confirmationText );
|
|
594 |
CleanupStack::PopAndDestroy( confirmationText );
|
|
595 |
|
|
596 |
return confirmationDialog->ExecuteLD( noteDlg );
|
|
597 |
}
|
|
598 |
|
|
599 |
// -----------------------------------------------------------------------------
|
|
600 |
// CCamBurstThumbnailView::DoDeleteL
|
|
601 |
// Marks the required files for deletion
|
|
602 |
// -----------------------------------------------------------------------------
|
|
603 |
//
|
|
604 |
void CCamBurstThumbnailView::DoDeleteL()
|
|
605 |
{
|
|
606 |
if ( iGridModel->NoOfMarkedImages() > 0 )
|
|
607 |
{
|
|
608 |
// Confirmation; mark the files for deletion.
|
|
609 |
iGridModel->DeleteMarkedL();
|
|
610 |
}
|
|
611 |
else
|
|
612 |
{
|
|
613 |
// Confirmation; mark the highlighted item
|
|
614 |
iGridModel->DeleteHighlightL();
|
|
615 |
}
|
|
616 |
// UpdateOneClickUploadButton();
|
|
617 |
}
|
|
618 |
|
|
619 |
|
|
620 |
|
|
621 |
// -----------------------------------------------------------------------------
|
|
622 |
// CCamBurstThumbnailView::HandleForegroundEventL
|
|
623 |
// Handle foreground event
|
|
624 |
// -----------------------------------------------------------------------------
|
|
625 |
//
|
|
626 |
void CCamBurstThumbnailView::HandleForegroundEventL( TBool aForeground )
|
|
627 |
{
|
|
628 |
PRINT( _L("Camera => CCamBurstThumbnailView::HandleForegroundEventL") );
|
|
629 |
|
|
630 |
if ( aForeground )
|
|
631 |
{
|
|
632 |
CCamAppUiBase* appui = static_cast<CCamAppUiBase*>( AppUi() );
|
|
633 |
if ( !appui->IsInPretendExit() )
|
|
634 |
{
|
|
635 |
IncrementCameraUsers();
|
|
636 |
iController.DeepSleepTimerStart();
|
|
637 |
}
|
|
638 |
}
|
|
639 |
else
|
|
640 |
{
|
|
641 |
// Only decrements if we have incremented.
|
|
642 |
DecrementCameraUsers();
|
|
643 |
}
|
|
644 |
|
|
645 |
PRINT( _L("Camera <= CCamBurstThumbnailView::HandleForegroundEventL") );
|
|
646 |
}
|
|
647 |
|
|
648 |
|
|
649 |
// ---------------------------------------------------------------------------
|
|
650 |
// CCamBurstThumbnailView::DoActivateL
|
|
651 |
// Activate this view
|
|
652 |
// ---------------------------------------------------------------------------
|
|
653 |
//
|
|
654 |
void CCamBurstThumbnailView::DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
|
|
655 |
const TDesC8& aCustomMessage )
|
|
656 |
{
|
|
657 |
OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, CCAMBURSTTHUMBNAILVIEW_DOACTIVATEL, "e_CCamBurstThumbnailView_DoActivateL 1" );
|
|
658 |
PRINT( _L( "Camera => CCamBurstThumbnailView::DoActivateL" ) );
|
|
659 |
PERF_EVENT_START_L2( EPerfEventBurstThumbnailViewActivation );
|
|
660 |
if ( aPrevViewId.iViewUid.iUid == ECamViewIdStillPreCapture || !iGridModel )
|
|
661 |
{
|
|
662 |
iResetModelOnDeactivate = EFalse;
|
|
663 |
|
|
664 |
// Precautionary tidyup, though should never happen.
|
|
665 |
if ( iGridModel )
|
|
666 |
{
|
|
667 |
delete iGridModel;
|
|
668 |
iGridModel = NULL;
|
|
669 |
}
|
|
670 |
|
|
671 |
// If we've come from Pre-Capture view, we shouldn't have an active model.
|
|
672 |
// Create a new one and register with it.
|
|
673 |
iGridModel = CCamBurstThumbnailGridModel::NewL();
|
|
674 |
iGridModel->AddModelObserverL( this,
|
|
675 |
CCamBurstThumbnailGridModel::EModelEventDeleted |
|
|
676 |
CCamBurstThumbnailGridModel::EModelEventHighlight );
|
|
677 |
|
|
678 |
// Guaranteed to only be called right after a burst capture
|
|
679 |
iGridModel->SetBurstArrayL( iController.BurstCaptureArray() );
|
|
680 |
}
|
|
681 |
else
|
|
682 |
{
|
|
683 |
// We still need to re-register for model events, else if we return to
|
|
684 |
// grid view from post-capture, we won't receive delete/highlight events
|
|
685 |
// any more.
|
|
686 |
iGridModel->AddModelObserverL( this,
|
|
687 |
CCamBurstThumbnailGridModel::EModelEventDeleted |
|
|
688 |
CCamBurstThumbnailGridModel::EModelEventHighlight );
|
|
689 |
|
|
690 |
iGridModel->RefreshL();
|
|
691 |
}
|
|
692 |
|
|
693 |
if ( iController.IsTouchScreenSupported() )
|
|
694 |
{
|
|
695 |
// set toolbar
|
|
696 |
if ( iOneClickUploadUtility->OneClickUploadSupported() )
|
|
697 |
{
|
|
698 |
CreateAndSetToolbarL( R_CAM_BURST_POSTCAPTURE_TOOLBAR_UPLOAD );
|
|
699 |
UpdateToolbarIconsL();
|
|
700 |
}
|
|
701 |
CAknToolbar* fixedToolbar = Toolbar();
|
|
702 |
if ( fixedToolbar )
|
|
703 |
{
|
|
704 |
fixedToolbar->SetToolbarObserver( this );
|
|
705 |
fixedToolbar->SetToolbarVisibility( ETrue );
|
|
706 |
}
|
|
707 |
}
|
|
708 |
|
|
709 |
|
|
710 |
|
|
711 |
CCamPostCaptureViewBase::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
|
|
712 |
|
|
713 |
iAiwServiceHandler->Reset();
|
|
714 |
|
|
715 |
// initialise AIW services for touch menu
|
|
716 |
iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU,
|
|
717 |
R_CAM_MOVE_TO_STILL_IMAGE_SEQUENCE_INTEREST );
|
|
718 |
|
|
719 |
if ( iController.IntegerSettingValue(ECamSettingItemPhotoEditorSupport) != ECamNoEditorSupport )
|
|
720 |
{
|
|
721 |
iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU,
|
|
722 |
R_CAM_SET_AS_CALL_IMAGE_INTEREST_EDITOR );
|
|
723 |
}
|
|
724 |
else
|
|
725 |
{
|
|
726 |
iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU,
|
|
727 |
R_CAM_SET_AS_CALL_IMAGE_INTEREST );
|
|
728 |
}
|
|
729 |
|
|
730 |
iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU,
|
|
731 |
R_CAM_SHARE_ON_OVI_INTEREST );
|
|
732 |
// SHARE_AIW
|
|
733 |
iAiwServiceHandler->AttachMenuL( R_CAM_BURST_THUMBNAIL_MENU,
|
|
734 |
R_CAM_AIW_VIEW_INTEREST );
|
|
735 |
|
|
736 |
static_cast<CCamAppUiBase*>( AppUi() )->PushDefaultNaviPaneL();
|
|
737 |
PERF_EVENT_END_L2( EPerfEventBurstThumbnailViewActivation );
|
|
738 |
PRINT( _L( "Camera <= CCamBurstThumbnailView::DoActivateL" ) );
|
|
739 |
OstTrace0( CAMERAAPP_PERFORMANCE_DETAIL, DUP1_CCAMBURSTTHUMBNAILVIEW_DOACTIVATEL, "e_CCamBurstThumbnailView_DoActivateL 0" );
|
|
740 |
}
|
|
741 |
|
|
742 |
// ---------------------------------------------------------------------------
|
|
743 |
// CCamBurstThumbnailView::DoDeactivate
|
|
744 |
// Deactivate this view
|
|
745 |
// ---------------------------------------------------------------------------
|
|
746 |
//
|
|
747 |
void CCamBurstThumbnailView::DoDeactivate()
|
|
748 |
{
|
|
749 |
PRINT( _L( "Camera => CCamBurstThumbnailView::DoDeactivateL" ) );
|
|
750 |
iGridModel->RemoveModelObserver( this, CCamBurstThumbnailGridModel::EModelEventDeleted |
|
|
751 |
CCamBurstThumbnailGridModel::EModelEventHighlight );
|
|
752 |
|
|
753 |
CCamPostCaptureViewBase::DoDeactivate();
|
|
754 |
|
|
755 |
// Must delete this last (after everything had a chance to de-register)
|
|
756 |
// also delete model if all images have been deleted
|
|
757 |
if ( iResetModelOnDeactivate || iController.BurstCaptureArray()->ImagesRemaining() == 0 )
|
|
758 |
{
|
|
759 |
PRINT( _L( "Camera: CCamBurstThumbnailView::DoDeactivateL resetting model on deactivate" ) );
|
|
760 |
delete iGridModel;
|
|
761 |
iGridModel = NULL;
|
|
762 |
}
|
|
763 |
PRINT( _L( "Camera <= CCamBurstThumbnailView::DoDeactivateL" ) );
|
|
764 |
}
|
|
765 |
|
|
766 |
|
|
767 |
// ---------------------------------------------------------------------------
|
|
768 |
// CCamBurstThumbnailView::HighlightChanged
|
|
769 |
// Called when the highlighted item in the grid view changes
|
|
770 |
// ---------------------------------------------------------------------------
|
|
771 |
//
|
|
772 |
void CCamBurstThumbnailView::HighlightChanged()
|
|
773 |
{
|
|
774 |
// Check title is correct as highlight may have changed
|
|
775 |
TRAPD( ignore, SetTitlePaneTextL() );
|
|
776 |
if ( ignore )
|
|
777 |
{
|
|
778 |
// Do nothing ( removes build warning )
|
|
779 |
}
|
|
780 |
}
|
|
781 |
|
|
782 |
|
|
783 |
// ---------------------------------------------------------------------------
|
|
784 |
// CCamBurstThumbnailView::ImagesDeleted
|
|
785 |
// Called when images have been deleted from the grid view
|
|
786 |
// ---------------------------------------------------------------------------
|
|
787 |
//
|
|
788 |
void CCamBurstThumbnailView::ImagesDeleted()
|
|
789 |
{
|
|
790 |
CCamAppUi* appUi = static_cast<CCamAppUi*>( iEikonEnv->AppUi() );
|
|
791 |
|
|
792 |
// inform the media gallery
|
|
793 |
TRAPD( ignore, appUi->HandleControllerEventL( ECamEventMediaFileChanged, KErrNone ) );
|
|
794 |
// Check there is still at least one image
|
|
795 |
if ( iGridModel->NoOfValidCells() == 0 )
|
|
796 |
{
|
|
797 |
iResetModelOnDeactivate = ETrue;
|
|
798 |
|
|
799 |
CAknToolbar* toolbar = Toolbar();
|
|
800 |
if (toolbar)
|
|
801 |
{
|
|
802 |
toolbar->SetToolbarVisibility( EFalse );
|
|
803 |
}
|
|
804 |
// Close thumbnail view, go back to Burst PreCapture
|
|
805 |
TRAP( ignore, HandleCommandL( EAknSoftkeyBack ) );
|
|
806 |
}
|
|
807 |
else
|
|
808 |
{
|
|
809 |
iGridModel->UpdateViewableGrid( EFalse );
|
|
810 |
}
|
|
811 |
}
|
|
812 |
|
|
813 |
// ---------------------------------------------------------------------------
|
|
814 |
// CCamViewBase::IsNewNameValidL
|
|
815 |
// Check if renaming to the given name is valid.
|
|
816 |
// ---------------------------------------------------------------------------
|
|
817 |
//
|
|
818 |
TBool
|
|
819 |
CCamBurstThumbnailView::IsNewNameValidL( const TDesC& aFilename )
|
|
820 |
{
|
|
821 |
TInt currentIndex = iGridModel->HighlightedGridIndex();
|
|
822 |
|
|
823 |
TInt i = 0;
|
|
824 |
TInt burstItemsCount = iGridModel->NoOfValidCells();
|
|
825 |
for ( i = 0; i < burstItemsCount; ++i )
|
|
826 |
{
|
|
827 |
TPtrC imageName = iGridModel->ImageName( i );
|
|
828 |
|
|
829 |
if ( i != currentIndex )
|
|
830 |
{
|
|
831 |
if ( CamUtility::CompareIgnoreCase( aFilename,
|
|
832 |
imageName ) )
|
|
833 |
{
|
|
834 |
// New name already exists on grid
|
|
835 |
return EFalse;
|
|
836 |
}
|
|
837 |
}
|
|
838 |
|
|
839 |
}
|
|
840 |
return ETrue;
|
|
841 |
}
|
|
842 |
|
|
843 |
|
|
844 |
// ---------------------------------------------------------------------------
|
|
845 |
// CCamBurstThumbnailView::CCamBurstThumbnailView
|
|
846 |
// C++ constructor
|
|
847 |
// ---------------------------------------------------------------------------
|
|
848 |
//
|
|
849 |
CCamBurstThumbnailView::CCamBurstThumbnailView( CCamAppController& aController )
|
|
850 |
: CCamPostCaptureViewBase( aController )
|
|
851 |
{
|
|
852 |
}
|
|
853 |
|
|
854 |
// ---------------------------------------------------------------------------
|
|
855 |
// CCamBurstThumbnailView::ConstructL
|
|
856 |
// Symbian OS 2nd phase constructor
|
|
857 |
// ---------------------------------------------------------------------------
|
|
858 |
//
|
|
859 |
void CCamBurstThumbnailView::ConstructL()
|
|
860 |
{
|
|
861 |
PRINT( _L("Camera => CCamBurstThumbnailView::ConstructL") );
|
|
862 |
|
|
863 |
BaseConstructL( R_CAM_BURST_THUMBNAIL_VIEW );
|
|
864 |
CCamPostCaptureViewBase::ConstructL();
|
|
865 |
|
|
866 |
PRINT( _L("Camera <= CCamBurstThumbnailView::ConstructL") );
|
|
867 |
}
|
|
868 |
|
|
869 |
// ---------------------------------------------------------------------------
|
|
870 |
// CCamBurstThumbnailView::CreateContainerL
|
|
871 |
// Create container control
|
|
872 |
// ---------------------------------------------------------------------------
|
|
873 |
//
|
|
874 |
void CCamBurstThumbnailView::CreateContainerL()
|
|
875 |
{
|
|
876 |
PRINT( _L("Camera => CCamBurstThumbnailView::CreateContainerL") );
|
|
877 |
CCamBurstThumbnailContainer* cont = new (ELeave) CCamBurstThumbnailContainer(
|
|
878 |
iController,
|
|
879 |
*this,
|
|
880 |
*iGridModel );
|
|
881 |
CleanupStack::PushL( cont );
|
|
882 |
cont->SetMopParent( this );
|
|
883 |
TRect screen;
|
|
884 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
|
|
885 |
cont->ConstructL( screen );
|
|
886 |
CleanupStack::Pop( cont );
|
|
887 |
iContainer = cont;
|
|
888 |
PRINT( _L("Camera <= CCamBurstThumbnailView::CreateContainerL") );
|
|
889 |
}
|
|
890 |
|
|
891 |
// ---------------------------------------------------------------------------
|
|
892 |
// CCamBurstThumbnailView::SetTitlePaneTextL
|
|
893 |
// Set the view's title text
|
|
894 |
// ---------------------------------------------------------------------------
|
|
895 |
//
|
|
896 |
void CCamBurstThumbnailView::SetTitlePaneTextL()
|
|
897 |
{
|
|
898 |
PRINT( _L("Camera => CCamBurstThumbnailView::SetTitlePaneTextL") );
|
|
899 |
// Do not want to set the title to the filename if it's shown in the application pane
|
|
900 |
_LIT(KSpaces, " ");
|
|
901 |
static_cast<CCamAppUi*>( iEikonEnv->AppUi() )->SetTitleL( KSpaces );
|
|
902 |
PRINT( _L("Camera <= CCamBurstThumbnailView::SetTitlePaneTextL") );
|
|
903 |
}
|
|
904 |
|
|
905 |
// ---------------------------------------------------------------------------
|
|
906 |
// CCamBurstThumbnailView::DoSendAsL
|
|
907 |
// Use SendUI to create a message containing burst thumbnails
|
|
908 |
// ---------------------------------------------------------------------------
|
|
909 |
//
|
|
910 |
void CCamBurstThumbnailView::DoSendAsL() const
|
|
911 |
{
|
|
912 |
PRINT( _L("Camera => CCamBurstThumbnailView::DoSendAsL") );
|
|
913 |
CCamAppUiBase* appUi = static_cast<CCamAppUiBase*>( AppUi() );
|
|
914 |
|
|
915 |
if ( !appUi->SendAsInProgress() )
|
|
916 |
{
|
|
917 |
appUi->SetSendAsInProgressL( ETrue );
|
|
918 |
CMessageData* messageData = CMessageData::NewLC();
|
|
919 |
|
|
920 |
TInt totalItems = iGridModel->NoOfImages();
|
|
921 |
TInt markedItems = iGridModel->NoOfMarkedImages();
|
|
922 |
|
|
923 |
if ( markedItems == 0 )
|
|
924 |
{
|
|
925 |
// if no images are marked use the highlighted item instead
|
|
926 |
messageData->AppendAttachmentL( iGridModel->ImageFileName(
|
|
927 |
iGridModel->HighlightedBurstIndex() ) );
|
|
928 |
}
|
|
929 |
else
|
|
930 |
{
|
|
931 |
// attach all marked items
|
|
932 |
TInt index = 0;
|
|
933 |
TInt found = 0;
|
|
934 |
while ( index < totalItems && found < markedItems )
|
|
935 |
{
|
|
936 |
if ( iGridModel->IsMarkedL( index ) )
|
|
937 |
{
|
|
938 |
found++;
|
|
939 |
messageData->AppendAttachmentL( iGridModel->ImageFileName( index ) );
|
|
940 |
}
|
|
941 |
index++;
|
|
942 |
}
|
|
943 |
}
|
|
944 |
|
|
945 |
TRAP_IGNORE( iSendAppUi->ShowQueryAndSendL( messageData, iSendingCapabilities ) )
|
|
946 |
|
|
947 |
appUi->SetSendAsInProgressL( EFalse );
|
|
948 |
CleanupStack::PopAndDestroy( messageData );
|
|
949 |
}
|
|
950 |
|
|
951 |
|
|
952 |
PRINT( _L("Camera <= CCamBurstThumbnailView::DoSendAsL") );
|
|
953 |
}
|
|
954 |
|
|
955 |
// ---------------------------------------------------------------------------
|
|
956 |
// CCamBurstThumbnailView::SingleSelectionGridIndexL()
|
|
957 |
// Returns the array index of the first marked item,
|
|
958 |
// or highlighted item if none marked.
|
|
959 |
// ---------------------------------------------------------------------------
|
|
960 |
//
|
|
961 |
TInt CCamBurstThumbnailView::SingleSelectionGridIndexL() const
|
|
962 |
{
|
|
963 |
TInt ret = KErrNotFound;
|
|
964 |
|
|
965 |
if( iGridModel->NoOfMarkedImages() == 0 )
|
|
966 |
{
|
|
967 |
ret = iGridModel->HighlightedGridIndex();
|
|
968 |
}
|
|
969 |
else
|
|
970 |
{
|
|
971 |
TInt totalItems = iGridModel->NoOfImages();
|
|
972 |
for( TInt index = 0; index < totalItems; index++ )
|
|
973 |
{
|
|
974 |
if ( iGridModel->IsMarkedL( index ) )
|
|
975 |
{
|
|
976 |
ret = index;
|
|
977 |
break;
|
|
978 |
}
|
|
979 |
}
|
|
980 |
}
|
|
981 |
|
|
982 |
return ret;
|
|
983 |
}
|
|
984 |
|
|
985 |
// ---------------------------------------------------------------------------
|
|
986 |
// CCamViewBase::IsBurstPostCapture
|
|
987 |
// Returns whether the view is a burst mode postcapture view
|
|
988 |
// ---------------------------------------------------------------------------
|
|
989 |
//
|
|
990 |
TBool CCamBurstThumbnailView::IsBurstPostCapture()
|
|
991 |
{
|
|
992 |
return ETrue;
|
|
993 |
}
|
|
994 |
|
|
995 |
// ---------------------------------------------------------------------------
|
|
996 |
// CCamViewBase::ImageFilesDeleted
|
|
997 |
// Notifies view that images files have been deleted outside of camera
|
|
998 |
// ---------------------------------------------------------------------------
|
|
999 |
//
|
|
1000 |
void CCamBurstThumbnailView::ImageFilesDeleted()
|
|
1001 |
{
|
|
1002 |
PRINT( _L("Camera => CCamBurstThumbnailView::ImageFilesDeleted") )
|
|
1003 |
if ( iGridModel )
|
|
1004 |
{
|
|
1005 |
iGridModel->ImageFilesDeleted();
|
|
1006 |
}
|
|
1007 |
PRINT( _L("Camera <= CCamBurstThumbnailView::ImageFilesDeleted") )
|
|
1008 |
}
|
|
1009 |
|
|
1010 |
|
|
1011 |
/*#ifndef __WINS__
|
|
1012 |
// ---------------------------------------------------------------------------
|
|
1013 |
// CCamBurstThumbnailView::DoInCallSendL
|
|
1014 |
// Handle send to caller functionality
|
|
1015 |
// ---------------------------------------------------------------------------
|
|
1016 |
//
|
|
1017 |
void CCamBurstThumbnailView::DoInCallSendL() const
|
|
1018 |
{
|
|
1019 |
// Ignore if more than one item marked
|
|
1020 |
if( iGridModel->NoOfMarkedImages() < 2 )
|
|
1021 |
{
|
|
1022 |
TInt index = SingleSelectionGridIndexL();
|
|
1023 |
if ( iSFIUtils && iSFIUtils->IsCLIValidL() && index >=0 )
|
|
1024 |
{
|
|
1025 |
iSFIUtils->SendMediaFileL( iGridModel->ImageFileName( index ) );
|
|
1026 |
}
|
|
1027 |
}
|
|
1028 |
}
|
|
1029 |
#endif // __WINS__*/
|
|
1030 |
|
|
1031 |
// ---------------------------------------------------------------------------
|
|
1032 |
// CCamBurstThumbnailView::CalculateThumbnailSize
|
|
1033 |
// Calculates the size of a single thumbnail based on the infromation
|
|
1034 |
// how many images are alltogether shown on the burst grid
|
|
1035 |
// ---------------------------------------------------------------------------
|
|
1036 |
//
|
|
1037 |
TSize CCamBurstThumbnailView::CalculateThumbnailSize( TInt aNumberOfBurstImages )
|
|
1038 |
{
|
|
1039 |
TSize thumb;
|
|
1040 |
TAknLayoutRect gridLayout;
|
|
1041 |
TAknLayoutRect cellLayout;
|
|
1042 |
TAknLayoutRect thumbLayout;
|
|
1043 |
|
|
1044 |
thumb.iHeight = 0;
|
|
1045 |
thumb.iWidth = 0;
|
|
1046 |
|
|
1047 |
if ( aNumberOfBurstImages <= KBurstGridDefaultThumbnails )
|
|
1048 |
{
|
|
1049 |
gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 1 ) );
|
|
1050 |
cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 1, 0, 0 ) );
|
|
1051 |
thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 0, 0, 0 ) );
|
|
1052 |
}
|
|
1053 |
else if ( aNumberOfBurstImages <= KBurstGridMaxVisibleThumbnails )
|
|
1054 |
{
|
|
1055 |
gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 3 ) );
|
|
1056 |
cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 3, 0, 0 ) );
|
|
1057 |
thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 1, 0, 0 ) );
|
|
1058 |
}
|
|
1059 |
else
|
|
1060 |
{
|
|
1061 |
gridLayout.LayoutRect( ClientRect(), AknLayoutScalable_Apps::grid_cam4_burst_pane( 5 ) );
|
|
1062 |
cellLayout.LayoutRect( gridLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane( 5, 0, 0 ) );
|
|
1063 |
thumbLayout.LayoutRect( cellLayout.Rect(), AknLayoutScalable_Apps::cell_cam4_burst_pane_g1( 2, 0, 0 ) );
|
|
1064 |
}
|
|
1065 |
|
|
1066 |
thumb.iHeight = thumbLayout.Rect().Height();
|
|
1067 |
thumb.iWidth = thumbLayout.Rect().Width();
|
|
1068 |
|
|
1069 |
return thumb;
|
|
1070 |
}
|
|
1071 |
|
|
1072 |
|
|
1073 |
void CCamBurstThumbnailView::DynInitAiwMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
|
|
1074 |
{
|
|
1075 |
|
|
1076 |
if ( aResourceId == R_CAM_BURST_THUMBNAIL_MENU )
|
|
1077 |
{
|
|
1078 |
if ( iAiwServiceHandler && iAiwServiceHandler->IsAiwMenu( aResourceId ) )
|
|
1079 |
{
|
|
1080 |
|
|
1081 |
CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL();
|
|
1082 |
TInt markedItems = iGridModel->NoOfMarkedImages();
|
|
1083 |
// If there are no images marked use the highlighted image
|
|
1084 |
|
|
1085 |
TCamOrientation orientation = static_cast<CCamAppUiBase*>( AppUi() )->CamOrientation();
|
|
1086 |
|
|
1087 |
if ( markedItems == 0 )
|
|
1088 |
{
|
|
1089 |
TAiwVariant variant( iGridModel->ImageFileName(
|
|
1090 |
iGridModel->HighlightedBurstIndex() ) );
|
|
1091 |
TAiwGenericParam param( EGenericParamFile, variant );
|
|
1092 |
paramList.AppendL( param );
|
|
1093 |
|
|
1094 |
// Set as contact call image needs image MIME type as AIW param
|
|
1095 |
//if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft )
|
|
1096 |
{
|
|
1097 |
TAiwVariant variant2( KCamImageMimeType );
|
|
1098 |
TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
|
|
1099 |
paramList.AppendL( param2 );
|
|
1100 |
}
|
|
1101 |
|
|
1102 |
}
|
|
1103 |
else if ( markedItems == 1 )
|
|
1104 |
{
|
|
1105 |
TInt totalItems = iGridModel->NoOfImages();
|
|
1106 |
TInt index = 0;
|
|
1107 |
while ( index < totalItems )
|
|
1108 |
{
|
|
1109 |
if ( iGridModel->IsMarkedL( index ) )
|
|
1110 |
{
|
|
1111 |
|
|
1112 |
TAiwVariant variant( iGridModel->ImageFileName( index ) );
|
|
1113 |
TAiwGenericParam param( EGenericParamFile, variant );
|
|
1114 |
paramList.AppendL( param );
|
|
1115 |
|
|
1116 |
//if ( orientation == ECamOrientationCamcorder || orientation == ECamOrientationCamcorderLeft )
|
|
1117 |
{
|
|
1118 |
TAiwVariant variant2( KCamImageMimeType );
|
|
1119 |
TAiwGenericParam param2( EGenericParamMIMEType, variant2 );
|
|
1120 |
paramList.AppendL( param2 );
|
|
1121 |
}
|
|
1122 |
|
|
1123 |
break;
|
|
1124 |
}
|
|
1125 |
index++;
|
|
1126 |
}
|
|
1127 |
}
|
|
1128 |
else // there are more than on marked item
|
|
1129 |
{
|
|
1130 |
// removing lint warning
|
|
1131 |
}
|
|
1132 |
|
|
1133 |
iAiwServiceHandler->InitializeMenuPaneL(
|
|
1134 |
*aMenuPane,
|
|
1135 |
aResourceId,
|
|
1136 |
ECamCmdAIWCommands,
|
|
1137 |
paramList );
|
|
1138 |
}
|
|
1139 |
|
|
1140 |
}
|
|
1141 |
|
|
1142 |
}
|
|
1143 |
|
|
1144 |
// ---------------------------------------------------------------------------
|
|
1145 |
// Dim 1-click upload button if more than one image is marked
|
|
1146 |
// ---------------------------------------------------------------------------
|
|
1147 |
//
|
|
1148 |
void CCamBurstThumbnailView::UpdateOneClickUploadButton()
|
|
1149 |
{
|
|
1150 |
CAknToolbar* toolbar = Toolbar();
|
|
1151 |
if( toolbar && iGridModel )
|
|
1152 |
{
|
|
1153 |
TBool shouldBeDimmed = ( iGridModel->NoOfMarkedImages() > 1 );
|
|
1154 |
|
|
1155 |
CAknButton* button = static_cast<CAknButton*>(
|
|
1156 |
toolbar->ControlOrNull( ECamCmdOneClickUpload ) );
|
|
1157 |
|
|
1158 |
if ( button )
|
|
1159 |
{
|
|
1160 |
TBool isDimmed = button->IsDimmed();
|
|
1161 |
if ( ( shouldBeDimmed && !isDimmed ) ||
|
|
1162 |
( !shouldBeDimmed && isDimmed ) )
|
|
1163 |
{
|
|
1164 |
button->SetDimmed( shouldBeDimmed );
|
|
1165 |
button->DrawDeferred();
|
|
1166 |
}
|
|
1167 |
}
|
|
1168 |
}
|
|
1169 |
}
|
|
1170 |
|
|
1171 |
|
|
1172 |
// End of File
|