commonuis/CommonUi/src/FindItemMenu.cpp
changeset 22 75713bee6484
parent 0 2f259fa3e83a
child 30 56e9a0aaad89
equal deleted inserted replaced
21:558113899881 22:75713bee6484
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: 
    14 * Description:  
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    53 #endif // !RD_VIRTUAL_PHONEBOOK
    53 #endif // !RD_VIRTUAL_PHONEBOOK
    54 
    54 
    55 #include "finditem.hrh"
    55 #include "finditem.hrh"
    56 #include <FindItemui.rsg>
    56 #include <FindItemui.rsg>
    57 #include <aknnotewrappers.h>
    57 #include <aknnotewrappers.h>
    58 
       
    59 // add to gallery related
       
    60 #include <AknCommonDialogs.h>
       
    61 
    58 
    62 #include <featmgr.h>
    59 #include <featmgr.h>
    63 
    60 
    64 #include <centralrepository.h>
    61 #include <centralrepository.h>
    65 #include <CommonUiInternalCRKeys.h>
    62 #include <CommonUiInternalCRKeys.h>
  1363 #endif // !RD_VIRTUAL_PHONEBOOK
  1360 #endif // !RD_VIRTUAL_PHONEBOOK
  1364     }
  1361     }
  1365 
  1362 
  1366 void CFindItemMenu::AddToGalleryL()
  1363 void CFindItemMenu::AddToGalleryL()
  1367     {
  1364     {
  1368     _LIT( KRamFileExtension,".ram" );
  1365     //no need to do anything ,due to the remove of AknCommonDialogs
  1369     TFileName fileName;
       
  1370     iCoeEnv->ReadResourceL( fileName, R_FINDITEMMENU_DEFAULT_GALL_NAME );
       
  1371     fileName.Append( KRamFileExtension );
       
  1372     if ( AknCommonDialogs::RunSaveDlgLD(
       
  1373         fileName, R_MEMORY_SELECTION_LOCATIONS ) )
       
  1374         {
       
  1375         CDesCArrayFlat* array = new (ELeave)CDesCArrayFlat( 1 );
       
  1376         CleanupStack::PushL( array );
       
  1377         array->AppendL( iAutomaticFind->CurrentItemExt().iItemDescriptor->Des() );
       
  1378         TInt err = KErrNone;
       
  1379         if( !iMPEngineDllLoaded )
       
  1380             {
       
  1381             LoadMPEngineApiL();
       
  1382             }
       
  1383         err = iMPEngineApi->CreateNewLinkFileL( fileName, array, ETrue );
       
  1384         CleanupStack::PopAndDestroy( 1 );
       
  1385 
       
  1386         if ( err == KErrNone )
       
  1387             {
       
  1388             // Show note
       
  1389             HBufC* msgBuffer =
       
  1390                 iCoeEnv->AllocReadResourceLC( R_FINDITEMMENU_LINK_SAVED );
       
  1391             CAknConfirmationNote* note =
       
  1392                 new (ELeave) CAknConfirmationNote( ETrue );
       
  1393             note->ExecuteLD( *msgBuffer );
       
  1394             CleanupStack::PopAndDestroy(); // msgBuffer
       
  1395             }
       
  1396         }
       
  1397     }
  1366     }
  1398 
  1367 
  1399 EXPORT_C void CFindItemMenu::SetSenderDescriptorType(
  1368 EXPORT_C void CFindItemMenu::SetSenderDescriptorType(
  1400     CItemFinder::TItemType aType )
  1369     CItemFinder::TItemType aType )
  1401     {
  1370     {