commonuis/CommonDialogs/src/CAknFileSelectionEventHandler.cpp
branchRCL_3
changeset 55 aecbbf00d063
parent 18 0aa5fbdfbc30
child 56 d48ab3b357f1
equal deleted inserted replaced
51:fcdfafb36fe7 55:aecbbf00d063
    22 #include <eikbtgpc.h> // CEikButtonGroupContainer
    22 #include <eikbtgpc.h> // CEikButtonGroupContainer
    23 #include <avkon.hrh>
    23 #include <avkon.hrh>
    24 
    24 
    25 #include "CAknFileSelectionModel.h"
    25 #include "CAknFileSelectionModel.h"
    26 #include "MAknFileSelectionObserver.h"
    26 #include "MAknFileSelectionObserver.h"
    27 #include "CAknCommonDialogsPopupList.h"
       
    28 #include "CAknCFDFileSystemEvent.h"
       
    29 #include "AknCFDUtility.h"
    27 #include "AknCFDUtility.h"
    30 
    28 
    31 
    29 
    32 
    30 
    33 // ============================ MEMBER FUNCTIONS ===============================
    31 // ============================ MEMBER FUNCTIONS ===============================
    93     }
    91     }
    94 
    92 
    95 // Destructor
    93 // Destructor
    96 CAknFileSelectionEventHandler::~CAknFileSelectionEventHandler()
    94 CAknFileSelectionEventHandler::~CAknFileSelectionEventHandler()
    97     {
    95     {
    98     if(iFSObserver)
       
    99         {
       
   100         iFSObserver->Cancel();
       
   101         delete iFSObserver;
       
   102         iFSObserver = NULL;
       
   103         }
       
   104     }
    96     }
   105 
    97 
   106 
    98 
   107 // -----------------------------------------------------------------------------
    99 // -----------------------------------------------------------------------------
   108 // CAknFileSelectionEventHandler::PushIndicesL
   100 // CAknFileSelectionEventHandler::PushIndicesL
   296         {
   288         {
   297         case ERightSoftkeyPress: // USER HAS HIT RIGHT SOFTKEY
   289         case ERightSoftkeyPress: // USER HAS HIT RIGHT SOFTKEY
   298             {
   290             {
   299             if( iModel->DirectoryLevel() > 0 ) // We are not in the root folder
   291             if( iModel->DirectoryLevel() > 0 ) // We are not in the root folder
   300                 {
   292                 {
   301                 while( iModel->DirectoryLevel() > 0 ) // Find until existing contents
   293                 while( ETrue ) // Find until existing contents
   302                     {
   294                     {
   303                     entries = iModel->GotoParentFolderL();
   295                     entries = iModel->GotoParentFolderL();
   304                     PopIndices( aTopItemIndex, aFocusedItemIndex );
   296                     PopIndices( aTopItemIndex, aFocusedItemIndex );
   305                     if( entries > 0 || entries < KErrNotFound )
   297                     if( entries > 0 || entries < KErrNotFound )
   306                         {
   298                         {
   313                         {
   305                         {
   314                         aFocusedItemIndex = entries - 1;
   306                         aFocusedItemIndex = entries - 1;
   315                         }
   307                         }
   316                     UpdateSoftkeysL( aFocusedItemIndex, aContainer );
   308                     UpdateSoftkeysL( aFocusedItemIndex, aContainer );
   317                     returnType = EItemsUpdated;
   309                     returnType = EItemsUpdated;
   318                     }
       
   319                 else
       
   320                     {
       
   321                     returnType = ETryingToExit;
       
   322                     }
   310                     }
   323                 }
   311                 }
   324             else // We are in the root folder
   312             else // We are in the root folder
   325                 {
   313                 {
   326                 returnType = ETryingToExit;
   314                 returnType = ETryingToExit;
   394             }
   382             }
   395         }
   383         }
   396     return returnType;
   384     return returnType;
   397     }
   385     }
   398 
   386 
   399 void CAknFileSelectionEventHandler::StartFileSystemNotifierL(CAknCommonDialogsPopupList* aPopupList)
       
   400     {
       
   401     iPopupList = aPopupList;
       
   402     TPath path;
       
   403     iModel->GetCurrentPath(path);
       
   404     iFSObserver = CAknCFDFileSystemEvent::NewL(iCoeEnv->FsSession(),*this,
       
   405             ENotifyEntry,path);
       
   406     }
       
   407 void CAknFileSelectionEventHandler::StopFileSystemNotifier()
       
   408     {
       
   409     iFSObserver->Cancel();
       
   410     }
       
   411 void CAknFileSelectionEventHandler::NotifyFileSystemChangedL()
       
   412     {
       
   413     iModel->UpdateItemListL();
       
   414     iPopupList->HandleFileSystemChangedL(iModel);
       
   415     iFSObserver->Setup();
       
   416     }
       
   417 // End of File
   387 // End of File