photosgallery/viewframework/views/metadatadialog/src/glxmetadatadialog.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 15 191387a8b767
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
    26 #include <eikmenub.h>                   // for CEikMenuBar
    26 #include <eikmenub.h>                   // for CEikMenuBar
    27 #include <StringLoader.h>
    27 #include <StringLoader.h>
    28 #include <akntoolbar.h>
    28 #include <akntoolbar.h>
    29 #include <glxcommandhandleraddtocontainer.h>         // For CGlxCommandHandlerAddToContainer
    29 #include <glxcommandhandleraddtocontainer.h>         // For CGlxCommandHandlerAddToContainer
    30 #include <aknphysics.h> // For Kinetic Scrolling
    30 #include <aknphysics.h> // For Kinetic Scrolling
       
    31 #include <eikdialogext.h>
    31 
    32 
    32 //User includes
    33 //User includes
    33 #include <glxmetadatadialog.rsg>
    34 #include <glxmetadatadialog.rsg>
    34 #include <glxresourceutilities.h>
    35 #include <glxresourceutilities.h>
    35 #include <glxlog.h>
    36 #include <glxlog.h>
    52 
    53 
    53 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    54 // NewL
    55 // NewL
    55 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    56 //
    57 //
    57 EXPORT_C CGlxMetadataDialog* CGlxMetadataDialog::NewL( const TDesC& aUri  )
    58 EXPORT_C CGlxMetadataDialog* CGlxMetadataDialog::NewL(const TDesC& aUri)
    58 	{
    59     {
    59 	TRACER("CGlxMetadataDialog::NewL");
    60     TRACER("CGlxMetadataDialog::NewL");
    60 	
    61 
    61 	CGlxMetadataDialog* self = new(ELeave) CGlxMetadataDialog(aUri );
    62     CGlxMetadataDialog* self = new (ELeave) CGlxMetadataDialog(aUri);
    62 	CleanupStack::PushL( self );
    63     CleanupStack::PushL(self);
    63 	self->ConstructL();
    64     self->ConstructL();
    64 	CleanupStack::Pop( self );
    65     CleanupStack::Pop(self);
    65 	return self;
    66     return self;
    66 	}
    67     }
    67 
    68 
    68 CGlxMetadataDialog::CGlxMetadataDialog(const TDesC& aUri):iUri(aUri)
    69 CGlxMetadataDialog::CGlxMetadataDialog(const TDesC& aUri) :
    69 {
    70     iUri(aUri)
    70 
    71     {
    71 }
    72     }
       
    73 
    72 // -----------------------------------------------------------------------------
    74 // -----------------------------------------------------------------------------
    73 // ConstructL
    75 // ConstructL
    74 // -----------------------------------------------------------------------------
    76 // -----------------------------------------------------------------------------
    75 //
    77 //
    76 void CGlxMetadataDialog::ConstructL()
    78 void CGlxMetadataDialog::ConstructL()
    77 	{
    79 	{
    78 	TRACER("CGlxMetadataDialog::ConstructL");
    80     TRACER("CGlxMetadataDialog::ConstructL");
    79 
    81 
    80 	// Load dialog's resource file
    82     // Load dialog's resource file
    81 	InitResourceL();
    83     InitResourceL();
    82 
    84 
    83 	iStatusPaneAvailable = EFalse;
    85     iStatusPaneAvailable = EFalse;
    84 	// set the title to the dialog, Note that avkon dialogs do not support
    86     // set the title to the dialog, Note that avkon dialogs do not support
    85 	// setting the title in the status pane so we need to do it the hard way
    87     // setting the title in the status pane so we need to do it the hard way
    86 	// get status pane
    88     // get status pane
    87 	CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
    89     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
    88 
    90 
    89 	if (statusPane && statusPane->IsVisible())
    91     if (statusPane && statusPane->IsVisible())
    90 		{
    92         {
    91 		iStatusPaneAvailable = ETrue;
    93         iStatusPaneAvailable = ETrue;
    92 		}
    94         }
    93 
    95 
    94 	// make the toolbar disabled
    96     // make the toolbar disabled
    95 	SetDetailsDlgToolbarVisibility(EFalse);
    97     SetDetailsDlgToolbarVisibility(EFalse);
    96 
    98 
    97 	// do we have status pane
    99     // do we have status pane
    98 	if (statusPane)
   100     if (statusPane)
    99 		{
   101         {
   100 		GLX_LOG_INFO1("GLX_UMP::CGlxMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible());
   102         GLX_LOG_INFO1("GLX_UMP::CGlxMetadataDialog::ConstructL::STATUS PANE = %d",statusPane->IsVisible());
   101 		// load the title text
   103         // load the title text
   102 		HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS,
   104         HBufC* text = StringLoader::LoadL(R_GLX_METADATA_VIEW_TITLE_DETAILS,
   103 				iEikonEnv );
   105                 iEikonEnv);
   104 		SetTitleL(*text);
   106         SetTitleL(*text);
   105 		if (text)
   107         if (text)
   106 			{
   108             {
   107 			delete text;
   109             delete text;
   108 			}
   110             }
   109 		iAvkonAppUi->StatusPane()->MakeVisible(ETrue);
   111         iAvkonAppUi->StatusPane()->MakeVisible(ETrue);
   110 		}
   112         }
   111 
   113 
   112 	iUiUtility = CGlxUiUtility::UtilityL();
   114     iUiUtility = CGlxUiUtility::UtilityL();
   113 	TFileName uiutilitiesrscfile;
   115     TFileName uiutilitiesrscfile;
   114 	uiutilitiesrscfile.Append(CGlxResourceUtilities::GetUiUtilitiesResourceFilenameL());
   116     uiutilitiesrscfile.Append(
   115 
   117             CGlxResourceUtilities::GetUiUtilitiesResourceFilenameL());
   116 	iAddToTag = CGlxCommandHandlerAddToContainer::NewL(this, EGlxCmdAddTag,
   118 
   117 			EFalse, uiutilitiesrscfile);
   119     iAddToTag = CGlxCommandHandlerAddToContainer::NewL(this, EGlxCmdAddTag,
   118 	iAddToAlbum = CGlxCommandHandlerAddToContainer::NewL(this,
   120             EFalse, uiutilitiesrscfile);
   119 			EGlxCmdAddToAlbum, EFalse, uiutilitiesrscfile);
   121     iAddToAlbum = CGlxCommandHandlerAddToContainer::NewL(this,
   120 
   122             EGlxCmdAddToAlbum, EFalse, uiutilitiesrscfile);
   121 	// Call the base class' two-phased constructor
   123 
   122 	CAknDialog::ConstructL(R_METADATA_MENUBAR);
   124     // Call the base class' two-phased constructor
   123 
   125     CAknDialog::ConstructL(R_METADATA_MENUBAR);
   124 	// Instantiate the command handler
   126 
   125 	iMetadataCmdHandler = CGlxMetadataCommandHandler::NewL(this);
   127     // Instantiate the command handler
   126 
   128     iMetadataCmdHandler = CGlxMetadataCommandHandler::NewL(this);
   127 	//steps to find kinetic scroll threshold value
   129 
   128 	CAknPhysics* physics = CAknPhysics::NewL(*this, NULL);
   130     //steps to find kinetic scroll threshold value
   129 	CleanupStack::PushL(physics);
   131     CAknPhysics* physics = CAknPhysics::NewL(*this, NULL);
   130 	iKineticDragThreshold = physics->DragThreshold();
   132     CleanupStack::PushL(physics);
   131 	CleanupStack::PopAndDestroy(physics);
   133     iKineticDragThreshold = physics->DragThreshold();
   132 	physics = NULL;
   134     CleanupStack::PopAndDestroy(physics);
   133 	}
   135     physics = NULL;
       
   136     }
   134 
   137 
   135 // -----------------------------------------------------------------------------
   138 // -----------------------------------------------------------------------------
   136 // ~CGlxMetadataDialog
   139 // ~CGlxMetadataDialog
   137 // -----------------------------------------------------------------------------
   140 // -----------------------------------------------------------------------------
   138 //
   141 //
   215     {
   218     {
   216     TRACER("CGlxMetadataDialog::MediaList");    
   219     TRACER("CGlxMetadataDialog::MediaList");    
   217     // return the refernce of media list
   220     // return the refernce of media list
   218     return iContainer->MediaList();
   221     return iContainer->MediaList();
   219     }
   222     }
       
   223  
   220 // -----------------------------------------------------------------------------
   224 // -----------------------------------------------------------------------------
   221 // ProcessCommandL
   225 // ProcessCommandL
   222 // -----------------------------------------------------------------------------
   226 // -----------------------------------------------------------------------------
   223 //
   227 //
   224 void CGlxMetadataDialog::ProcessCommandL( TInt aCommandId )
   228 void CGlxMetadataDialog::ProcessCommandL( TInt aCommandId )
   225 	{
   229 	{
   226 	TRACER("CGlxMetadataDialog::ProcessCommandL");
   230     TRACER("CGlxMetadataDialog::ProcessCommandL");
   227 	
   231 
   228 	// hide menu bar
   232     // hide menu bar
   229 	iMenuBar->StopDisplayingMenuBar();
   233     iMenuBar->StopDisplayingMenuBar();
   230 
   234 
   231 	switch( aCommandId )
   235     switch (aCommandId)
   232 		{
   236         {
   233 		case EAknSoftkeyEdit:
   237         case EAknSoftkeyEdit:
   234 		case EAknSoftkeyCancel:
   238         case EAknSoftkeyCancel:
   235 		case EAknSoftkeySelect:
   239         case EAknSoftkeySelect:
   236 		case EAknSoftkeyOk:
   240         case EAknSoftkeyOk:
   237 			{
   241             {
   238 			TryExitL( aCommandId );
   242             TryExitL(aCommandId);
   239 			break;
   243             break;
   240 			}
   244             }
   241 
   245 
   242 		case EAknCmdHelp:
   246         case EAknCmdHelp:
   243 			{
   247             {
   244 			TCoeHelpContext helpContext;
   248             TCoeHelpContext helpContext;
   245 			helpContext.iMajor = TUid::Uid( KGlxGalleryApplicationUid );
   249             helpContext.iMajor = TUid::Uid(KGlxGalleryApplicationUid);
   246 			helpContext.iContext.Copy( LGAL_HLP_DETAILS_VIEW );
   250             helpContext.iContext.Copy(LGAL_HLP_DETAILS_VIEW);
   247 			const TInt KListSz = 1;
   251             const TInt KListSz = 1;
   248 			CArrayFix<TCoeHelpContext>* contextList =
   252             CArrayFix<TCoeHelpContext>* contextList =
   249 			new (ELeave) CArrayFixFlat<TCoeHelpContext>( KListSz );
   253                     new (ELeave) CArrayFixFlat<TCoeHelpContext> (KListSz);
   250 			CleanupStack::PushL(contextList);
   254             CleanupStack::PushL(contextList);
   251 			contextList->AppendL(helpContext);
   255             contextList->AppendL(helpContext);
   252 			HlpLauncher::LaunchHelpApplicationL(
   256             HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(),
   253 			iEikonEnv->WsSession(), contextList );
   257                     contextList);
   254 			CleanupStack::Pop( contextList );
   258             CleanupStack::Pop(contextList);
   255 			break;
   259             break;
   256 			}
   260             }
   257 		case KGlxDeleteBoundMenuCommandId:
   261         case KGlxDeleteBoundMenuCommandId:
   258 	    {
   262             {
   259 	    //Event passed on to container to handle	
   263             //Event passed on to container to handle	
   260       //Delete the location information of the data.	  
   264             //Delete the location information of the data.	  
   261 	    iContainer->RemoveLocationL();
   265             iContainer->RemoveLocationL();
   262 	    break;
   266             break;
   263 	    }	      
   267             }
   264 		case KGlxEditBoundMenuCommandId:
   268         case KGlxEditBoundMenuCommandId:
   265 		case KGlxViewBoundMenuCommandId:
   269         case KGlxViewBoundMenuCommandId:
   266 	    {
   270             {
   267 	    //To edit the details - forward the event to container to edit
   271             //To edit the details - forward the event to container to edit
   268   		//Both edit and view details command are handled in the same function based on the item.	
   272             //Both edit and view details command are handled in the same function based on the item.	
   269 	    iContainer->HandleListboxChangesL();
   273             iContainer->HandleListboxChangesL();
   270 	    break;
   274             break;
   271 	    }
   275             }
   272 		case EGlxCmdAiwBase:
   276         case EGlxCmdAiwBase:
   273 			{
   277             {
   274 			// pass aCommandId to command handler
   278             // pass aCommandId to command handler
   275 			iMetadataCmdHandler->DoExecuteL( aCommandId, MediaList() );
   279             iMetadataCmdHandler->DoExecuteL(aCommandId, MediaList());
   276 			}
   280             }
   277 		default:
   281         default:
   278 			break;
   282             break;
   279 		}
   283         }
   280 	}
   284     }
       
   285 
   281 //-----------------------------------------------------------------------------
   286 //-----------------------------------------------------------------------------
   282 // CGlxMetadataDialog::CreateCustomControlL
   287 // CGlxMetadataDialog::CreateCustomControlL
   283 //-----------------------------------------------------------------------------
   288 //-----------------------------------------------------------------------------
   284 SEikControlInfo CGlxMetadataDialog::CreateCustomControlL(TInt 
   289 SEikControlInfo CGlxMetadataDialog::CreateCustomControlL(TInt 
   285                                                                 aControlType)
   290                                                                 aControlType)
   286     {
   291     {
   287     GLX_LOG_INFO("CShwSlideshowSettingsDialog::CreateCustomControlL");
   292     TRACER("CGlxMetadataDialog::CreateCustomControlL");
   288     
   293     
   289     // create control info, no flags or trailer text set
   294     // create control info, no flags or trailer text set
   290     SEikControlInfo controlInfo;
   295     SEikControlInfo controlInfo;
   291     controlInfo.iControl        = NULL;
   296     controlInfo.iControl        = NULL;
   292     controlInfo.iTrailerTextId  = 0;
   297     controlInfo.iTrailerTextId  = 0;
   298         controlInfo.iControl = iContainer; // giving ownership   
   303         controlInfo.iControl = iContainer; // giving ownership   
   299         }
   304         }
   300     return controlInfo; // returns ownership of ItemList
   305     return controlInfo; // returns ownership of ItemList
   301     }
   306     }
   302 
   307 
   303 
       
   304 // -----------------------------------------------------------------------------
   308 // -----------------------------------------------------------------------------
   305 // CGlxMetadataDialog::OfferKeyEventL
   309 // CGlxMetadataDialog::OfferKeyEventL
   306 // -----------------------------------------------------------------------------
   310 // -----------------------------------------------------------------------------
   307 //
   311 //
   308 TKeyResponse CGlxMetadataDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
   312 TKeyResponse CGlxMetadataDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent,
   309                                                 TEventCode aType )
   313                                                 TEventCode aType )
   310 	{
   314 	{
   311 	TRACER("CGlxMetadataDialog::OfferKeyEventL");
   315     TRACER("CGlxMetadataDialog::OfferKeyEventL");
   312 	TKeyResponse response = EKeyWasNotConsumed;
   316     TKeyResponse response = EKeyWasNotConsumed;
   313 		switch(aKeyEvent.iCode)
   317     switch (aKeyEvent.iCode)
   314 			{
   318         {
   315 			case EKeyUpArrow:
   319         case EKeyUpArrow:
   316 			case EKeyDownArrow:
   320         case EKeyDownArrow:
   317 				{
   321             {
   318 				if(!iUiUtility->IsPenSupported())
   322             if (!iUiUtility->IsPenSupported())
   319 				    {
   323                 {
   320                         iContainer->ChangeMskL();
   324                 iContainer->ChangeMskL();
   321 				    }
   325                 }
   322 				iContainer->EnableMarqueingL();
   326             iContainer->EnableMarqueingL();
   323 				break;
   327             break;
   324 				}
   328             }
   325 			default:
   329         default:
   326 				break;
   330             break;
   327 			}
   331         }
   328     if ( response == EKeyWasNotConsumed )
   332     if (response == EKeyWasNotConsumed)
   329          {
   333         {
   330          // container didn't consume the key so try the base class
   334         // container didn't consume the key so try the base class
   331          // this is crucial as platform uses a key event to dismiss dialog
   335         // this is crucial as platform uses a key event to dismiss dialog
   332          // when a view changes to another. the base class also consumes all
   336         // when a view changes to another. the base class also consumes all
   333          // the keys we dont want to handle automatically as this is a 
   337         // the keys we dont want to handle automatically as this is a 
   334          // blocking dialog
   338         // blocking dialog
   335          response = CAknDialog::OfferKeyEventL( aKeyEvent, aType );
   339         response = CAknDialog::OfferKeyEventL(aKeyEvent, aType);
   336          }
   340         }
   337      return response;
   341     return response;
   338 	}
   342     }
   339 
   343 
   340 // -----------------------------------------------------------------------------
   344 // -----------------------------------------------------------------------------
   341 // CGlxMetadataDialog::DynInitMenuPaneL
   345 // CGlxMetadataDialog::DynInitMenuPaneL
   342 // -----------------------------------------------------------------------------
   346 // -----------------------------------------------------------------------------
   343 //
   347 //
   398 			break;
   402 			break;
   399 		}
   403 		}
   400 	return retVal;
   404 	return retVal;
   401 	}
   405 	}
   402 
   406 
   403 //-----------------------------------------------------------------------------
       
   404 // CGlxMetadataDialog::SizeChanged
       
   405 //-----------------------------------------------------------------------------
       
   406 void CGlxMetadataDialog::SizeChanged()
       
   407 	{
       
   408 	TRACER("CGlxMetadataDialog::SizeChanged");
       
   409   CAknDialog::SizeChanged();
       
   410 	}
       
   411 // -----------------------------------------------------------------------------
   407 // -----------------------------------------------------------------------------
   412 // CGlxMetadataDialog::InitResourceL
   408 // CGlxMetadataDialog::InitResourceL
   413 // -----------------------------------------------------------------------------
   409 // -----------------------------------------------------------------------------
   414 //
   410 //
   415 void CGlxMetadataDialog::InitResourceL()    
   411 void CGlxMetadataDialog::InitResourceL()    
   416 	{
   412 	{
   417 	TRACER("CGlxMetadataDialog::InitResourceL");
   413 	TRACER("CGlxMetadataDialog::InitResourceL");
   418 	
       
   419 	_LIT(KGlxMetadataDialogResource,"glxmetadatadialog.rsc");
   414 	_LIT(KGlxMetadataDialogResource,"glxmetadatadialog.rsc");
   420 	//add resource file
   415 	//add resource file
   421 	TParse parse;
   416 	TParse parse;
   422 	parse.Set(KGlxMetadataDialogResource, &KDC_APP_RESOURCE_DIR, NULL);
   417 	parse.Set(KGlxMetadataDialogResource, &KDC_APP_RESOURCE_DIR, NULL);
   423 	TFileName resourceFile;
   418 	TFileName resourceFile;
   424 	resourceFile.Append(parse.FullName()); 
   419 	resourceFile.Append(parse.FullName()); 
   425 	CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
   420 	CGlxResourceUtilities::GetResourceFilenameL(resourceFile);  
   426 	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   421 	iResourceOffset = CCoeEnv::Static()->AddResourceFileL(resourceFile);
   427 	}  
   422 	}  
   428 
   423 
   429 
       
   430 // -----------------------------------------------------------------------------
   424 // -----------------------------------------------------------------------------
   431 // CGlxMetadataDialog::HandleViewCommandL
   425 // CGlxMetadataDialog::HandleViewCommandL
   432 // -----------------------------------------------------------------------------
   426 // -----------------------------------------------------------------------------
   433 //    
   427 //    
   434 TBool CGlxMetadataDialog::HandleViewCommandL( TInt /*aCommand*/ )
   428 TBool CGlxMetadataDialog::HandleViewCommandL( TInt /*aCommand*/ )
   435 	{
   429 	{
   436 	TRACER("CGlxMetadataDialog::HandleViewCommandL");
   430 	TRACER("CGlxMetadataDialog::HandleViewCommandL");
   437 	return EFalse;
   431 	return EFalse;
   438 	}
   432 	}
   439 // ---------------------------------------------------------------------------
   433 
   440 // CGlxMetadataDialog::PreLayoutDynInitL
       
   441 // ---------------------------------------------------------------------------
       
   442 //
       
   443 void CGlxMetadataDialog::PreLayoutDynInitL()
       
   444 	{
       
   445 	// No Implementation
       
   446 	}
       
   447 	
       
   448 //-----------------------------------------------------------------------------
   434 //-----------------------------------------------------------------------------
   449 // CGlxMetadataDialog::PostLayoutDynInitL
   435 // CGlxMetadataDialog::PostLayoutDynInitL
   450 //-----------------------------------------------------------------------------
   436 //-----------------------------------------------------------------------------
   451 //
   437 //
   452 void CGlxMetadataDialog::PostLayoutDynInitL()
   438 void CGlxMetadataDialog::PostLayoutDynInitL()
   453 	{
   439     {
   454 	TRACER("CGlxMetadataDialog::PostLayoutDynInitL");
   440     TRACER("CGlxMetadataDialog::PostLayoutDynInitL");
   455 	if(!iUiUtility->IsPenSupported())
   441     if (!iUiUtility->IsPenSupported())
   456 		{
   442         {
   457 		iUiUtility->ScreenFurniture()->ModifySoftkeyIdL(CEikButtonGroupContainer::EMiddleSoftkeyPosition,
   443         iUiUtility->ScreenFurniture()->ModifySoftkeyIdL(
   458 															EAknSoftkeyEdit,R_GLX_METADATA_MSK_EDIT);	
   444                 CEikButtonGroupContainer::EMiddleSoftkeyPosition,
   459 		}		
   445                 EAknSoftkeyEdit, R_GLX_METADATA_MSK_EDIT);
   460 	}
   446         }
   461 
   447     }
   462 //-----------------------------------------------------------------------------
       
   463 // CGlxMetadataDialog::Draw
       
   464 //-----------------------------------------------------------------------------
       
   465 //
       
   466 void CGlxMetadataDialog::Draw( const TRect& /*aRect*/ ) const
       
   467 	{
       
   468 	TRACER("CGlxMetadataDialog::Draw");
       
   469     TRect rect;
       
   470     AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect);
       
   471 
       
   472 	// Get the standard graphics context
       
   473 	CWindowGc& gc = SystemGc();
       
   474 	gc.SetBrushColor(KRgbWhite);
       
   475 	gc.DrawRect(rect);
       
   476 	}
       
   477 
   448 
   478 //-----------------------------------------------------------------------------
   449 //-----------------------------------------------------------------------------
   479 // CGlxMetadataDialog::HandlePointerEventL
   450 // CGlxMetadataDialog::HandlePointerEventL
   480 //-----------------------------------------------------------------------------
   451 //-----------------------------------------------------------------------------
   481 //
   452 //
   482 void CGlxMetadataDialog::HandlePointerEventL(
   453 void CGlxMetadataDialog::HandlePointerEventL(
   483     const TPointerEvent& aPointerEvent)
   454     const TPointerEvent& aPointerEvent)
   484 	{
   455 	{
   485 
       
   486     TRACER("CGlxMetadataDialog::HandlePointerEventL");
   456     TRACER("CGlxMetadataDialog::HandlePointerEventL");
   487 
   457 
   488     //This has to be called first, as base class implementation sets the flag 
   458     //This has to be called first, as base class implementation sets the flag 
   489     // of settings dialog with EDisableMarquee 
   459     // of settings dialog with EDisableMarquee 
   490     CCoeControl::HandlePointerEventL( aPointerEvent );
   460     CCoeControl::HandlePointerEventL(aPointerEvent);
   491     
   461 
   492     //After the above call we can call our implementation to reset the marque 
   462     //After the above call we can call our implementation to reset the marque 
   493     // flag and start marqueeing if needed
   463     // flag and start marqueeing if needed
   494     if(aPointerEvent.iType == TPointerEvent::EButton1Down
   464     if (aPointerEvent.iType == TPointerEvent::EButton1Down
   495             || aPointerEvent.iType == TPointerEvent::EButton2Down
   465             || aPointerEvent.iType == TPointerEvent::EButton2Down
   496             || aPointerEvent.iType == TPointerEvent::EButton3Down
   466             || aPointerEvent.iType == TPointerEvent::EButton3Down
   497             || aPointerEvent.iType == TPointerEvent::EDrag)
   467             || aPointerEvent.iType == TPointerEvent::EDrag)
   498         {
   468         {
   499             if(aPointerEvent.iType != TPointerEvent::EDrag)
   469         if (aPointerEvent.iType != TPointerEvent::EDrag)
   500             {
   470             {
   501                 iViewDragged = EFalse;
   471             iViewDragged = EFalse;
   502             }
   472             }
   503             
   473 
   504             if(aPointerEvent.iType == TPointerEvent::EDrag)
   474         if (aPointerEvent.iType == TPointerEvent::EDrag)
   505             {
   475             {
   506                 TInt delta = iPrev.iY - aPointerEvent.iPosition.iY;
   476             TInt delta = iPrev.iY - aPointerEvent.iPosition.iY;
   507                 //Check for physics threshold, if not more than threshold, we can
   477             //Check for physics threshold, if not more than threshold, we can
   508                 //still continue marqueeing
   478             //still continue marqueeing
   509                 TInt deltaAbs = delta < 0 ? -delta : delta;
   479             TInt deltaAbs = delta < 0 ? -delta : delta;
   510                 if(!iViewDragged && deltaAbs >= iKineticDragThreshold)
   480             if (!iViewDragged && deltaAbs >= iKineticDragThreshold)
   511                     iViewDragged = ETrue;
   481                 {
   512             }
   482                 iViewDragged = ETrue;
   513             
   483                 }
   514             //This has to done at every above mentioned event, since the  
   484             }
   515             //disable marquee flag is set by base implementation, forcing 
   485 
   516             //us the need to reset it everytime.
   486         //This has to done at every above mentioned event, since the  
   517             if(!iViewDragged)
   487         //disable marquee flag is set by base implementation, forcing 
   518             {
   488         //us the need to reset it everytime.
   519                 iContainer->EnableMarqueingL();
   489         if (!iViewDragged)
   520             }
   490             {
   521         }
   491             iContainer->EnableMarqueingL();
   522     
   492             }
       
   493         }
       
   494 
   523     //record positions unless it is drag event
   495     //record positions unless it is drag event
   524     if(aPointerEvent.iType != TPointerEvent::EDrag)
   496     if (aPointerEvent.iType != TPointerEvent::EDrag)
   525         {
   497         {
   526         iPrev = aPointerEvent.iPosition;
   498         iPrev = aPointerEvent.iPosition;
   527         }
   499         }
   528 	}
   500     }
   529 
   501 
   530 // ---------------------------------------------------------------------------
   502 // ---------------------------------------------------------------------------
   531 // CGlxMetadataDialog::OnLocationEditL
   503 // CGlxMetadataDialog::OnLocationEditL
   532 // ---------------------------------------------------------------------------
   504 // ---------------------------------------------------------------------------
   533 //
   505 //
   536 	TRACER("CGlxMetadataDialog::OnLocationEditL");
   508 	TRACER("CGlxMetadataDialog::OnLocationEditL");
   537 	OkToExitL( EAknSoftkeyOptions );
   509 	OkToExitL( EAknSoftkeyOptions );
   538 	}
   510 	}
   539 	
   511 	
   540 // ---------------------------------------------------------------------------
   512 // ---------------------------------------------------------------------------
   541 // CGlxMetadataDialog::AddTag
   513 // CGlxMetadataDialog::AddTagL
   542 // ---------------------------------------------------------------------------
   514 // ---------------------------------------------------------------------------
   543 //
   515 //
   544 void CGlxMetadataDialog::AddTagL()
   516 void CGlxMetadataDialog::AddTagL()
   545 {
   517     {
       
   518     TRACER("CGlxMetadataDialog::AddTagL");    
   546     iAddToTag->ExecuteL(EGlxCmdAddTag);
   519     iAddToTag->ExecuteL(EGlxCmdAddTag);
   547 }
   520     }
   548 // ---------------------------------------------------------------------------
   521 
   549 // CGlxMetadataDialog::AddAlbum
   522 // ---------------------------------------------------------------------------
       
   523 // CGlxMetadataDialog::AddAlbumL
   550 // ---------------------------------------------------------------------------
   524 // ---------------------------------------------------------------------------
   551 //
   525 //
   552 void CGlxMetadataDialog::AddAlbumL()
   526 void CGlxMetadataDialog::AddAlbumL()
   553 {
   527     {
       
   528     TRACER("CGlxMetadataDialog::AddAlbumL");
   554     iAddToAlbum->ExecuteL(EGlxCmdAddToAlbum);
   529     iAddToAlbum->ExecuteL(EGlxCmdAddToAlbum);
   555 }
   530     }
       
   531 
       
   532 // ---------------------------------------------------------------------------
       
   533 // CGlxMetadataDialog::HandleItemRemovedL
       
   534 // ---------------------------------------------------------------------------
       
   535 //
       
   536 void CGlxMetadataDialog::HandleItemRemovedL()
       
   537     {
       
   538     TRACER("CGlxMetadataDialog::HandleItemRemovedL");
       
   539     Extension()->iPublicFlags.Set(CEikDialogExtension::EDelayedExit);
       
   540     ProcessCommandL(EAknSoftkeyCancel);
       
   541     Extension()->iPublicFlags.Clear(CEikDialogExtension::EDelayedExit);
       
   542     }
   556 
   543 
   557 // ---------------------------------------------------------------------------
   544 // ---------------------------------------------------------------------------
   558 // CGlxMetadataDialog::SetTitleL()
   545 // CGlxMetadataDialog::SetTitleL()
   559 // ---------------------------------------------------------------------------
   546 // ---------------------------------------------------------------------------
   560 void CGlxMetadataDialog::SetTitleL(const TDesC& aTitleText)
   547 void CGlxMetadataDialog::SetTitleL(const TDesC& aTitleText)
   561     {
   548     {
   562     TRACER("CGlxFetcherContainer::SetTitleL");
   549     TRACER("CGlxMetadataDialog::SetTitleL");
   563     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
   550     CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
   564     CleanupStack::PushL(statusPane);
   551     CleanupStack::PushL(statusPane);
   565     // get pointer to the default title pane control
   552     // get pointer to the default title pane control
   566     CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
   553     CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
   567             TUid::Uid( EEikStatusPaneUidTitle ));       
   554             TUid::Uid( EEikStatusPaneUidTitle ));       
   581 // ---------------------------------------------------------------------------
   568 // ---------------------------------------------------------------------------
   582 // CGlxMetadataDialog::SetPreviousTitleL
   569 // CGlxMetadataDialog::SetPreviousTitleL
   583 // ---------------------------------------------------------------------------
   570 // ---------------------------------------------------------------------------
   584 void CGlxMetadataDialog::SetPreviousTitleL()
   571 void CGlxMetadataDialog::SetPreviousTitleL()
   585     {
   572     {
   586     TRACER("CGlxFetcherContainer::SetPreviousTitleL");
   573     TRACER("CGlxMetadataDialog::SetPreviousTitleL");
   587     CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
   574     CEikStatusPane* prevStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
   588     CleanupStack::PushL(prevStatusPane);
   575     CleanupStack::PushL(prevStatusPane);
   589     CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL(
   576     CAknTitlePane* prevTitlePane = ( CAknTitlePane* )prevStatusPane->ControlL(
   590             TUid::Uid( EEikStatusPaneUidTitle ));       
   577             TUid::Uid( EEikStatusPaneUidTitle ));       
   591     CleanupStack::PushL(prevTitlePane);
   578     CleanupStack::PushL(prevTitlePane);
   595         prevTitlePane->SetTextL( *iPreviousTitle );
   582         prevTitlePane->SetTextL( *iPreviousTitle );
   596         }
   583         }
   597     CleanupStack::Pop(prevTitlePane);
   584     CleanupStack::Pop(prevTitlePane);
   598     CleanupStack::Pop(prevStatusPane);
   585     CleanupStack::Pop(prevStatusPane);
   599     }
   586     }
   600 // -----------------------------------------------------------------------------
       
   601 // CGlxMetadataDialog::HandleResourceChange
       
   602 // -----------------------------------------------------------------------------
       
   603 //
       
   604 void CGlxMetadataDialog::HandleResourceChange( TInt aType )
       
   605     {
       
   606     TRACER("CGlxMetadataDialog::HandleResourceChange");
       
   607     //Handle global resource changes, such as scalable UI or skin events and orientation change (override)
       
   608     CAknDialog::HandleResourceChange( aType );
       
   609     }
       
   610 
   587 
   611 // -----------------------------------------------------------------------------
   588 // -----------------------------------------------------------------------------
   612 // CGlxMetadataDialog::HandleToolbarResetting
   589 // CGlxMetadataDialog::HandleToolbarResetting
   613 // -----------------------------------------------------------------------------
   590 // -----------------------------------------------------------------------------
   614 //
   591 //
   615 void CGlxMetadataDialog::HandleToolbarResetting(TBool aVisible)
   592 void CGlxMetadataDialog::HandleToolbarResetting(TBool aVisible)
   616     {
   593     {
   617     TRACER("CGlxMetadataDialog::HandleToolbarResetting");
   594     TRACER("CGlxMetadataDialog::HandleToolbarResetting");
   618 
       
   619     CAknToolbar* popupToolbar = iAvkonAppUi->PopupToolbar();
   595     CAknToolbar* popupToolbar = iAvkonAppUi->PopupToolbar();
   620     if(popupToolbar)
   596     if(popupToolbar)
   621         {
   597         {
   622         popupToolbar->SetToolbarVisibility( !aVisible ); 
   598         popupToolbar->SetToolbarVisibility( !aVisible ); 
   623         popupToolbar->MakeVisible( !aVisible );
   599         popupToolbar->MakeVisible( !aVisible );
   633         toolbar->SetToolbarVisibility(aVisible);
   609         toolbar->SetToolbarVisibility(aVisible);
   634         toolbar->MakeVisible( aVisible );
   610         toolbar->MakeVisible( aVisible );
   635         }
   611         }
   636     }
   612     }
   637 
   613 
   638 void CGlxMetadataDialog::ViewPositionChanged( const TPoint& /*aNewPosition*/, TBool /*aDrawNow*/, TUint /*aFlags*/ )
   614 void CGlxMetadataDialog::ViewPositionChanged(const TPoint& /*aNewPosition*/,
       
   615         TBool /*aDrawNow*/, TUint /*aFlags*/)
   639     {
   616     {
   640     //Dummy implementation
   617     //Dummy implementation
   641     }
   618     }
   642    
   619    
   643 void CGlxMetadataDialog::PhysicEmulationEnded()
   620 void CGlxMetadataDialog::PhysicEmulationEnded()