filebrowser/engine/engine.cpp
branchGCC_SURGE
changeset 37 c20154ccf3c0
parent 35 98924d2efce9
equal deleted inserted replaced
20:ba8a586c45f1 37:c20154ccf3c0
    29 #include <coeutils.h>
    29 #include <coeutils.h>
    30 #include <bautils.h>
    30 #include <bautils.h>
    31 #include <apaid.h>
    31 #include <apaid.h>
    32 #include <s32file.h>
    32 #include <s32file.h>
    33 
    33 
    34 // hash key selection related includes
       
    35 #ifndef __SERIES60_30__
       
    36   #include <centralrepository.h>
       
    37   #include <AknFepInternalCRKeys.h>
       
    38   #include <AvkonInternalCRKeys.h>
       
    39   #include <e32property.h> 
       
    40 #endif
       
    41 
       
    42 // CONSTANTS
    34 // CONSTANTS
    43 // UID of the application
    35 // UID of the application
    44 const TUid KUidFileBrowser = { 0x102828D6 };
    36 const TUid KUidFileBrowser = { 0x102828D6 };
    45 
    37 
    46 const TInt KSettingsDrive = EDriveC;
    38 const TInt KSettingsDrive = EDriveC;
    88 void CEngine::ActivateEngineL()
    80 void CEngine::ActivateEngineL()
    89     {
    81     {
    90     TRAP_IGNORE( LoadSettingsL() );
    82     TRAP_IGNORE( LoadSettingsL() );
    91 
    83 
    92     iFileUtils = CFileBrowserFileUtils::NewL(this);
    84     iFileUtils = CFileBrowserFileUtils::NewL(this);
    93 
       
    94     // get hash key selection value
       
    95     GetHashKeySelectionStatus();
       
    96     }
    85     }
    97 
    86 
    98 // ---------------------------------------------------------------------------
    87 // ---------------------------------------------------------------------------
    99 
    88 
   100 void CEngine::DeActivateEngineL()
    89 void CEngine::DeActivateEngineL()
   101     {
    90     {
   102     }
    91     }
   103 	
    92 	
   104 // --------------------------------------------------------------------------------------------
       
   105 
       
   106 //void CEngine::SetFileListContainer(CFileBrowserFileListContainer* aFileListContainer)
       
   107 //    {
       
   108 //    iFileListContainer = aFileListContainer;
       
   109 //    }
       
   110 
       
   111 // ---------------------------------------------------------------------------
    93 // ---------------------------------------------------------------------------
   112 
    94 
   113 void CEngine::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue)
    95 void CEngine::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue)
   114     {
    96     {
   115     if (aDicFS->IsPresentL(aUid))
    97     if (aDicFS->IsPresentL(aUid))
   170     iSettings.iShowSubDirectoryInfo = EFalse;
   152     iSettings.iShowSubDirectoryInfo = EFalse;
   171     iSettings.iShowAssociatedIcons = EFalse;
   153     iSettings.iShowAssociatedIcons = EFalse;
   172     iSettings.iRememberLastPath = EFalse;
   154     iSettings.iRememberLastPath = EFalse;
   173     iSettings.iLastPath = KNullDesC;
   155     iSettings.iLastPath = KNullDesC;
   174     iSettings.iRememberFolderSelection = ETrue;
   156     iSettings.iRememberFolderSelection = ETrue;
   175 #if 0 // TODO
   157 //#if 0 // TODO
   176 #if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
   158 //#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
   177     if ( AknLayoutUtils::PenEnabled() )
   159 //    if ( AknLayoutUtils::PenEnabled() )
   178         {
   160 //        {
   179         iSettings.iEnableToolbar = ETrue;
   161 //        iSettings.iEnableToolbar = ETrue;
   180         }
   162 //        }
   181     else
   163 //    else
   182         {
   164 //        {
   183         iSettings.iEnableToolbar = EFalse;
   165 //        iSettings.iEnableToolbar = EFalse;
   184         }
   166 //        }
   185 #else
   167 //#else
   186     iSettings.iEnableToolbar = EFalse;
   168 //    iSettings.iEnableToolbar = EFalse;
   187 #endif
   169 //#endif
   188 #endif // TODO
   170 //#endif // TODO
   189 
   171 
   190     iSettings.iSupportNetworkDrives = EFalse;
   172     iSettings.iSupportNetworkDrives = EFalse;
   191     iSettings.iBypassPlatformSecurity = EFalse;
   173     iSettings.iBypassPlatformSecurity = EFalse;
   192     iSettings.iRemoveFileLocks = ETrue;
   174     iSettings.iRemoveFileLocks = ETrue;
   193     iSettings.iIgnoreProtectionsAtts = ETrue;
   175     iSettings.iIgnoreProtectionsAtts = ETrue;
   272 			}
   254 			}
   273         //iFileListContainer->HandleSettingsChangeL();
   255         //iFileListContainer->HandleSettingsChangeL();
   274         }
   256         }
   275     }
   257     }
   276 
   258 
   277 // --------------------------------------------------------------------------------------------
       
   278 
       
   279 void CEngine::GetHashKeySelectionStatus()
       
   280     {
       
   281     TBool hashKeySelectionInUse(EFalse);
       
   282     
       
   283 #ifndef __SERIES60_30__
       
   284     
       
   285     // get hash key selection value
       
   286     TRAP_IGNORE(
       
   287         CRepository* repository = CRepository::NewLC(KCRUidAknFep);
       
   288         repository->Get(KAknFepHashKeySelection, hashKeySelectionInUse);
       
   289         CleanupStack::PopAndDestroy();
       
   290     );
       
   291     
       
   292     // even if hash key selection is in use, ignore the value in qwerty mode
       
   293     if (hashKeySelectionInUse)
       
   294         {
       
   295         TBool qwertyMode(EFalse);
       
   296         RProperty qwertyModeStatusProperty;
       
   297         qwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive);
       
   298         qwertyModeStatusProperty.Get(qwertyMode);
       
   299         qwertyModeStatusProperty.Close();
       
   300         
       
   301         if (qwertyMode)
       
   302             hashKeySelectionInUse = EFalse;        
       
   303         }
       
   304 
       
   305 #endif
       
   306 
       
   307     iIsHashKeySelectionInUse = hashKeySelectionInUse;
       
   308     }
       
   309     	
       
   310 // --------------------------------------------------------------------------------------------
   259 // --------------------------------------------------------------------------------------------
   311 
   260 
   312 TInt CEngine::LaunchSettingsDialogL()
   261 TInt CEngine::LaunchSettingsDialogL()
   313     {
   262     {
   314 	TInt retValue = KErrNone;
   263 	TInt retValue = KErrNone;
   378         {
   327         {
   379         TRequestStatus* s=&iStatus;
   328         TRequestStatus* s=&iStatus;
   380         User::RequestComplete( s, KErrCancel );
   329         User::RequestComplete( s, KErrCancel );
   381         }
   330         }
   382 
   331 
   383     //CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
   332         //CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
   384 	iWait.AsyncStop();
   333 	iWait.AsyncStop();
   385 	}
   334 	}
   386 
   335 
   387 // --------------------------------------------------------------------------------------------
   336 // --------------------------------------------------------------------------------------------
   388 
   337