photosgallery/viewframework/views/metadatadialog/src/glxmetadatacontainer.cpp
branchRCL_3
changeset 15 191387a8b767
parent 14 2dac0fdba72b
child 17 a60acebbbd9d
equal deleted inserted replaced
14:2dac0fdba72b 15:191387a8b767
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    29 #include  <glxcommandhandleraddtocontainer.h>     // For CGlxCommandHandlerAddToContainer
    29 #include  <glxcommandhandleraddtocontainer.h>     // For CGlxCommandHandlerAddToContainer
    30 #include  <glxcommandhandlers.hrh>                // for command handler id
    30 #include  <glxcommandhandlers.hrh>                // for command handler id
    31 #include  <glxcommandfactory.h>                   //for command factory
    31 #include  <glxcommandfactory.h>                   //for command factory
    32 #include  <mpxcommandgeneraldefs.h>               // Content ID identifying general category of content provided
    32 #include  <mpxcommandgeneraldefs.h>               // Content ID identifying general category of content provided
    33 #include  "mglxmetadatadialogobserver.h"
    33 #include  "mglxmetadatadialogobserver.h"
    34 #include  <glxtextentrypopup.h>    
    34 #include  <glxtextentrypopup.h>
    35 #include  <glxcollectionpluginall.hrh>
    35 #include  <glxcollectionpluginall.hrh>
    36 #include  <glxuistd.h>
    36 #include  <glxuistd.h>
    37 #include  <glxcollectionplugintags.hrh>       	  // tag collection plugin uid
    37 #include  <glxcollectionplugintags.hrh>       	  // tag collection plugin uid
    38 #include  <glxthumbnailattributeinfo.h>           // KGlxMediaIdThumbnail
    38 #include  <glxthumbnailattributeinfo.h>           // KGlxMediaIdThumbnail
    39 #include  <glxattributeretriever.h>               // CGlxAttributeReteiver
    39 #include  <glxattributeretriever.h>               // CGlxAttributeReteiver
    40 #include  <aknQueryControl.h>
    40 #include  <aknQueryControl.h>
    41 #include  <glxdrmutility.h>                       //For launching DRM details pane
    41 #include  <glxdrmutility.h>                       //For launching DRM details pane
    42 #include  <glxgeneraluiutilities.h>               // General utilties class definition
    42 #include  <glxgeneraluiutilities.h>               // General utilties class definition
    43 #include  <ExifModify.h>    
    43 #include  <ExifModify.h>
    44 #include  <glxuiutilities.rsg>                    //For CExifModify
    44 #include  <glxuiutilities.rsg>                    //For CExifModify
    45 #include  <mpxmediadrmdefs.h>
    45 #include  <mpxmediadrmdefs.h>
    46 #include  <glxfilterfactory.h>
    46 #include  <glxfilterfactory.h>
    47 #include  <caf/manager.h>						  //For Filesystem
    47 #include  <caf/manager.h>						  //For Filesystem
    48 
    48 
    63 // ============================ MEMBER FUNCTIONS ===============================
    63 // ============================ MEMBER FUNCTIONS ===============================
    64 
    64 
    65 // ---------------------------------------------------------
    65 // ---------------------------------------------------------
    66 // NewL
    66 // NewL
    67 // ---------------------------------------------------------
    67 // ---------------------------------------------------------
    68 //	
    68 //
    69 CGlxMetadataContainer* CGlxMetadataContainer::NewL( const TRect& aRect,
    69 CGlxMetadataContainer* CGlxMetadataContainer::NewL( const TRect& aRect,
    70                                                     MGlxMetadataDialogObserver& aDialogObserver,
    70                                                     MGlxMetadataDialogObserver& aDialogObserver,
    71                                                     const TDesC& item,MToolbarResetObserver& aResetToolbarObs)
    71                                                     const TDesC& item,MToolbarResetObserver& aResetToolbarObs)
    72 	{
    72 	{
    73 	TRACER("CGlxMetadataContainer::NewL");	
    73 	TRACER("CGlxMetadataContainer::NewL");
    74 	CGlxMetadataContainer* self = CGlxMetadataContainer::NewLC( aRect,
    74 	CGlxMetadataContainer* self = CGlxMetadataContainer::NewLC( aRect,
    75                                                                 aDialogObserver,item,aResetToolbarObs);
    75                                                                 aDialogObserver,item,aResetToolbarObs);
    76 	CleanupStack::Pop(self);
    76 	CleanupStack::Pop(self);
    77 	return self;
    77 	return self;
    78 	}
    78 	}
    79 
    79 
    80 // ---------------------------------------------------------
    80 // ---------------------------------------------------------
    81 // NewLC
    81 // NewLC
    82 // ---------------------------------------------------------
    82 // ---------------------------------------------------------
    83 //	
    83 //
    84 CGlxMetadataContainer* CGlxMetadataContainer::NewLC( const TRect& aRect,
    84 CGlxMetadataContainer* CGlxMetadataContainer::NewLC( const TRect& aRect,
    85 													 MGlxMetadataDialogObserver&  aDialogObserver,
    85 													 MGlxMetadataDialogObserver&  aDialogObserver,
    86 													 const TDesC& aUri,MToolbarResetObserver& aResetToolbarObs)
    86 													 const TDesC& aUri,MToolbarResetObserver& aResetToolbarObs)
    87 	{
    87 	{
    88 	TRACER("CGlxMetadataContainer::NewLC");	
    88 	TRACER("CGlxMetadataContainer::NewLC");
    89 	CGlxMetadataContainer* self = new(ELeave) CGlxMetadataContainer(aDialogObserver,aUri,aResetToolbarObs);
    89 	CGlxMetadataContainer* self = new(ELeave) CGlxMetadataContainer(aDialogObserver, aResetToolbarObs);
    90 	CleanupStack::PushL(self);
    90 	CleanupStack::PushL(self);
    91 	self->ConstructL( aRect);
    91 	self->ConstructL( aRect, aUri);
    92 	return self;
    92 	return self;
    93 	}
    93 	}
    94 
    94 
    95 // ---------------------------------------------------------
    95 // ---------------------------------------------------------
    96 // CGlxMetadataContainer
    96 // CGlxMetadataContainer
    97 // ---------------------------------------------------------
    97 // ---------------------------------------------------------
    98 //	
    98 //
    99 CGlxMetadataContainer::CGlxMetadataContainer(MGlxMetadataDialogObserver& aDialogObserver,
    99 CGlxMetadataContainer::CGlxMetadataContainer(MGlxMetadataDialogObserver& aDialogObserver,
   100                                               const TDesC& aUri,MToolbarResetObserver& aResetToolbarObs)
   100                                               MToolbarResetObserver& aResetToolbarObs)
   101 					  :iDialogObesrver ( aDialogObserver ),iUri(aUri),iResetToolbarObs(aResetToolbarObs)
   101 					  :iDialogObesrver ( aDialogObserver ),iResetToolbarObs(aResetToolbarObs)
   102     {
   102     {
   103     // No implementation
   103     // No implementation
   104     }
   104     }
   105 
   105 
   106 // ---------------------------------------------------------
   106 // ---------------------------------------------------------
   107 // CGlxMetadataContainer::ConstructL
   107 // CGlxMetadataContainer::ConstructL
   108 // ---------------------------------------------------------
   108 // ---------------------------------------------------------
   109 //	
   109 //
   110 void CGlxMetadataContainer::ConstructL( const TRect& /*aRect*/ )
   110 void CGlxMetadataContainer::ConstructL( const TRect& /*aRect*/ , const TDesC& aUri)
   111 	{	
   111 	{
       
   112 
       
   113 	//media's uri
       
   114 	iUri = aUri.AllocL();
       
   115 
   112 	//Creating the RBuf texts for all the items except tags & albums
   116 	//Creating the RBuf texts for all the items except tags & albums
   113 	//which would be updated as whne the item is edited
   117 	//which would be updated as whne the item is edited
   114 	iTextSetter.CreateL(KMaxFileName);
   118 	iTextSetter.CreateL(KMaxFileName);
   115 	
   119 
   116 	//RBuf text which would be updated as when a tag is edited for the item.
   120 	//RBuf text which would be updated as when a tag is edited for the item.
   117 	iTagSetter.CreateL(KMaxFileName);
   121 	iTagSetter.CreateL(KMaxFileName);
   118 	
   122 
   119 	//RBuf text which would be updated as when a album is edited for the item.
   123 	//RBuf text which would be updated as when a album is edited for the item.
   120 	iAlbumSetter.CreateL(KMaxFileName);
   124 	iAlbumSetter.CreateL(KMaxFileName);
   121 	
   125 
   122 	//Create medialist filtered by uri - iUri
   126 	//Create medialist filtered by uri - iUri
   123 	CreateMediaListForSelectedItemL();
   127 	CreateMediaListForSelectedItemL();
   124 	
   128 
   125 	//Setting the iVideo flag to EFalse initially	
   129 	//Setting the iVideo flag to EFalse initially
   126 	iVideo = EFalse;
   130 	iVideo = EFalse;
   127 	
   131 
   128 	//Setting the iMarquee flag to EFalse initially
   132 	//Setting the iMarquee flag to EFalse initially
   129     iMarquee = EFalse;
   133     iMarquee = EFalse;
   130     
   134 
   131     //check when Remove location information is selected.
   135     //check when Remove location information is selected.
   132     iLocationinfo = EFalse;
   136     iLocationinfo = EFalse;
   133     
   137 
   134 	//Creating a CGlxMetadataAsyncUpdate object
   138 	//Flag to indicate rename command is started
   135 	iAsyncRequest = CGlxMetadataAsyncUpdate::NewL(*this);
   139 	iRenameStarted = EFalse;
   136 	
   140 
   137 	//Initializing to NULL
       
   138 	iModifiedUri = NULL;	
       
   139 	
       
   140 	//Flag to check if rename is completed successfully.
       
   141 	iRenameCompleted = EFalse;
       
   142 	}
   141 	}
   143 
   142 
   144 // ---------------------------------------------------------
   143 // ---------------------------------------------------------
   145 // ~CGlxMetadataContainer
   144 // ~CGlxMetadataContainer
   146 // ---------------------------------------------------------
   145 // ---------------------------------------------------------
   147 //	
   146 //
   148 CGlxMetadataContainer::~CGlxMetadataContainer()
   147 CGlxMetadataContainer::~CGlxMetadataContainer()
   149 	{
   148 	{
   150 	TRACER("CGlxMetadataContainer::~CGlxMetadataContainer");
   149 	TRACER("CGlxMetadataContainer::~CGlxMetadataContainer");
   151 	if( iItemMediaList ) 
   150 	if( iItemMediaList )
   152 		{
   151 		{
   153 		iItemMediaList->RemoveContext(iMainListAttributecontext);
   152 		iItemMediaList->RemoveContext(iMainListAttributecontext);
   154 		iItemMediaList->RemoveMediaListObserver(this);
   153 		iItemMediaList->RemoveMediaListObserver(this);
   155 		iItemMediaList->Close();
   154 		iItemMediaList->Close();
   156 		iItemMediaList = NULL;  
   155 		iItemMediaList = NULL;
   157 		} 
   156 		}
   158     if ( iTagMediaList ) 
   157     if ( iTagMediaList )
   159 		{
   158 		{
   160 		iTagMediaList->RemoveContext(iTagContext);
   159 		iTagMediaList->RemoveContext(iTagContext);
   161 		iTagMediaList->RemoveMediaListObserver(this); 
   160 		iTagMediaList->RemoveMediaListObserver(this);
   162 		iTagMediaList->Close();
   161 		iTagMediaList->Close();
   163 		iTagMediaList = NULL;
   162 		iTagMediaList = NULL;
   164 		}
   163 		}
   165     if ( iAlbumMediaList ) 
   164     if ( iAlbumMediaList )
   166 		{
   165 		{
   167 		iAlbumMediaList->RemoveContext(iAlbumContext);
   166 		iAlbumMediaList->RemoveContext(iAlbumContext);
   168 		iAlbumMediaList->RemoveMediaListObserver(this); 
   167 		iAlbumMediaList->RemoveMediaListObserver(this);
   169 		iAlbumMediaList->Close();
   168 		iAlbumMediaList->Close();
   170 		iAlbumMediaList = NULL;
   169 		iAlbumMediaList = NULL;
   171 		}
   170 		}
   172     if( iTagContext )
   171     if( iTagContext )
   173 		{
   172 		{
   174         delete iTagContext;
   173         delete iTagContext;
   175         iTagContext = NULL;
   174         iTagContext = NULL;
   176 		}    
   175 		}
   177     if( iAlbumContext )
   176     if( iAlbumContext )
   178 		{
   177 		{
   179         delete iAlbumContext;
   178         delete iAlbumContext;
   180         iAlbumContext = NULL;
   179         iAlbumContext = NULL;
   181 		}
   180 		}
   182     if( iMainListAttributecontext )
   181     if( iMainListAttributecontext )
   183         {
   182         {
   184         delete iMainListAttributecontext;
   183         delete iMainListAttributecontext;
   185         iMainListAttributecontext = NULL;
   184         iMainListAttributecontext = NULL;
   186         }       
   185         }
   187     if( IsVisible() )
   186     if( IsVisible() )
   188 	    {
   187 	    {
   189 	    MakeVisible(EFalse);
   188 	    MakeVisible(EFalse);
   190 	    }
   189 	    }
   191     iTextSetter.Close();
   190     iTextSetter.Close();
   192     iTagSetter.Close();
   191     iTagSetter.Close();
   193     iAlbumSetter.Close();
   192     iAlbumSetter.Close();
   194     if(iAsyncRequest) 	
   193 
   195 	    {
   194 	if(iUri)
   196     	delete iAsyncRequest;
   195 		{
   197 	    }
   196 		delete iUri;
   198 	if(iModifiedUri)
   197 		iUri = NULL;
   199 		{
       
   200 		delete iModifiedUri;
       
   201 		}
   198 		}
   202 	}
   199 	}
   203 	
   200 
   204 //-----------------------------------------------------------------------------
   201 //-----------------------------------------------------------------------------
   205 // CGlxMetadataContainer::MediaList
   202 // CGlxMetadataContainer::MediaList
   206 //-----------------------------------------------------------------------------
   203 //-----------------------------------------------------------------------------
   207 MGlxMediaList& CGlxMetadataContainer::MediaList()
   204 MGlxMediaList& CGlxMetadataContainer::MediaList()
   208     {
   205     {
   209     //returns the active medialist.
   206     //returns the active medialist.
   210     return *iItemMediaList;    
   207     return *iItemMediaList;
   211     }
   208     }
   212     
   209 
   213 //-----------------------------------------------------------------------------
   210 //-----------------------------------------------------------------------------
   214 // CGlxMetadataContainer::CreateSettingItemL
   211 // CGlxMetadataContainer::CreateSettingItemL
   215 //-----------------------------------------------------------------------------
   212 //-----------------------------------------------------------------------------
   216 CAknSettingItem* CGlxMetadataContainer::CreateSettingItemL(TInt aResourceId)
   213 CAknSettingItem* CGlxMetadataContainer::CreateSettingItemL(TInt aResourceId)
   217     {
   214     {
   218     TRACER("CGlxMetadataContainer::CreateSettingItemL");      
   215     TRACER("CGlxMetadataContainer::CreateSettingItemL");
   219     CAknSettingItem* settingItem = NULL; // No need to push onto cleanup stack
   216     CAknSettingItem* settingItem = NULL; // No need to push onto cleanup stack
   220 	iTextSetter.Zero();
   217 	iTextSetter.Zero();
   221     
   218 
   222     //Creating a empty Settings list box which will  be populated with metadata in handleattributeavailable
   219     //Creating a empty Settings list box which will  be populated with metadata in handleattributeavailable
   223     
   220 
   224     switch(aResourceId)
   221     switch(aResourceId)
   225         {
   222         {
   226         case ENameItem:
   223         case ENameItem:
   227         case EDateAndTimeItem:
   224         case EDateAndTimeItem:
   228         case EDescriptionItem:
   225         case EDescriptionItem:
   229             {
   226             {
   230             settingItem = new (ELeave) CAknTextSettingItem( 
   227             settingItem = new (ELeave) CAknTextSettingItem(
   231                                              aResourceId, iTextSetter );
   228                                              aResourceId, iTextSetter );
   232 
   229 
   233             break;          
   230             break;
   234             }
   231             }
   235         case ETagsItem:
   232         case ETagsItem:
   236             {
   233             {
   237              iTagSetter.Copy(KGlxTextSetter);
   234              iTagSetter.Copy(KGlxTextSetter);
   238              settingItem = new (ELeave) CAknTextSettingItem(
   235              settingItem = new (ELeave) CAknTextSettingItem(
   239                                                              aResourceId, iTagSetter );
   236                                                              aResourceId, iTagSetter );
   240             break;          
   237             break;
   241             }
   238             }
   242         case EAlbumsItem:
   239         case EAlbumsItem:
   243             {            
   240             {
   244             iAlbumSetter.Copy(KGlxTextSetter);
   241             iAlbumSetter.Copy(KGlxTextSetter);
   245             settingItem = new (ELeave) CAknTextSettingItem( 
   242             settingItem = new (ELeave) CAknTextSettingItem(
   246                                                   aResourceId, iAlbumSetter );
   243                                                   aResourceId, iAlbumSetter );
   247             break;          
   244             break;
   248             }
   245             }
   249         case ELocationItem:
   246         case ELocationItem:
   250         case ESizeItem:            
   247         case ESizeItem:
   251         case EResolutionItem:
   248         case EResolutionItem:
   252             {
   249             {
   253             settingItem = new (ELeave) CAknTextSettingItem( 
   250             settingItem = new (ELeave) CAknTextSettingItem( 
   254                                                   aResourceId, iTextSetter );
   251                                                   aResourceId, iTextSetter );
   255             
   252             
   346 // CGlxMetadataContainer::HandleListboxChangesL
   343 // CGlxMetadataContainer::HandleListboxChangesL
   347 //-----------------------------------------------------------------------------
   344 //-----------------------------------------------------------------------------
   348 void CGlxMetadataContainer::HandleListboxChangesL()
   345 void CGlxMetadataContainer::HandleListboxChangesL()
   349     {
   346     {
   350     TRACER("CGlxMetadataContainer::HandleListboxChangesL");
   347     TRACER("CGlxMetadataContainer::HandleListboxChangesL");
   351     if(iItemMediaList->Count() == 0)
   348 
       
   349     //dont Edit Item's details if medialist is empty
       
   350     //OR Rename command is in progress
       
   351     if(iItemMediaList->Count() == 0 || iRenameStarted)
   352     	{
   352     	{
       
   353 		GLX_LOG_INFO("MediaList empty or Rename command started");
   353     	return;
   354     	return;
   354     	}
   355     	}
   355     
   356 
   356     TInt index = ListBox()->CurrentItemIndex();
   357     TInt index = ListBox()->CurrentItemIndex();
   357     
   358 
   358     switch(index)
   359     switch(index)
   359         {
   360         {
   360         case ENameItem:        
   361         case ENameItem:
   361         case EDescriptionItem:
   362         case EDescriptionItem:
   362             {
   363             {
   363             SetNameDescriptionL(index);
   364             SetNameDescriptionL(index);
   364             break;
   365             break;
   365             }
   366             }
   366         case ETagsItem:
   367         case ETagsItem:
   367 			{
   368 			{
   368 			//Set the focus of the item	
   369 			//Set the focus of the item
   369 			iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);
   370 			iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);
   370 			//Launch add to container commandhandler via dialog observer.
   371 			//Launch add to container commandhandler via dialog observer.
   371 			iDialogObesrver.AddTagL();
   372 			iDialogObesrver.AddTagL();
   372 			break;         
   373 			break;
   373 			}
   374 			}
   374         case EAlbumsItem:
   375         case EAlbumsItem:
   375 			{
   376 			{
   376 			//Set the focus of the item	
   377 			//Set the focus of the item
   377 			iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);
   378 			iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);
   378 			//Launch add to container commandhandler via dialog observer.
   379 			//Launch add to container commandhandler via dialog observer.
   379 			iDialogObesrver.AddAlbumL();
   380 			iDialogObesrver.AddAlbumL();
   380 			break;          
   381 			break;
   381 			}
   382 			}
   382 		case ELocationItem:
   383 		case ELocationItem:
   383 			{
   384 			{
   384 			// Get the Media Item
   385 			// Get the Media Item
   385 			const TGlxMedia& media = iItemMediaList->Item(0);    
   386 			const TGlxMedia& media = iItemMediaList->Item(0);
   386 			// Test to see if the Coordinate is Present
   387 			// Test to see if the Coordinate is Present
   387 			TCoordinate coordinate;
   388 			TCoordinate coordinate;
   388 			if( !media.GetCoordinate(coordinate) )
   389 			if( !media.GetCoordinate(coordinate) )
   389 				{
   390 				{
   390 				HBufC *noLocationBuf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION);
   391 				HBufC *noLocationBuf = StringLoader::LoadLC(R_GLX_METADATA_NOTE_INFO_NO_LOCATION);
   401 				break;
   402 				break;
   402 				}
   403 				}
   403 			}
   404 			}
   404         case ElicenseItem:
   405         case ElicenseItem:
   405 			{
   406 			{
   406 			//Create DRM utility
   407 		    const TGlxMedia& item = iItemMediaList->Item(0);
   407 			CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL();
   408 		    if( item.IsDrmProtected())
   408 			CleanupClosePushL(*drmUtility);
   409 		        {
   409 			drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri());
   410                 //Create DRM utility
   410 			CleanupStack::PopAndDestroy(drmUtility);
   411                 CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL();
   411 			}  
   412                 CleanupClosePushL(*drmUtility);
       
   413                 drmUtility->ShowDRMDetailsPaneL(item.Uri());
       
   414                 CleanupStack::PopAndDestroy(drmUtility);
       
   415 			    }
       
   416 			}
   412 			break;
   417 			break;
   413         default:
   418         default:
   414 			{
   419 			{
   415 			break;    
   420 			break;    
   416 			}
   421 			}
   417         }
   422         }
   418     }
   423     }
   419 //-----------------------------------------------------------------------------
   424 //-----------------------------------------------------------------------------
   420 // CGlxMetadataContainer::CreateMediaListForSelectedItemL
   425 // CGlxMetadataContainer::CreateMediaListForSelectedItemL
   421 //-----------------------------------------------------------------------------
   426 //-----------------------------------------------------------------------------
   422 void CGlxMetadataContainer::CreateMediaListForSelectedItemL(TBool aIsRename)
   427 void CGlxMetadataContainer::CreateMediaListForSelectedItemL( )
   423     {
   428     {
   424     TRACER("CGlxMetadataContainer::CreateMediaListForSelectedItemL");
   429     TRACER("CGlxMetadataContainer::CreateMediaListForSelectedItemL");
   425    
   430    
   426     //create the collection path for the medialist to be created
   431     //create the collection path for the medialist to be created
   427     CMPXCollectionPath* path = CMPXCollectionPath::NewL();
   432     CMPXCollectionPath* path = CMPXCollectionPath::NewL();
   428     CleanupStack::PushL( path );
   433     CleanupStack::PushL( path );
   429     //set the all collection path as the details dialog can be launched from any of the grid views and filter with URI
   434     //set the all collection path as the details dialog can be launched from any of the grid views and filter with URI
   430     path->AppendL(KGlxCollectionPluginAllImplementationUid);
   435     path->AppendL(KGlxCollectionPluginAllImplementationUid);
   431     //create the filter with the URI
   436     //create the filter with the URI
   432     CMPXFilter* filter = NULL;
   437     CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(*iUri);
   433     if(aIsRename)
   438 	CleanupStack::PushL( filter );
   434 	    {
   439     //create the medialist
   435 	    //create the filter with the modified URI after Rename happens
   440     iItemMediaList = MGlxMediaList::InstanceL(*path,TGlxHierarchyId(KMediaListId),filter);
   436 	    filter = TGlxFilterFactory::CreateURIFilterL(iModifiedUri->Des());
   441 
   437 	    }
       
   438 	else
       
   439 		{
       
   440 		filter  = TGlxFilterFactory::CreateURIFilterL(iUri);
       
   441 		}
       
   442     CleanupStack::PushL( filter );
       
   443     //create the medialist   
       
   444     iItemMediaList = MGlxMediaList::InstanceL(*path,TGlxHierarchyId(KMediaListId),filter);   
       
   445   
       
   446     //Add the attributes which are required to be displayed.
   442     //Add the attributes which are required to be displayed.
   447     iMainListAttributecontext = new (ELeave) CGlxAttributeContext(&iSelectionIterator);
   443     iMainListAttributecontext = new (ELeave) CGlxAttributeContext(&iSelectionIterator);
   448     iMainListAttributecontext->AddAttributeL(KMPXMediaDrmProtected);
   444     iMainListAttributecontext->AddAttributeL(KMPXMediaDrmProtected);
   449     iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralCategory);
   445     iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralCategory);
   450     iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralSize);
   446     iMainListAttributecontext->AddAttributeL(KMPXMediaGeneralSize);
   565         //Viewdetails option will be availble only for the license item
   561         //Viewdetails option will be availble only for the license item
   566         //Delete option will be available only for the location item	
   562         //Delete option will be available only for the location item	
   567         aMenuPane->SetItemDimmed(KGlxViewBoundMenuCommandId,IsLicenseItem());
   563         aMenuPane->SetItemDimmed(KGlxViewBoundMenuCommandId,IsLicenseItem());
   568         //location info will be enabled if the item has a location info
   564         //location info will be enabled if the item has a location info
   569 		aMenuPane->SetItemDimmed(KGlxDeleteBoundMenuCommandId,IsLocationItem());
   565 		aMenuPane->SetItemDimmed(KGlxDeleteBoundMenuCommandId,IsLocationItem());
   570         aMenuPane->SetItemDimmed(EGlxCmdAiwShowMap,IsLocationItem());
   566 		// Show on Map is no longer part of requirements and should not be shown in the 
       
   567 		// options menu. When show on map has to come back, replace the 'ETrue' below with 
       
   568 		// the function IsLocationItem. 
       
   569         aMenuPane->SetItemDimmed(EGlxCmdAiwShowMap,ETrue);
   571         }
   570         }
   572         
   571         
   573     
   572     
   574     }
   573     }
   575 // ----------------------------------------------------------------------------
   574 // ----------------------------------------------------------------------------
   785     //get the item handcle to be modified    	
   784     //get the item handcle to be modified    	
   786     CAknSettingItem* settingsitem = (*SettingItemArray())[aItem]; 
   785     CAknSettingItem* settingsitem = (*SettingItemArray())[aItem]; 
   787     HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength );
   786     HBufC* textBuf = HBufC::NewLC( KMaxMediaPopupTitleLength );
   788     (textBuf->Des()).Copy((settingsitem->SettingTextL()));
   787     (textBuf->Des()).Copy((settingsitem->SettingTextL()));
   789     TPtr textPtr = textBuf->Des();
   788     TPtr textPtr = textBuf->Des();
       
   789     //Remove preceeding & trailing spaces
       
   790     textPtr.Trim();
   790     TBuf<KMaxMediaPopupTitleLength> titleText(*textBuf);
   791     TBuf<KMaxMediaPopupTitleLength> titleText(*textBuf);
   791     HBufC *buf = NULL;
   792     HBufC *buf = NULL;
   792     if(aItem == ENameItem)
   793     if(aItem == ENameItem)
   793         {
   794         {
   794         buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_TITLE_NSERIES);
   795         buf = StringLoader::LoadLC(R_GLX_METADATA_VIEW_TITLE_NSERIES);
   809     //action upon selecting ok from the editor 
   810     //action upon selecting ok from the editor 
   810     if ( popup->ExecuteLD() == EEikBidOk )
   811     if ( popup->ExecuteLD() == EEikBidOk )
   811 		{
   812 		{
   812 		if(0 != (titleText.Compare(*textBuf)))
   813 		if(0 != (titleText.Compare(*textBuf)))
   813 			{
   814 			{
       
   815 			
       
   816 			TFileName fileName = ParseFileName(*textBuf);
       
   817 			//check If filename already exists
   814 			if ((aItem == ENameItem) &&
   818 			if ((aItem == ENameItem) &&
   815 					(BaflUtils::FileExists(ControlEnv()->FsSession(), ParseFileName(*textBuf))))
   819 					(BaflUtils::FileExists(ControlEnv()->FsSession(), fileName)))
   816 				{
   820 				{
   817 				//if changed title is same as existing one then showing the already use popup to user
   821 				//if changed title is same as existing one then showing the already use popup to user
   818 				HBufC* info = StringLoader::LoadLC(R_GLX_NAME_ALREADY_USED, *textBuf);
   822 				HBufC* info = StringLoader::LoadLC(R_GLX_NAME_ALREADY_USED, *textBuf);
   819 				GlxGeneralUiUtilities::ShowInfoNoteL(*info, ETrue);
   823 				GlxGeneralUiUtilities::ShowInfoNoteL(*info, ETrue);
   820 				CleanupStack::PopAndDestroy(info);
   824 				CleanupStack::PopAndDestroy(info);
   824 				//Modify the MDS and setting list only if the entry is different from previous Item value
   828 				//Modify the MDS and setting list only if the entry is different from previous Item value
   825                 iTextSetter.Zero();
   829                 iTextSetter.Zero();
   826 				iTextSetter.Copy(*textBuf);
   830 				iTextSetter.Copy(*textBuf);
   827 				EditItemL(aItem,EFalse);
   831 				EditItemL(aItem,EFalse);
   828 				iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item
   832 				iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);//set focus to first item
   829 				CMPXCollectionPath* path = iItemMediaList->PathLC();
   833 				
   830 				CMPXCommand* command = NULL;
       
   831 				//Create the glx command based on the item
       
   832 				if(aItem == ENameItem)
   834 				if(aItem == ENameItem)
   833 					{
   835 					{
   834 					command = TGlxCommandFactory::RenameCommandLC(settingsitem->SettingTextL(),
   836 					//indicate Rename command is started
   835 					                                                  *path);
   837 					iRenameStarted = ETrue;
       
   838 					//set Setting List Box to Dimmed status
       
   839 					SetDimmed(iRenameStarted);
       
   840 					
       
   841 					const TGlxMedia& media = iItemMediaList->Item(0);
       
   842 					ContentAccess::CManager *manager = ContentAccess::CManager::NewL();
       
   843 					CleanupStack::PushL(manager);
       
   844 					HBufC* modifiedName = fileName.AllocLC();
       
   845 					
       
   846 					//rename the media
       
   847 					TInt error = manager->RenameFile(media.Uri(), *modifiedName);
       
   848 					if(KErrNone == error)
       
   849 						{
       
   850 						//Redundant call But needed in case FileSystem is too slow 
       
   851 						//to notify MDS for updating title.
       
   852 						//Create the glx command for updating Title in MDS
       
   853 						CMPXCollectionPath* path = iItemMediaList->PathLC();
       
   854 						CMPXCommand* command = TGlxCommandFactory::RenameCommandLC(
       
   855 								settingsitem->SettingTextL(), *path);
       
   856 						command->SetTObjectValueL<TAny*> (
       
   857 								KMPXCommandGeneralSessionId,
       
   858 								static_cast<TAny*> (this));
       
   859 						//issue command to the medialist which further 
       
   860 						//calls data source to update MDS
       
   861 						iItemMediaList->CommandL(*command);
       
   862 						CleanupStack::PopAndDestroy(command);
       
   863 						CleanupStack::PopAndDestroy(path);
       
   864 						}
       
   865 					else
       
   866 						{
       
   867 						//Renaming commmand failed
       
   868 						iRenameStarted = EFalse;
       
   869 						//reset Setting Items to undim status
       
   870 						SetDimmed(iRenameStarted);
       
   871 						//Reset the EName Settings field
       
   872 						iTextSetter.Zero();
       
   873 						iTextSetter.Copy(media.Title());
       
   874 						EditItemL(ENameItem,EFalse);
       
   875 						
       
   876 						User::LeaveIfError(error);
       
   877 						}
       
   878 					CleanupStack::PopAndDestroy(modifiedName);
       
   879 					CleanupStack::PopAndDestroy(manager);
   836 					}
   880 					}
   837 				else
   881 				else
   838 					{
   882 					{
   839 					command = TGlxCommandFactory::SetDescriptionCommandLC(settingsitem->SettingTextL(),
   883 					//Create the glx command for changing description
   840 					                                          *path);
   884 					CMPXCollectionPath* path = iItemMediaList->PathLC();
       
   885 					CMPXCommand* command =
       
   886 							TGlxCommandFactory::SetDescriptionCommandLC(
       
   887 									settingsitem->SettingTextL(), *path);
       
   888 					command->SetTObjectValueL<TAny*> (
       
   889 							KMPXCommandGeneralSessionId,
       
   890 							static_cast<TAny*> (this));
       
   891 					//issue command to the medialist which further 
       
   892 					//calls data source to update MDS
       
   893 					iItemMediaList->CommandL(*command);
       
   894 					CleanupStack::PopAndDestroy(command);
       
   895 					CleanupStack::PopAndDestroy(path);
   841 					}
   896 					}
   842 				command->SetTObjectValueL<TAny*>(KMPXCommandGeneralSessionId, static_cast<TAny*>(this));
   897 				
   843 				//issue command to the medialist which further calls data source to update MDS
       
   844 				iItemMediaList->CommandL(*command);
       
   845 				CleanupStack::PopAndDestroy(command);
       
   846 				CleanupStack::PopAndDestroy(path);
       
   847 				}
   898 				}
   848 			}
   899 			}
   849 		}
   900 		}
   850     CleanupStack::PopAndDestroy( textBuf );
   901     CleanupStack::PopAndDestroy( textBuf );
   851     
   902     
   953         for (TInt i = aAttributes.Count() - 1; i >= 0; i--)
  1004         for (TInt i = aAttributes.Count() - 1; i >= 0; i--)
   954             {
  1005             {
   955             //set attributes to the items in the container
  1006             //set attributes to the items in the container
   956             SetAttributesL(aAttributes[i]);
  1007             SetAttributesL(aAttributes[i]);
   957             }
  1008             }
   958         if (iRenameCompleted)
  1009 
   959             {
  1010         //Here following 2 cases are handled:-
   960             iRenameCompleted = EFalse;
  1011         //1) Rename from Photos application or Post-Capture view
   961             iAvkonAppUi->ProcessCommandL(EGlxCmdRenameCompleted);
  1012         //- HandleAttributeavailable - new title & new uri at same time.
   962             }
  1013         //May come twice here since Redundant Rename CMD sent to MDS.
       
  1014         //2) Rename from Filemanager.
       
  1015         //- HandleAttributeavailable - new title & new uri at same time.
       
  1016         //Check if media's uri(i.e 'aModifiedUri') is different from 'iUri'
       
  1017         //i.e media is Renamed then Refesh Media list.
       
  1018         TMPXAttribute uriAttrib(KMPXMediaGeneralUri);
       
  1019         TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match );
       
  1020         TInt index = aAttributes.Find(uriAttrib, match);
       
  1021         if (KErrNotFound != index)
       
  1022         	{
       
  1023         	HBufC* modifiedUri = NULL;
       
  1024 			TGlxMedia item = iItemMediaList->Item(0);
       
  1025 			//Create the string convertor instance
       
  1026 			CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL();
       
  1027 			CleanupStack::PushL(stringConverter);
       
  1028 
       
  1029 			//fetch media uri
       
  1030 			stringConverter->AsStringL(item,aAttributes[index],0, modifiedUri );
       
  1031 			CleanupStack::PopAndDestroy(stringConverter);
       
  1032 
       
  1033 			//Check if media item was renamed
       
  1034 			if (modifiedUri && modifiedUri->Compare(*iUri) != 0)
       
  1035 				{
       
  1036 				//Set rename command as started since
       
  1037 				//Rename is also possible from File Manager
       
  1038 				iRenameStarted = ETrue;
       
  1039 				CleanupStack::PushL(modifiedUri);
       
  1040 				RefreshMediaListL(*modifiedUri);
       
  1041 				CleanupStack::PopAndDestroy(modifiedUri);
       
  1042 				}
       
  1043 			}
       
  1044 
   963         }
  1045         }
   964     
  1046     
   965     TMPXAttribute titleAttrib(KMPXMediaGeneralTitle);
  1047     TMPXAttribute titleAttrib(KMPXMediaGeneralTitle);
   966     TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match );
  1048     TIdentityRelation< TMPXAttribute > match ( &TMPXAttribute::Match );
   967 
  1049 
  1014         if(iItemMediaList->Count())
  1096         if(iItemMediaList->Count())
  1015 			{
  1097 			{
  1016 			TGlxMedia item = iItemMediaList->Item(0);
  1098 			TGlxMedia item = iItemMediaList->Item(0);
  1017 			CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL();
  1099 			CGlxUStringConverter* stringConverter = CGlxUStringConverter::NewL();
  1018 			CleanupStack::PushL(stringConverter );
  1100 			CleanupStack::PushL(stringConverter );
  1019 			for(TInt index = 0; index <= ElicenseItem ; index++)
  1101 			for(TInt index = 0; index <= EDurationItem ; index++)
  1020 				{
  1102 				{
  1021 				HBufC* string = NULL;               
  1103 				HBufC* string = NULL;               
  1022                 iTextSetter.Zero();             
  1104                 iTextSetter.Zero();             
  1023   
  1105   
  1024 				if(index == ESizeItem)
  1106 				if(index == ESizeItem)
  1075 				CleanupStack::PushL( string );
  1157 				CleanupStack::PushL( string );
  1076 				EditItemL(index,EFalse);
  1158 				EditItemL(index,EFalse);
  1077 				CleanupStack::PopAndDestroy(string );
  1159 				CleanupStack::PopAndDestroy(string );
  1078 				}
  1160 				}
  1079 			CleanupStack::PopAndDestroy(stringConverter );
  1161 			CleanupStack::PopAndDestroy(stringConverter );
  1080 			}   
  1162 
       
  1163 			//Reopening Media list is completed
       
  1164 			//& Rename Command is also completed
       
  1165 			if(iRenameStarted)
       
  1166 				{
       
  1167 				iRenameStarted = EFalse;
       
  1168 				//reset Setting Items to undimmed status
       
  1169 				SetDimmed(iRenameStarted);
       
  1170 				iAvkonAppUi->ProcessCommandL(EGlxCmdRenameCompleted);
       
  1171 				}
       
  1172 			}
  1081         }
  1173         }
  1082     }
  1174     }
  1083 // ----------------------------------------------------------------------------
  1175 // ----------------------------------------------------------------------------
  1084 // EnableMarqueingL
  1176 // EnableMarqueingL
  1085 // ----------------------------------------------------------------------------
  1177 // ----------------------------------------------------------------------------
  1111 // 
  1203 // 
  1112 void CGlxMetadataContainer::HandleCommandCompleteL(TAny* aSessionId, 
  1204 void CGlxMetadataContainer::HandleCommandCompleteL(TAny* aSessionId, 
  1113         CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList)
  1205         CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList)
  1114     {
  1206     {
  1115     TRACER("CGlxMetadataContainer::HandleCommandCompleteL()");
  1207     TRACER("CGlxMetadataContainer::HandleCommandCompleteL()");
  1116     //To rename the uri in File System
  1208     
       
  1209     //Callback from MDS when rename the Title
  1117     if(aError == KErrNone)
  1210     if(aError == KErrNone)
  1118 		{
  1211 		{
  1119 		if(aList == iItemMediaList && aCommandResult->IsSupported(KMPXMediaGeneralTitle))
  1212 		if(aList == iItemMediaList && aCommandResult->IsSupported(KMPXMediaGeneralTitle))
  1120 			{
  1213 			{
  1121 			iItemMediaList->SetFocusL(NGlxListDefs::EAbsolute,0);
  1214 			GLX_LOG_INFO("RenameCMD to MDS completed");
  1122 			const TGlxMedia& media = iItemMediaList->Item(0);
  1215 			//Since RenameCommand to MDS is redundant and FileSystem has 
  1123 			ContentAccess::CManager *manager = ContentAccess::CManager::NewL();
  1216 			//already renamed the file, so there is no need to do anything here
  1124 			CleanupStack::PushL(manager);
  1217 			}
  1125 			TFileName fileName = ParseFileName(iTextSetter);
  1218 		}
  1126 			if(iModifiedUri)
  1219     
  1127 				{
       
  1128 				delete iModifiedUri;
       
  1129 				iModifiedUri = NULL;	
       
  1130 				}			
       
  1131 			iModifiedUri = fileName.AllocL();			
       
  1132 			iTextSetter.Zero();
       
  1133 			TInt error = manager->RenameFile(media.Uri(), iModifiedUri->Des());
       
  1134 			if(error == KErrNone)
       
  1135 				{
       
  1136 				iAsyncRequest->CompleteSelf();	
       
  1137 				}
       
  1138 			else
       
  1139 				{
       
  1140 				User::LeaveIfError(error);
       
  1141 				}		
       
  1142 			CleanupStack::PopAndDestroy(manager);
       
  1143 			}
       
  1144 		}
       
  1145     //To update the location information once the delete operation is successful.
  1220     //To update the location information once the delete operation is successful.
  1146     if(aList == iItemMediaList && iLocationinfo 
  1221     if(aList == iItemMediaList && iLocationinfo 
  1147             && static_cast<TAny*>( this ) == aSessionId)
  1222             && static_cast<TAny*>( this ) == aSessionId)
  1148 		{
  1223 		{
  1149 		TGlxMedia media = iItemMediaList->Item(0) ;
  1224 		TGlxMedia media = iItemMediaList->Item(0) ;
  1300 
  1375 
  1301 	return destinationFileName;
  1376 	return destinationFileName;
  1302 	}
  1377 	}
  1303 
  1378 
  1304 // ---------------------------------------------------------------------------
  1379 // ---------------------------------------------------------------------------
  1305 // Create new MediaList with modified FileName.
  1380 // Refresh MediaList with modified FileName.
  1306 // ---------------------------------------------------------------------------
  1381 // ---------------------------------------------------------------------------
  1307 void CGlxMetadataContainer::RefreshMediaListL()
  1382 void CGlxMetadataContainer::RefreshMediaListL(const TDesC& aModifiedUri)
  1308 	{
  1383 	{
       
  1384 	//Refresh media list since media is renamed
  1309     TRACER("CGlxMetadataContainer::RefreshMediaList()");
  1385     TRACER("CGlxMetadataContainer::RefreshMediaList()");
  1310     if (iItemMediaList)
  1386     if (iUri)
  1311         {
  1387 		{
  1312         iItemMediaList->RemoveContext(iMainListAttributecontext);
  1388 		delete iUri;
  1313         iItemMediaList->RemoveMediaListObserver(this);
  1389 		iUri = NULL;
  1314         iItemMediaList->Close();
  1390 		}
  1315         iItemMediaList = NULL;
  1391 	//always points to current media name
  1316         if (iMainListAttributecontext)
  1392 	iUri = aModifiedUri.AllocL();
  1317             {
  1393 	CMPXFilter* filter = TGlxFilterFactory::CreateURIFilterL(*iUri);
  1318             delete iMainListAttributecontext;
  1394 	CleanupStack::PushL(filter);
  1319             iMainListAttributecontext = NULL;
  1395 
  1320             }
  1396 	//Update media list's filter
  1321         CreateMediaListForSelectedItemL(ETrue);
  1397 	iItemMediaList->SetFilterL(filter);
  1322         }
  1398 	CleanupStack::PopAndDestroy(filter);
  1323     iRenameCompleted = ETrue;
  1399     }
  1324     }
  1400 
  1325 
       
  1326 // ---------------------------------------------------------------------------
       
  1327 // Completes the active object causing a call from the active scheduler to RunL()
       
  1328 // ---------------------------------------------------------------------------
       
  1329 //
       
  1330 void CGlxMetadataAsyncUpdate::CompleteSelf()
       
  1331     {
       
  1332     TRACER("CGlxMetadataAsyncUpdate::CompleteSelf");
       
  1333     TRequestStatus* status=&iStatus;
       
  1334     User::RequestComplete(status, KErrNone);
       
  1335     SetActive();  	    
       
  1336     }
       
  1337     
       
  1338 // -----------------------------------------------------------------------------
       
  1339 // RunL
       
  1340 // -----------------------------------------------------------------------------
       
  1341 //  
       
  1342 void CGlxMetadataAsyncUpdate::RunL()
       
  1343     {
       
  1344     TRACER("CGlxMetadataAsyncUpdate::RunL");
       
  1345     if(iStatus.Int() == KErrNone)
       
  1346     	{    	
       
  1347     	iObserver.RefreshMediaListL();    	
       
  1348     	}
       
  1349     }
       
  1350 
       
  1351 // -----------------------------------------------------------------------------
       
  1352 // DoCancel
       
  1353 // -----------------------------------------------------------------------------
       
  1354 // 
       
  1355 void CGlxMetadataAsyncUpdate::DoCancel()
       
  1356     {
       
  1357     TRACER("CGlxMetadataAsyncUpdate::DoCancel");
       
  1358     // No need to do anything
       
  1359     }    
       
  1360     
       
  1361 // ---------------------------------------------------------
       
  1362 // NewL
       
  1363 // ---------------------------------------------------------
       
  1364 //
       
  1365 CGlxMetadataAsyncUpdate* CGlxMetadataAsyncUpdate::NewL(CGlxMetadataContainer& aObserver)
       
  1366 	{
       
  1367 	TRACER("CGlxMetadataAsyncUpdate::NewL");
       
  1368 	CGlxMetadataAsyncUpdate* self = CGlxMetadataAsyncUpdate::NewLC(aObserver);
       
  1369 	CleanupStack::Pop(self);
       
  1370 	return self;
       
  1371 	}
       
  1372 
       
  1373 // ---------------------------------------------------------
       
  1374 // NewLC
       
  1375 // ---------------------------------------------------------
       
  1376 //
       
  1377 CGlxMetadataAsyncUpdate* CGlxMetadataAsyncUpdate::NewLC(CGlxMetadataContainer& aObserver)
       
  1378 	{
       
  1379 	TRACER("CGlxMetadataAsyncUpdate::NewLC");
       
  1380 	CGlxMetadataAsyncUpdate* self = new(ELeave) CGlxMetadataAsyncUpdate(aObserver);
       
  1381 	CleanupStack::PushL(self);
       
  1382 	return self;
       
  1383 	}
       
  1384 
       
  1385 // ---------------------------------------------------------
       
  1386 // Constructor
       
  1387 // ---------------------------------------------------------
       
  1388 //
       
  1389 CGlxMetadataAsyncUpdate::CGlxMetadataAsyncUpdate(CGlxMetadataContainer& aObserver):
       
  1390 								CActive(EPriorityStandard),iObserver(aObserver)
       
  1391     {
       
  1392     TRACER("CGlxMetadataAsyncUpdate::CGlxMetadataAsyncUpdate()");
       
  1393     CActiveScheduler::Add(this);
       
  1394     }
       
  1395 	  
       
  1396 // ---------------------------------------------------------
       
  1397 // Destructor
       
  1398 // ---------------------------------------------------------
       
  1399 //	
       
  1400 CGlxMetadataAsyncUpdate::~CGlxMetadataAsyncUpdate()
       
  1401 	{
       
  1402 	TRACER("CGlxMetadataAsyncUpdate::~CGlxMetadataAsyncUpdate");
       
  1403 	Cancel();	
       
  1404 	}
       
  1405 //End of file
  1401 //End of file