Revision: 201021
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:39:09 +0300
changeset 23 c9bf25a20c9f
parent 19 4b22a598b890
child 34 e0ec97ec3cc4
Revision: 201021 Kit: 2010123
creator/creator.pro
creator/data/datacreator.rss
creator/engine/inc/creator_cmdscriptrun.h
creator/engine/inc/creator_file.h
creator/engine/inc/creator_message.h
creator/engine/inc/creator_modulebase.h
creator/engine/inc/creator_phonebook.h
creator/engine/inc/creator_phonebookbase.h
creator/engine/inc/creator_scriptentry.h
creator/engine/src/creator_calendar.cpp
creator/engine/src/creator_cmdscriptrun.cpp
creator/engine/src/creator_contactelement.cpp
creator/engine/src/creator_file.cpp
creator/engine/src/creator_log.cpp
creator/engine/src/creator_message.cpp
creator/engine/src/creator_note.cpp
creator/engine/src/creator_phonebook.cpp
creator/engine/src/creator_phonebookbase.cpp
creator/engine/src/creator_scriptentry.cpp
creator/engine/src/creator_scriptparser.cpp
creator/inc/engine.h
creator/inc/enginewrapper.h
creator/inc/notifications.h
creator/src/engine.cpp
creator/src/enginewrapper.cpp
creator/src/notifications.cpp
filebrowser/engine/FB.hrh
filebrowser/engine/FBFileUtils.cpp
filebrowser/engine/FBFileUtils.h
filebrowser/engine/engine.h
filebrowser/group/ReleaseNotes_FileBrowser.txt
filebrowser/ui/inc/enginewrapper.h
filebrowser/ui/inc/filebrowserview.h
filebrowser/ui/inc/menuaction.h
filebrowser/ui/src/enginewrapper.cpp
filebrowser/ui/src/filebrowserview.cpp
filebrowser/ui/src/notifications.cpp
htiui/HtiAdmin/data/1020DEB6.rss
htiui/HtiAdmin/group/HtiAdmin.mmp
htiui/HtiAdminQt/HtiAdmin.pro
htiui/HtiDeviceReboot/src/HtiDeviceReboot.cpp
htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp
htiui/HtiServicePlugins/HtiCameraServicePlugin/data/2002EA9D.rss
htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/inc/EngineVideoRecording.h
htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/inc/VideoRecordingQualityLevels.h
htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/src/EngineVideoRecording.cpp
htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/src/VideoRecordingQualityLevels.cpp
htiui/HtiServicePlugins/HtiCameraServicePlugin/group/HtiCameraServicePlugin.mmp
htiui/HtiServicePlugins/HtiCameraServicePlugin/group/bld.inf
htiui/HtiServicePlugins/HtiCameraServicePlugin/inc/HtiCameraServicePlugin.h
htiui/HtiServicePlugins/HtiCameraServicePlugin/src/HtiCameraServicePlugin.cpp
htiui/HtiServicePlugins/HtiCameraServicePlugin/src/proxy.cpp
htiui/group/bld.inf
htiui/rom/htiui.iby
htiui/rom/htiui_10_1.iby
htiui/sis/HTI_S60-10_1.pkg
htiui/sis/HTI_S60-52.pkg
htiui/sis/HTI_S60_Upgrade-10_1.pkg
htiui/sis/HTI_S60_Upgrade-52.pkg
htiui/sis/HTI_stub.pkg
launcher/ReleaseNotes_Launcher.txt
launcher/engine/src/launcherengine.cpp
launcher/launcher.pro
launcher/src/enginewrapper.cpp
launcher/src/notifications.cpp
layers.sysdef.xml
loadgen/group/group.pro
perfmon/group/ReleaseNotes_PerfMon.txt
perfmon/ui/hb/app/src/mainview.cpp
perfmon/ui/hb/app/src/valuedatacontainer.cpp
piprofilerui/ui/avkon/group/piprofilerui.mmp
stifui/avkon/group/ReleaseNote.txt
stifui/avkon/sis/Stifui_31.sis
stifui/avkon/stifui/inc/version.h
stifui/qt/ReleaseNote.txt
--- a/creator/creator.pro	Thu May 27 12:52:19 2010 +0300
+++ b/creator/creator.pro	Fri Jun 11 13:39:09 2010 +0300
@@ -1,19 +1,3 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
 TEMPLATE = app
 TARGET = Creator
 
@@ -158,8 +142,7 @@
 			-lapengine \
 			-lnoteseditor \
 			-lxqservice \
-		    -lQtContacts \
-		    -lmobcntmodel \ 
+		    -lQtContacts \ 
 			-lagendainterface 
 
 	creatorDataBlock = \
--- a/creator/data/datacreator.rss	Thu May 27 12:52:19 2010 +0300
+++ b/creator/data/datacreator.rss	Fri Jun 11 13:39:09 2010 +0300
@@ -1,20 +1,3 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
 NAME ORBT
 
 #include <appinfo.rh>
--- a/creator/engine/inc/creator_cmdscriptrun.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_cmdscriptrun.h	Fri Jun 11 13:39:09 2010 +0300
@@ -21,7 +21,7 @@
 
 #include "engine.h"
 
-class CCreatorCmdScriptRun : public MBeating
+class CCreatorCmdScriptRun : public CBase, public MBeating
     {
 public:
 
@@ -39,7 +39,7 @@
 private:
     CCreatorCmdScriptRun();
     void ConstructL(CCreatorEngine* aEngine);
-	void Tick();
+	void TickL();
 	
 private:
     CCreatorEngine* iEngine;
@@ -56,4 +56,4 @@
 	TInt iTickCount;
     };
 	
-#endif // __CREATORCMDSCRIPTRUN_H__	
\ No newline at end of file
+#endif // __CREATORCMDSCRIPTRUN_H__	
--- a/creator/engine/inc/creator_file.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_file.h	Fri Jun 11 13:39:09 2010 +0300
@@ -40,6 +40,14 @@
 
 class CCreatorFiles : public CCreatorModuleBase
     {
+enum TCreatorFilesState{
+    ECreatorFilesDelete,
+    ECreatorFilesStart,
+    ECreatorFilesGetDirectory,
+    ECreatorFilesAskDRMData,
+    ECreatorFilesAskDRM_CD_Counts,
+    ECreatorFilesAskDRM_CD_Minutes
+};
 public: 
     static CCreatorFiles* NewL(CCreatorEngine* aEngine);
     static CCreatorFiles* NewLC(CCreatorEngine* aEngine);
@@ -51,8 +59,7 @@
 
 public:
     TBool AskDataFromUserL( TInt aCommand ); // from MCreatorModuleBase
-//    void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData); //from MUIObserver
-    void QueryDialogClosedL(TBool, TInt){/*TODO: DialogClosed*/};
+    void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData); //from MUIObserver
     TInt CreateFileEntryL(CFilesParameters *aParameters, TInt aCommand);    
     void DeleteAllL();
     void DeleteAllCreatedByCreatorL();
@@ -63,14 +70,13 @@
     void SetPermissionsL( CMetaDataArray* aMetaData, const TDesC& aOutFileName, CFilesParameters *aParameters );
     void SetMimeTypeL( const TDesC& aFileName, TDes8& aMime, CFilesParameters *aParameters );
     TBool AskDRMDataFromUserL();
-    TBool AskDRMCDDataFromUserL();
     void StorePathsForDeleteL( CDesCArray& aPaths );
     void GenerateFileNameL( TFileName& aRootName );
     
 private:
     CFilesParameters* iParameters;
     CFilesParameters* iUserParameters;
-    HBufC* iDirectoryQueriedFromUser;
+    TFileName iDirectoryQueriedFromUser;
     RFs& iFs;
     RApaLsSession iApaLs;
     CDesCArray* iFilePaths;
--- a/creator/engine/inc/creator_message.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_message.h	Fri Jun 11 13:39:09 2010 +0300
@@ -131,8 +131,8 @@
                                 TInt aNumOfExistingAddresses );
     
     void GetAllRecipientsL(RPointerArray<HBufC>& aRecipientArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
-    void SetSenderToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
-    void SetRecipientToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
+    void SetSenderToEntryDetailsL(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
+    void SetRecipientToEntryDetailsL(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
     void AddSenderToMtmAddresseeL(CBaseMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
     void AddMtmSenderL(CMmsClientMtm& aMtm, const CMessagesParameters& aParameters, TBool aUseEmailAddress );
     void GetSendersL(RPointerArray<HBufC>& aSenderArray, const CMessagesParameters& aParameters, TBool aUseEmailAddress, TInt aMaxNum );
--- a/creator/engine/inc/creator_modulebase.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_modulebase.h	Fri Jun 11 13:39:09 2010 +0300
@@ -48,6 +48,7 @@
 class CCommandParser;
 
 _LIT(KSavingText, "Saving");
+_LIT(KDeletingText, "Deleting");
 
 class MCreatorModuleBase
     {
@@ -77,7 +78,10 @@
         ECreatorModuleStart
         };
     
-    CCreatorModuleBase(){ }
+    CCreatorModuleBase()
+        {
+        iEntriesToBeCreated = 1; 
+        }
     
     virtual TBool AskDataFromUserL(TInt aCommand)
         {
@@ -94,12 +98,13 @@
             iEngine->ShutDownEnginesL();
             return;
             }
-        
+        const TDesC* showText = &KSavingText;
         TBool finished(EFalse);
         TBool retval(ETrue);
         switch(aUserData)
             {
             case ECreatorModuleDelete:
+                showText = &KDeletingText;
                 iEntriesToBeCreated = 1;
                 finished = ETrue;
                 break;
@@ -120,7 +125,7 @@
             // add this command to command array
             iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
             // started exucuting commands
-            iEngine->ExecuteFirstCommandL( KSavingText );
+            iEngine->ExecuteFirstCommandL( *showText );
             }
         }
 
--- a/creator/engine/inc/creator_phonebook.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_phonebook.h	Fri Jun 11 13:39:09 2010 +0300
@@ -109,7 +109,6 @@
     void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore );
     TBool HasOtherThanGroupsL( /*MVPbkContactLinkArray* aContacts */);																			//modify
     
-    QContactDetail CreateContactDetail(QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand );
 
 private:
 	
@@ -163,7 +162,7 @@
 	QList<QContactDetail> iContactFields;//	RPointerArray<CCreatorContactField> iContactFields;
 
     QString iGroupName;//HBufC*  iGroupName;
-    TInt    iContactsInGroup;
+    TInt iContactsInGroup;
     TInt iNumberOfPhoneNumberFields;
     TInt iNumberOfURLFields;
     TInt iNumberOfEmailAddressFields;
@@ -183,8 +182,8 @@
     {
 public:    
     static CCreatorContactField* NewL();
-    QContactDetail CreateContactDetail(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand = KErrNotFound );
-    QContactDetail CreateContactDetail(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TPtrC aData );
+    QContactDetail CreateContactDetailL(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand = KErrNotFound );
+    QContactDetail CreateContactDetailL(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TPtrC aData );
     void AddFieldToParam( CPhonebookParameters* aParam, QContactDetail aDetail);
     ~CCreatorContactField();
 private:
--- a/creator/engine/inc/creator_phonebookbase.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_phonebookbase.h	Fri Jun 11 13:39:09 2010 +0300
@@ -37,6 +37,7 @@
     ECreatorPhonebookGetPhoneNumbersCount,
     ECreatorPhonebookGetUrlsCount,
     ECreatorPhonebookGetEmailsCount,
+    ECreatorPhonebookContactsAllFields,
     ECreatorPhonebookGetGroupFields,
     ECreatorPhonebookGetContactsInGroup
 };
--- a/creator/engine/inc/creator_scriptentry.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/inc/creator_scriptentry.h	Fri Jun 11 13:39:09 2010 +0300
@@ -81,7 +81,7 @@
 public:
     void OpenScriptL();
     TBool OpenScriptL(MCommandParserObserver* aObserver);
-    TBool GetRandomDataFilenameL(TDes& aFilename);
+    TBool GetRandomDataFilenameL(MCommandParserObserver* aObserver);
 
 private:
     CCreatorEngine* iEngine;
--- a/creator/engine/src/creator_calendar.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_calendar.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -340,12 +340,14 @@
         return;
         }
     
+    const TDesC* showText = &KSavingText;
     TBool finished(EFalse);
     TBool retval(ETrue);
     switch(aUserData)
         {
         case ECreatorCalendarDelete:
             iEntriesToBeCreated = 1;
+            showText = &KDeletingText;
             finished = ETrue;
             break;
         case ECreatorCalendarStart:
@@ -406,7 +408,7 @@
         // add this command to command array
         iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
         // started exucuting commands
-        iEngine->ExecuteFirstCommandL( KSavingText );
+        iEngine->ExecuteFirstCommandL( *showText );
         }
     }
 
--- a/creator/engine/src/creator_cmdscriptrun.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_cmdscriptrun.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -117,15 +117,15 @@
 
 void  CCreatorCmdScriptRun::Beat()
 	{
-	Tick();
+	TRAP_IGNORE( TickL() );
 	}
 
 void  CCreatorCmdScriptRun::Synchronize()
 	{
-	Tick();
+    TRAP_IGNORE( TickL() );
 	}
 
-void  CCreatorCmdScriptRun::Tick()
+void  CCreatorCmdScriptRun::TickL()
 	{
 	iTickCount++;
 	if (iTickCount > KCommandLineDelay)
--- a/creator/engine/src/creator_contactelement.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_contactelement.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -222,7 +222,7 @@
                             {
                         // random
 							CleanupStack::PushL( field );
-							QContactDetail cntDetail = field->CreateContactDetail(iEngine,param,mapping.iDetail,mapping.iContext,mapping.iFieldCode, KErrNotFound );
+							QContactDetail cntDetail = field->CreateContactDetailL(iEngine,param,mapping.iDetail,mapping.iContext,mapping.iFieldCode, KErrNotFound );
                             if(!cntDetail.isEmpty())
                             	{
 								field->AddFieldToParam( param, cntDetail ); //it will do "param->iContactFields.AppendL(field);"
@@ -232,7 +232,7 @@
                         else
                             {
 							CleanupStack::PushL( field );
-                        	QContactDetail cntDetail = field->CreateContactDetail(iEngine,param,mapping.iDetail,mapping.iContext,mapping.iFieldCode, content );
+                        	QContactDetail cntDetail = field->CreateContactDetailL(iEngine,param,mapping.iDetail,mapping.iContext,mapping.iFieldCode, content );
                             if(!cntDetail.isEmpty())
                             	{
                         		field->AddFieldToParam( param, cntDetail ); //it will do "param->iContactFields.AppendL(field);"
@@ -261,7 +261,7 @@
                 
                 CCreatorContactField* field = CCreatorContactField::NewL();
                 CleanupStack::PushL( field );
-                QContactDetail cntDetail = field->CreateContactDetail(iEngine,param,fieldMappingTbl[i].iDetail,fieldMappingTbl[i].iContext,fieldMappingTbl[i].iFieldCode, KErrNotFound );
+                QContactDetail cntDetail = field->CreateContactDetailL(iEngine,param,fieldMappingTbl[i].iDetail,fieldMappingTbl[i].iContext,fieldMappingTbl[i].iFieldCode, KErrNotFound );
                 if(!cntDetail.isEmpty())
                 	{
 					field->AddFieldToParam( param, cntDetail ); //it will do "param->iContactFields.AppendL(field);"
--- a/creator/engine/src/creator_file.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_file.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -37,6 +37,7 @@
     LOGSTRING("Creator: CFilesParameters::CFilesParameters");
     iFullFilePath = HBufC::New(KFilesFieldLength);
     }
+
 CFilesParameters::CFilesParameters( CFilesParameters& aCopy )
     {
     LOGSTRING("Creator: CFilesParameters::CFilesParameters");
@@ -46,10 +47,13 @@
     iEncrypt = aCopy.iEncrypt;
     if ( aCopy.iPermission )
         {
-        iPermission = CDRMPermission::NewL();
-        iPermission->DuplicateL( *aCopy.iPermission );
+        TRAP_IGNORE(    
+            iPermission = CDRMPermission::NewL();
+            iPermission->DuplicateL( *aCopy.iPermission );
+            );
         }
     }
+
 CFilesParameters::~CFilesParameters()
     {
     LOGSTRING("Creator: CFilesParameters::~CFilesParameters");
@@ -85,7 +89,6 @@
 
     iEngine = aEngine;
 
-    iDirectoryQueriedFromUser = HBufC::New(KFilesFieldLength);
     User::LeaveIfError( iApaLs.Connect() );
     
     iFilePaths = new (ELeave) CDesCArrayFlat( 4 );
@@ -121,7 +124,6 @@
         TRAP_IGNORE( StorePathsForDeleteL( *iFilePaths ) );
         }
     delete iFilePaths;
-    delete iDirectoryQueriedFromUser;
     delete iParameters;
     delete iUserParameters;
     iApaLs.Close();
@@ -129,6 +131,164 @@
 
 //----------------------------------------------------------------------------
 
+void CCreatorFiles::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
+    {
+    LOGSTRING("Creator: CCreatorFiles::QueryDialogClosedL");
+    
+    if( aPositiveAction == EFalse )
+        {
+        iEngine->ShutDownEnginesL();
+        return;
+        }
+    
+    const TDesC* showText = &KSavingText;
+    TBool finished(EFalse);
+    TBool retval(ETrue);
+    switch(aUserData)
+        {
+        case ECreatorFilesDelete:
+            showText = &KDeletingText;
+            iEntriesToBeCreated = 1;
+            finished = ETrue;
+            break;
+        case ECreatorFilesStart:
+            {
+            // set a default directory  (eg. c:\Nokia\Images\)
+            iEngine->SetDefaultPathForFileCommandL(iCommand, iDirectoryQueriedFromUser);
+            TBuf<50> promptText;
+            if (iCommand == ECmdCreateFileEntryEmptyFolder)
+                promptText.Copy( _L("Specify the folder path and name") );
+            else
+                promptText.Copy( _L("Specify the directory") );
+            
+            // show directory query dialog
+            retval = iEngine->GetEngineWrapper()->DirectoryQueryDialog(promptText, iDirectoryQueriedFromUser, this, ECreatorFilesGetDirectory );
+            }
+            break;
+        case ECreatorFilesGetDirectory:
+            // check that the root folder is correct
+            if ( iDirectoryQueriedFromUser.Length() < 3  ||  BaflUtils::CheckFolder( iFs, iDirectoryQueriedFromUser.Left(3) ) != KErrNone )
+                {
+                iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Invalid path"));
+                retval = EFalse;
+                }        
+            else
+                {
+                // check the directory contains a trailing backlash
+                if ( iDirectoryQueriedFromUser.Right(1) != _L("\\") )
+                    {
+                    iDirectoryQueriedFromUser.Append(_L("\\"));
+                    }
+                // copy the directory name to a class member
+                if ( iCommand == ECmdCreateFileEntryEmptyFolder )
+                    {
+                    finished = ETrue;
+                    }
+                else
+                    {
+                    retval = AskDRMDataFromUserL();
+                    }
+                }
+            break;
+        case ECreatorFilesAskDRMData:
+            if ( iDummy > 0 )
+                {
+                iUserParameters->iEncrypt = ETrue;
+                }
+            if ( iDummy == 2 )
+                {
+                iUserParameters->iPermission = CDRMPermission::NewL();
+                CDRMPermission* perm = iUserParameters->iPermission; 
+                perm->iTopLevel->iActiveConstraints = EConstraintNone;
+                perm->iPlay->iActiveConstraints = EConstraintNone;
+                perm->iDisplay->iActiveConstraints = EConstraintNone;
+                perm->iPrint->iActiveConstraints = EConstraintNone;
+                perm->iExecute->iActiveConstraints = EConstraintNone;
+                perm->iUniqueID = 0;
+                // DRM Combined Delivery
+                iDummy = 0;
+                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog( &iDummy, _L("How many counts(0=unlimited)?"), ETrue, this, ECreatorFilesAskDRM_CD_Counts );
+                }
+            else
+                {
+                finished = ETrue;
+                }
+            break;
+        case ECreatorFilesAskDRM_CD_Counts:
+            if ( iDummy > 0 )
+                {
+                TInt count = iDummy;
+                CDRMPermission* perm = iUserParameters->iPermission;
+                // apply constraints to all permission types
+                // applied type will be selected by setting iAvailableRights
+                // when determining the file type
+                perm->iDisplay->iActiveConstraints |= EConstraintCounter;
+                perm->iDisplay->iCounter = count;
+                perm->iDisplay->iOriginalCounter = count;
+    
+                perm->iPlay->iActiveConstraints |= EConstraintCounter;
+                perm->iPlay->iCounter = count;
+                perm->iPlay->iOriginalCounter = count;
+    
+                perm->iPrint->iActiveConstraints |= EConstraintCounter;
+                perm->iPrint->iCounter = count;
+                perm->iPrint->iOriginalCounter = count;
+                
+                perm->iExecute->iActiveConstraints |= EConstraintCounter;
+                perm->iExecute->iCounter = count;
+                perm->iExecute->iOriginalCounter = count;
+                }
+            iDummy = 0;
+            retval = iEngine->GetEngineWrapper()->EntriesQueryDialog( &iDummy, _L("How many minutes until expire(0=unlimited)?"), ETrue, 
+                this, ECreatorFilesAskDRM_CD_Minutes
+                );
+            break;
+        case ECreatorFilesAskDRM_CD_Minutes:
+            if ( iDummy > 0 )
+                {
+                TInt minutes = iDummy;
+                CDRMPermission* perm = iUserParameters->iPermission;            
+                // apply constraints to all permission types
+                // applied type will be selected by setting iAvailableRights
+                // when determining the file type            
+                perm->iDisplay->iActiveConstraints |= EConstraintInterval;
+                perm->iDisplay->iInterval = TTimeIntervalSeconds( 60 * minutes );
+                perm->iDisplay->iIntervalStart = Time::NullTTime();
+                
+                perm->iPlay->iActiveConstraints |= EConstraintInterval;
+                perm->iPlay->iInterval = TTimeIntervalSeconds( 60 * minutes );
+                perm->iPlay->iIntervalStart = Time::NullTTime();
+    
+                perm->iPrint->iActiveConstraints |= EConstraintInterval;
+                perm->iPrint->iInterval = TTimeIntervalSeconds( 60 * minutes );
+                perm->iPrint->iIntervalStart = Time::NullTTime();
+    
+                perm->iExecute->iActiveConstraints |= EConstraintInterval;
+                perm->iExecute->iInterval = TTimeIntervalSeconds( 60 * minutes );
+                perm->iExecute->iIntervalStart = Time::NullTTime();
+                }
+            finished = ETrue;
+            break;
+        default:
+            //some error
+            retval = EFalse;
+            break;
+        }
+    if( retval == EFalse )
+        {
+        iEngine->ShutDownEnginesL();
+        }
+    else if( finished )
+        {
+        // add this command to command array
+        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
+        // started exucuting commands
+        iEngine->ExecuteFirstCommandL( *showText );
+        }
+    }
+
+//----------------------------------------------------------------------------
+
 TBool CCreatorFiles::AskDataFromUserL(TInt aCommand)
     {
     LOGSTRING("Creator: CCreatorFiles::AskDataFromUserL");
@@ -137,60 +297,16 @@
     
     if ( aCommand == ECmdDeleteCreatorFiles )
         {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all files created with Creator?") );
+        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all files created with Creator?"), this, ECreatorFilesDelete );
         }
     
     delete iUserParameters;
     iUserParameters = NULL;
     iUserParameters = new(ELeave) CFilesParameters();
     
-    iDirectoryQueriedFromUser->Des().Copy( KNullDesC );
-
-    if (iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?")))
-        {
-        // set a default directory  (eg. c:\Nokia\Images\)
-        TFileName directory;
-        iEngine->SetDefaultPathForFileCommandL(aCommand, directory);
-
-        // directory query dialog
-		/*
-        CAknTextQueryDialog* textDialog = CAknTextQueryDialog::NewL(directory, CAknQueryDialog::ENoTone);
-        textDialog->SetMaxLength(256);
-		*/
-		
-        TBuf<50> promptText;
+    iDirectoryQueriedFromUser.Copy( KNullDesC );
 
-        if (aCommand == ECmdCreateFileEntryEmptyFolder)
-            promptText.Copy( _L("Specify the folder path and name") );
-        else
-            promptText.Copy( _L("Specify the directory") );
-		// show directory query dialog
-        if (iEngine->GetEngineWrapper()->DirectoryQueryDialog(promptText, directory))
-            {
-	        // check that the root folder is correct
-            if (directory.Length() < 3  ||  BaflUtils::CheckFolder(iFs, directory.Left(3)) != KErrNone)
-                {
-                iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Invalid path"));
-                return EFalse;
-                }        
-            else
-                {
-                // check the directory contains a trailing backlash
-                if (directory.Right(1) != _L("\\"))
-                    directory.Append(_L("\\"));
-
-                // copy the directory name to a class member
-                iDirectoryQueriedFromUser->Des() = directory;
-                if ( aCommand == ECmdCreateFileEntryEmptyFolder ) return ETrue;
-                else return AskDRMDataFromUserL();
-                }
-            }        
-        else
-            return EFalse;
-        }
-    else 
-        return EFalse;
-
+    return iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorFilesStart );
     }
 
 
@@ -228,8 +344,8 @@
     if ( aCommand == ECmdCreateFileEntryEmptyFolder)
         {
         // strip the last backslash from the path
-        if( iDirectoryQueriedFromUser && iDirectoryQueriedFromUser->Des().Length() > 0)
-        	directoryToBeCreated = iDirectoryQueriedFromUser->Des();
+        if( iDirectoryQueriedFromUser.Length() > 0)
+        	directoryToBeCreated = iDirectoryQueriedFromUser;
         else if( parameters->iFullFilePath && parameters->iFullFilePath->Des().Length() > 0 )
         	directoryToBeCreated = parameters->iFullFilePath->Des();
         else 
@@ -334,13 +450,13 @@
             LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL iFullFilePath used, fullTargetPath: %S", &fullTargetPath);
             }
     
-        else if ( iDirectoryQueriedFromUser && iDirectoryQueriedFromUser->Des().Length() > 0 )
+        else if ( iDirectoryQueriedFromUser.Length() > 0 )
             {
             // target path = directory + the file name from source path
             TParse parser;
             parser.Set(fullSourcePath, NULL, NULL);
 
-            fullTargetPath = iDirectoryQueriedFromUser->Des();
+            fullTargetPath = iDirectoryQueriedFromUser;
             fullTargetPath.Append( parser.NameAndExt() );
 
             LOGSTRING2("Creator: CCreatorFiles::CreateFileEntryL iDirectoryQueriedFromUser used, fullTargetPath: %S", &fullTargetPath);
@@ -411,7 +527,7 @@
         SetPermissionsL( metaData, aOutFileName, aParameters );
         }
     
-    supplier->SetOutputDirectoryL( *iDirectoryQueriedFromUser );
+    supplier->SetOutputDirectoryL( iDirectoryQueriedFromUser );
     
     // The KOmaImportContentType is a OMA DRM agent specific MIME type which
     // indicates that plain content is to be encrypted
@@ -561,12 +677,6 @@
     {
     LOGSTRING("Creator: CCreatorFiles::AskDRMDataFromUserL");
     // Encryption -dialog
-    TInt encIndex( 0 );
-	
-
-    //CAknListQueryDialog* encDlg = new (ELeave) CAknListQueryDialog( &encIndex );
-    //encDlg->PrepareLC( R_ENCRYPTION_DIALOG );
-    //Create flat array from which list is built.
     CDesCArrayFlat* items = new(ELeave) CDesCArrayFlat(5);
     CleanupStack::PushL(items);
 
@@ -575,144 +685,12 @@
     items->AppendL( _L("DRM Forward Lock") );
     items->AppendL( _L("DRM Combined Delivery") );
 
-    // Add items into main list
-    //encDlg->SetOwnershipType( ELbmOwnsItemArray );
-    //encDlg->SetItemTextArray( items );
-    CleanupStack::Pop( items );
-    //encDlg->ListBox()->SetCurrentItemIndexAndDraw( 0 );
-
+    
 	// create a popup list
-    if ( iEngine->GetEngineWrapper()->PopupListDialog(_L("Encryption"), items, &encIndex, this, 1) )
-        {
-        if ( encIndex > 0 )
-            {
-            iUserParameters->iEncrypt = ETrue;
-            }
-        if ( encIndex == 2 )
-            {
-            iUserParameters->iPermission = CDRMPermission::NewL();
-            CDRMPermission* perm = iUserParameters->iPermission; 
-            perm->iTopLevel->iActiveConstraints = EConstraintNone;
-            perm->iPlay->iActiveConstraints = EConstraintNone;
-            perm->iDisplay->iActiveConstraints = EConstraintNone;
-            perm->iPrint->iActiveConstraints = EConstraintNone;
-            perm->iExecute->iActiveConstraints = EConstraintNone;
-            perm->iUniqueID = 0;
-            // DRM Combined Delivery
-            return AskDRMCDDataFromUserL();
-            }
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        } 
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorFiles::AskDRMCDDataFromUserL()
-    {
-    LOGSTRING("Creator: CCreatorFiles::AskDRMCDDataFromUserL");
-    TInt count(0);
-    if ( iEngine->GetEngineWrapper()->EntriesQueryDialog( &iDummy, _L("How many counts\r\n(0=unlimited)?"), ETrue ) )
-        {
-        if ( count > 0 )
-            {
-            CDRMPermission* perm = iUserParameters->iPermission;
-            // apply constraints to all permission types
-            // applied type will be selected by setting iAvailableRights
-            // when determining the file type
-            perm->iDisplay->iActiveConstraints |= EConstraintCounter;
-            perm->iDisplay->iCounter = count;
-            perm->iDisplay->iOriginalCounter = count;
-
-            perm->iPlay->iActiveConstraints |= EConstraintCounter;
-            perm->iPlay->iCounter = count;
-            perm->iPlay->iOriginalCounter = count;
-
-            perm->iPrint->iActiveConstraints |= EConstraintCounter;
-            perm->iPrint->iCounter = count;
-            perm->iPrint->iOriginalCounter = count;
-            
-            perm->iExecute->iActiveConstraints |= EConstraintCounter;
-            perm->iExecute->iCounter = count;
-            perm->iExecute->iOriginalCounter = count;
-            }
-        }
-    else
-        {
-        return EFalse;
-        }
-    /*
-    TInt seconds( 0 );
-    if ( iEngine->GetEngineWrapper()->EntriesQueryDialog( seconds, _L("How many accumulated seconds until expire (0=unlimited)?"), ETrue ) )
-        {
-        if ( seconds > 0 )
-            {
-            CDRMPermission* perm = iUserParameters->iPermission;            
-            // apply constraints to all permission types
-            // applied type will be selected by setting iAvailableRights
-            // when determining the file type            
-            perm->iDisplay->iActiveConstraints |= EConstraintAccumulated;
-            perm->iDisplay->iEndTime = Time::MaxTTime();
-            perm->iDisplay->iStartTime = Time::MinTTime();;
-            perm->iDisplay->iAccumulatedTime = seconds;
-            
-            perm->iPlay->iActiveConstraints |= EConstraintAccumulated;
-            perm->iPlay->iEndTime = Time::MaxTTime();
-            perm->iPlay->iStartTime = Time::MinTTime();;
-            perm->iPlay->iAccumulatedTime = seconds;
-
-            perm->iPrint->iActiveConstraints |= EConstraintAccumulated;
-            perm->iPrint->iEndTime = Time::MaxTTime();
-            perm->iPrint->iStartTime = Time::MinTTime();;
-            perm->iPrint->iAccumulatedTime = seconds;
-
-            perm->iExecute->iActiveConstraints |= EConstraintAccumulated;
-            perm->iExecute->iEndTime = Time::MaxTTime();
-            perm->iExecute->iStartTime = Time::MinTTime();;
-            perm->iExecute->iAccumulatedTime = seconds;
-            }
-        }
-    else
-        {
-        return EFalse;
-        }
-    */
-    
-    TInt minutes( 0 );
-    if ( iEngine->GetEngineWrapper()->EntriesQueryDialog( &iDummy, _L("How many minutes until expire (0=unlimited)?"), ETrue ) )
-        {
-        if ( minutes > 0 )
-            {
-            CDRMPermission* perm = iUserParameters->iPermission;            
-            // apply constraints to all permission types
-            // applied type will be selected by setting iAvailableRights
-            // when determining the file type            
-            perm->iDisplay->iActiveConstraints |= EConstraintInterval;
-            perm->iDisplay->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iDisplay->iIntervalStart = Time::NullTTime();
-            
-            perm->iPlay->iActiveConstraints |= EConstraintInterval;
-            perm->iPlay->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iPlay->iIntervalStart = Time::NullTTime();
-
-            perm->iPrint->iActiveConstraints |= EConstraintInterval;
-            perm->iPrint->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iPrint->iIntervalStart = Time::NullTTime();
-
-            perm->iExecute->iActiveConstraints |= EConstraintInterval;
-            perm->iExecute->iInterval = TTimeIntervalSeconds( 60 * minutes );
-            perm->iExecute->iIntervalStart = Time::NullTTime();
-            }
-        }
-    else
-        {
-        return EFalse;
-        }
-    
-    return ETrue;
+    iDummy = 0;
+    TBool retval = iEngine->GetEngineWrapper()->PopupListDialog(_L("Encryption"), items, &iDummy, this, ECreatorFilesAskDRMData );
+    CleanupStack::PopAndDestroy( items );
+    return retval;
     }
 
 //----------------------------------------------------------------------------
--- a/creator/engine/src/creator_log.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_log.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -69,6 +69,7 @@
 
 CCreatorLogs::CCreatorLogs() : CActive(0)
     {
+    iEntriesToBeCreated = 1;
     }
 
 void CCreatorLogs::ConstructL(CCreatorEngine* aEngine)
@@ -115,11 +116,13 @@
         return;
         }
     
+    const TDesC* showText = &KSavingText;
     TBool finished(EFalse);
     TBool retval(ETrue);
     switch(aUserData)
         {
         case ECreatorLogsDelete:
+            showText = &KDeletingText;
             iEntriesToBeCreated = 1;
             finished = ETrue;
             break;
@@ -140,7 +143,7 @@
         // add this command to command array
         iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
         // started exucuting commands
-        iEngine->ExecuteFirstCommandL( KSavingText );
+        iEngine->ExecuteFirstCommandL( *showText );
         }
     }
     
--- a/creator/engine/src/creator_message.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_message.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -133,11 +133,13 @@
         return;
         }
     
+    const TDesC* showText = &KSavingText;
     TBool finished(EFalse);
     TBool retval(ETrue);
     switch(aUserData)
         {
         case ECreatorMessagesDelete:
+            showText = &KDeletingText;
             iEntriesToBeCreated = 1;
             finished = ETrue;
             break;
@@ -225,7 +227,7 @@
         // add this command to command array
         iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
         // started exucuting commands
-        iEngine->ExecuteFirstCommandL( KSavingText );
+        iEngine->ExecuteFirstCommandL( *showText );
         }
     }
 //----------------------------------------------------------------------------
@@ -455,10 +457,11 @@
     clientMtm->CreateMessageL(defaultServiceId);
 
     // set the from field to sms header
-    if (parameters.iFolderType == EInbox)
+    // !!! This will cause CRASH
+    /*if (parameters.iFolderType == EInbox)
         {
         CSmsHeader* smsHeader = &clientMtm->SmsHeader();
-        delete smsHeader;
+        delete smsHeader; // <-- This will cause CRASH
         smsHeader = NULL;
         smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, clientMtm->Body());        
         if( parameters.iSenderAddress )
@@ -469,7 +472,7 @@
             {
             smsHeader->SetFromAddressL(KEmpty);
             }
-        }       
+        }       */
 
     // set body
     clientMtm->Body().Reset();
@@ -481,11 +484,11 @@
     // set the details field
     if (parameters.iFolderType == EInbox)
         {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
         }
     else
         {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        SetRecipientToEntryDetailsL(messageEntry, parameters, EFalse);
         // Add all recipients to clientMtm
         // iRecipientArray is up-to-date so don't call AddRecipientsL here 
         for( TInt i = 0; i < iRecipientArray.Count(); i++ )
@@ -664,11 +667,11 @@
     // set the details field
     if (parameters.iFolderType == EInbox)
         {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
         }
     else
         {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        SetRecipientToEntryDetailsL(messageEntry, parameters, EFalse);
         }    
 
     // set the description field same as the message subject
@@ -923,11 +926,11 @@
     // set the details field
     if (parameters.iFolderType == EInbox)
         {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
         }  
     else
         {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        SetRecipientToEntryDetailsL(messageEntry, parameters, EFalse);
         }
 
     // set the description field same as the message subject
@@ -1088,14 +1091,14 @@
     if (parameters.iFolderType == EInbox)
         {
         AddSenderToMtmAddresseeL(*clientMtm, parameters, ETrue );
-        SetSenderToEntryDetails(messageEntry, parameters, ETrue);
+        SetSenderToEntryDetailsL(messageEntry, parameters, ETrue);
         messageEntry.iMtm = KUidMsgTypeIMAP4;  // or any other than KUidMsgTypeSMTP to display 'from' field instead of 'to' field 
         }
     else
         {
         // Add all recipients to clientMtm
         AddRecipientsL( *clientMtm, parameters, ETrue );
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);        
+        SetRecipientToEntryDetailsL(messageEntry, parameters, EFalse);        
         }
 
     // set the description field same as the message subject
@@ -1319,11 +1322,11 @@
     // set the details field
     if (parameters.iFolderType == EInbox)
         {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);        
+        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
         }        
     else
         {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        SetRecipientToEntryDetailsL(messageEntry, parameters, EFalse);
         }
 
     // set the subject line
@@ -1430,11 +1433,11 @@
     // set the details field and
     if (parameters.iFolderType == EInbox)
         {
-        SetSenderToEntryDetails(messageEntry, parameters, EFalse);
+        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);
         }        
     else
         {
-        SetRecipientToEntryDetails(messageEntry, parameters, EFalse);
+        SetRecipientToEntryDetailsL(messageEntry, parameters, EFalse);
         }
     
     // set mtm
@@ -1520,7 +1523,7 @@
     }
 
 //----------------------------------------------------------------------------
-void CCreatorMessages::SetSenderToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
+void CCreatorMessages::SetSenderToEntryDetailsL(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
     {        
     // Only one sender allowed:
     if( iSenderArray.Count() == 0 )
@@ -1538,7 +1541,7 @@
     }
 
 //----------------------------------------------------------------------------
-void CCreatorMessages::SetRecipientToEntryDetails(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
+void CCreatorMessages::SetRecipientToEntryDetailsL(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress)
     {        
     // Only one sender allowed:
     GetAllRecipientsL(iRecipientArray, aParameters, aUseEmailAddress);
--- a/creator/engine/src/creator_note.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_note.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -71,8 +71,8 @@
     LOGSTRING("Creator: CCreatorNotepad::ConstructL");
 
     iEngine = aEngine;
-
-    iNotepadApi = new NotesEditor();
+    iAgendaUtil = new AgendaUtil();
+    iNotepadApi = new NotesEditor(iAgendaUtil);
     //iNotepadApi = CNotepadApi::NewL();
     }
 
@@ -80,11 +80,23 @@
     {
     LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
     
-    // TODO DELETE!!!
-    //delete iNotepadApi;
+    if(iNotepadApi)
+        {
+        delete iNotepadApi;
+        iNotepadApi = NULL;
+        }
+    
+    if(iAgendaUtil)
+        {
+        delete iAgendaUtil;
+        iAgendaUtil = NULL;
+        }
     
     if (iParameters)
+        {
         delete iParameters;
+        iParameters;
+        }
     }
 
 //----------------------------------------------------------------------------
@@ -144,13 +156,12 @@
     QList<AgendaEntry> ael;
     AgendaUtil::FilterFlags filter = AgendaUtil::FilterFlags(AgendaUtil::IncludeNotes);
 
-    iAgendaUtil = new AgendaUtil();
     ael = iAgendaUtil->fetchAllEntries(filter);
     for(int i=0 ; i<ael.count() ; i++)
     	{
         iAgendaUtil->deleteEntry(ael[i].id());
     	}
-    delete iAgendaUtil;
+    
     // Open Notes db
  /*   RDbs dbs;
     User::LeaveIfError( dbs.Connect() );
--- a/creator/engine/src/creator_phonebook.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_phonebook.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -24,7 +24,7 @@
 #include "creator_traces.h"
 
 #include <bautils.h> 
-#include <qpixmap>
+//#include <qpixmap>
 
 //#include <QDebug>
 _LIT(KTempPath, "C:\\Data\\Creator\\");
@@ -362,260 +362,7 @@
     return result;
     }
 
-QContactDetail CCreatorPhonebook::CreateContactDetail(QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand )
-	{
-	QContactDetail contactDetail;
-	TPtrC contentData;
-	if( aDetail == QContactPhoneNumber::DefinitionName)
-		{
-		QContactPhoneNumber phoneNumber;// = contactDetail;
-		if(!aFieldContext.isEmpty())
-		   	{
-			phoneNumber.setContexts(aFieldContext);
-			}
-		phoneNumber.setSubTypes(aFieldString);
-		contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
-		QString number = QString::fromUtf16(contentData.Ptr(),contentData.Length());
-		phoneNumber.setNumber(number);
-		return phoneNumber;
-		}
-	else if( aDetail == QContactName::DefinitionName )			//--Contact NAME-----------------------------
-		{
-		QContactName contactName;
-		for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-			{
-			if(iParameters->iContactFields.at(i).definitionName() == QContactName::DefinitionName )
-				{
-				contactName = iParameters->iContactFields.at(i);
-				}
-			}
-		contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
-		QString name = QString::fromUtf16(contentData.Ptr(),contentData.Length());
-		if(aFieldString == QContactName::FieldFirstName)
-			{
-			if(contactName.firstName().isEmpty())
-				{
-				contactName.setFirstName( name );
-				}
-			}
-		else if(aFieldString == QContactName::FieldLastName)
-			{
-			if(contactName.lastName().isEmpty())
-				{
-				contactName.setLastName( name );
-				}
-			}
-		else if(aFieldString == QContactName::FieldMiddleName)
-			{
-			if(contactName.middleName().isEmpty())
-				{
-				contactName.setMiddleName( name );
-				}
-			}
-		else if(aFieldString == QContactName::FieldPrefix)
-			{
-			if(contactName.prefix().isEmpty())
-				{
-				contactName.setPrefix( name );
-				}
-			}
-		else if(aFieldString == QContactName::FieldSuffix)
-			{
-			if(contactName.suffix().isEmpty())
-				{
-				contactName.setSuffix( name );
-				}
-			}
-		else		//QContactName::FieldCustomLabel:
-			{
-			if(contactName.customLabel().isEmpty())
-				{
-				contactName.setCustomLabel( name );
-				}
-			}
-		return contactName;
-		}
-	else if( aDetail == QContactOrganization::DefinitionName )			//--Contact Company-----------------------------
-		{
-		QContactOrganization contactCompany;
-		
-		for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-			{
-			if(iParameters->iContactFields.at(i).definitionName() == QContactOrganization::DefinitionName )
-				{
-				contactCompany = iParameters->iContactFields.at(i);
-				}
-			}
-		contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
-		QString company = QString::fromUtf16(contentData.Ptr(),contentData.Length());
-		if(aFieldString == QContactOrganization::FieldName)
-			{
-			if(contactCompany.name().isEmpty())
-				{
-				contactCompany.setName( company );
-				}
-			}
-		if(aFieldString == QContactOrganization::FieldTitle)
-			{
-			if(contactCompany.title().isEmpty())
-				{
-				contactCompany.setTitle( company );
-				}
-			}
-		if(aFieldString == QContactOrganization::FieldDepartment)
-			{
-				QStringList depList = contactCompany.department();
-				depList.append(company);
-				contactCompany.setDepartment(depList);
-			}
-		if(aFieldString == QContactOrganization::FieldAssistantName)
-			{
-			if(contactCompany.assistantName().isEmpty())
-				{
-				contactCompany.setAssistantName( company );
-				}
-			}
-		return contactCompany;
-		}
-	else if( aDetail == QContactAddress::DefinitionName )			//--Contact Address-----------------------------
-			{
-			QContactAddress contactAddress;
-			
-			for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-				{
-				if(iParameters->iContactFields.at(i).definitionName() == QContactAddress::DefinitionName && iParameters->iContactFields.at(i).value(QContactDetail::FieldContext) == aFieldContext )
-					{
-					contactAddress = iParameters->iContactFields.at(i);
-					}
-				}
-			
-			contactAddress.setContexts( aFieldContext );
-			
-			contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
-			QString address = QString::fromUtf16(contentData.Ptr(),contentData.Length());
-			if(aFieldString == QContactAddress::FieldStreet )
-				{
-				if( contactAddress.street().isEmpty() )
-					{
-					contactAddress.setStreet( address );
-					}
-				}
-			else if(aFieldString == QContactAddress::FieldLocality )
-				{
-				if( contactAddress.locality().isEmpty() )
-					{
-					contactAddress.setLocality( address );
-					}
-				}
-			else if(aFieldString == QContactAddress::FieldRegion )
-				{
-				if( contactAddress.region().isEmpty() )
-					{
-					contactAddress.setRegion( address );
-					}
-				}
-			else if(aFieldString == QContactAddress::FieldPostcode )
-				{
-				if( contactAddress.postcode().isEmpty() )
-					{
-					contactAddress.setPostcode( address );
-					}
-				}
-			else if(aFieldString == QContactAddress::FieldCountry )
-				{
-				if( contactAddress.country().isEmpty() )
-					{
-					contactAddress.setCountry( address );
-					}
-				}
-			else 
-				{
-				return contactDetail;
-				}
-			return contactAddress;
-			}
-	else if( aDetail == QContactNote::DefinitionName )			//--Contact Note-----------------------------
-				{
-				QContactNote contactNote;
-				contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
-				QString note = QString::fromUtf16(contentData.Ptr(),contentData.Length());
-				contactNote.setNote(note);
-				return contactNote;
-				}
-	else if( aDetail == QContactFamily::DefinitionName )			//--Contact Family-----------------------------
-				{
-				QContactFamily contactFamily;
-				
-				for(int i = 0 ; i < iParameters->iContactFields.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-					{
-					if(iParameters->iContactFields.at(i).definitionName() == QContactFamily::DefinitionName && iParameters->iContactFields.at(i).value(QContactDetail::FieldContext) == aFieldContext )
-						{
-						contactFamily = iParameters->iContactFields.at(i);
-						}
-					}
-				contentData.Set(iEngine->RandomString((CCreatorEngine::TRandomStringType) aRand));
-				QString familyData = QString::fromUtf16(contentData.Ptr(),contentData.Length());
-				if(aFieldString == QContactFamily::FieldSpouse )
-					{
-					if( contactFamily.spouse().isEmpty() )
-						{
-						contactFamily.setSpouse( familyData );
-						}
-					}
-				if(aFieldString == QContactFamily::FieldChildren )
-					{
-						QStringList children = contactFamily.children();
-						children.append( familyData );
-						contactFamily.setChildren( children );
-					}
-				
-				return contactFamily;
-				}
-	
-	if( aDetail == QContactAvatar::DefinitionName)						//--Contact Picture-----------------------------
-			{
-			RFs& fs = CCoeEnv::Static()->FsSession();
-			QContactAvatar contactAvatar;
-			TBuf<KMaxFileName> srcPath;
-			iEngine->RandomPictureFileL(srcPath);
-			TBuf<KMaxFileName> destPath(KTempPath);
-						
-			if(!BaflUtils::FolderExists( fs, destPath ))
-				{
-				BaflUtils::EnsurePathExistsL( fs, destPath );
-				}
-			
-			TInt err=BaflUtils::CopyFile( fs, srcPath, destPath );
 
-			TParse temp;
-			temp.Set( srcPath,NULL,NULL );
-			destPath.Append(temp.NameAndExt());
-			
-			QString avatarFile = QString::fromUtf16( destPath.Ptr(),destPath.Length() );
-			
-			QPixmap avatarPix(avatarFile);
-
-			contactAvatar.setAvatar(avatarFile);
-            contactAvatar.setPixmap(avatarPix);
-
-			return contactAvatar;
-			}
-	if( aDetail == QContactAnniversary::DefinitionName)
-			{
-			QContactAnniversary contactAnniversary;
-			QDate date;
-			TTime datetime = iEngine->RandomDate( CCreatorEngine::EDateFuture );
-			date.setDate( datetime.DateTime().Year(),(int) (datetime.DateTime().Month()+1), datetime.DateTime().Day() );
-			contactAnniversary.setOriginalDate( date );
-			return contactAnniversary;
-			}
-			
-
-
-	
-	
-	return contactDetail;
-	}
 //----------------------------------------------------------------------------
 
 
@@ -711,7 +458,7 @@
     				
     				CCreatorContactField* field = CCreatorContactField::NewL();
 	                CleanupStack::PushL( field );
-	                QContactDetail cntDetail = field->CreateContactDetail(iEngine,iParameters,CreatorPbkMiscTextFields[tfIndex].iDetail, CreatorPbkMiscTextFields[tfIndex].iFieldContext, CreatorPbkMiscTextFields[tfIndex].iFieldString, CreatorPbkMiscTextFields[tfIndex].iRandomType );
+	                QContactDetail cntDetail = field->CreateContactDetailL(iEngine,iParameters,CreatorPbkMiscTextFields[tfIndex].iDetail, CreatorPbkMiscTextFields[tfIndex].iFieldContext, CreatorPbkMiscTextFields[tfIndex].iFieldString, CreatorPbkMiscTextFields[tfIndex].iRandomType );
   	                if(!cntDetail.isEmpty())
   	                	{
   						field->AddFieldToParam( iParameters, cntDetail ); //it will do "param->iContactFields.AppendL(field);"
@@ -722,7 +469,7 @@
 		TPtrC emptyData;
 		CCreatorContactField* fieldPicture = CCreatorContactField::NewL();
 		CleanupStack::PushL( fieldPicture );
-		QContactDetail cntDetail = fieldPicture->CreateContactDetail(iEngine,iParameters,QContactAvatar::DefinitionName,"","",emptyData );
+		QContactDetail cntDetail = fieldPicture->CreateContactDetailL(iEngine,iParameters,QContactAvatar::DefinitionName,"","",emptyData );
 		if(!cntDetail.isEmpty())
 		  	{
 		fieldPicture->AddFieldToParam( iParameters, cntDetail ); //it will do "param->iContactFields.AppendL(field);"
@@ -732,7 +479,7 @@
 		// Add date-time fields:
 		CCreatorContactField* fieldAnniv = CCreatorContactField::NewL();
 		CleanupStack::PushL( fieldAnniv );
-		QContactDetail cntDetAnniv = fieldAnniv->CreateContactDetail(iEngine,iParameters,QContactAnniversary::DefinitionName,"","",emptyData );
+		QContactDetail cntDetAnniv = fieldAnniv->CreateContactDetailL(iEngine,iParameters,QContactAnniversary::DefinitionName,"","",emptyData );
 		if(!cntDetAnniv .isEmpty())
 		  	{
 			fieldAnniv->AddFieldToParam( iParameters, cntDetAnniv ); //it will do "param->iContactFields.AppendL(field);"
@@ -782,7 +529,7 @@
         {
     	CCreatorContactField* fieldUrl = CCreatorContactField::NewL();
     	CleanupStack::PushL( fieldUrl );
-    	QContactDetail cntDetUrl = fieldUrl->CreateContactDetail(iEngine,iParameters,QContactUrl::DefinitionName,"","",KErrNotFound );
+    	QContactDetail cntDetUrl = fieldUrl->CreateContactDetailL(iEngine,iParameters,QContactUrl::DefinitionName,"","",KErrNotFound );
     	if(!cntDetUrl.isEmpty())
     	  	{
 			fieldUrl->AddFieldToParam( iParameters, cntDetUrl ); //it will do "param->iContactFields.AppendL(field);"
@@ -796,7 +543,7 @@
         	{
 			CCreatorContactField* fieldEmail = CCreatorContactField::NewL();
         	CleanupStack::PushL( fieldEmail );
-        	QContactDetail cntDetEmail = fieldEmail->CreateContactDetail(iEngine,iParameters,QContactEmailAddress::DefinitionName,"","",KErrNotFound );
+        	QContactDetail cntDetEmail = fieldEmail->CreateContactDetailL(iEngine,iParameters,QContactEmailAddress::DefinitionName,"","",KErrNotFound );
         	if(!cntDetEmail.isEmpty())
         	  	{
 				fieldEmail->AddFieldToParam( iParameters, cntDetEmail ); //it will do "param->iContactFields.AppendL(field);"
@@ -980,7 +727,7 @@
     {
     //pImpl = CCreatorContactTextField::NewL(aFieldType, aData); 
     }
-QContactDetail CCreatorContactField::CreateContactDetail(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand )
+QContactDetail CCreatorContactField::CreateContactDetailL(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TInt aRand )
     {
 	QContactDetail emptyDet;
     TPtrC contentData;
@@ -1022,7 +769,7 @@
 			return emptyDet;
 			}
     	}
-    emptyDet = CreateContactDetail( aEngine, aParameters, aDetail, aFieldContext, aFieldString, contentData );
+    emptyDet = CreateContactDetailL( aEngine, aParameters, aDetail, aFieldContext, aFieldString, contentData );
     if( tempData )
     	{
 		CleanupStack::PopAndDestroy( tempData );
@@ -1030,7 +777,7 @@
     return emptyDet;
     }
 
-QContactDetail CCreatorContactField::CreateContactDetail(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TPtrC aData )
+QContactDetail CCreatorContactField::CreateContactDetailL(CCreatorEngine* aEngine,CPhonebookParameters* aParameters,QString aDetail, QString aFieldContext, QString aFieldString, TPtrC aData )
     {
     QContactDetail contactDetail;
         
@@ -1258,10 +1005,10 @@
                 
                 QString avatarFile = QString::fromUtf16( destPath.Ptr(),destPath.Length() );
                 
-                QPixmap avatarPix(avatarFile);
+                //QPixmap avatarPix(avatarFile);
 
                 contactAvatar.setAvatar(avatarFile);
-                contactAvatar.setPixmap(avatarPix);
+                //contactAvatar.setPixmap(avatarPix);
 
                 return contactAvatar;
                 }
--- a/creator/engine/src/creator_phonebookbase.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_phonebookbase.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -30,11 +30,13 @@
         return;
         }
     
+    const TDesC* showText = &KSavingText;
     TBool finished(EFalse);
     TBool retval(ETrue);
     switch(aUserData)
         {
         case ECreatorPhonebookDelete:
+            showText = &KDeletingText;
             finished = ETrue;
             iEntriesToBeCreated = 1;
             break;
@@ -44,25 +46,17 @@
                 );
             break;
         case ECreatorPhonebookGetContactFields:
-            if(!iDefaultFieldsSelected)
+            if(iDummy==0)// first item, use default fields
+                    
                 {
-                if(iDummy==0)// first item, use default fields
-                        
-                    {
-                    iDefaultFieldsSelected = ETrue;
-                    retval = iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add all the other fields to contacts?"), this, ECreatorPhonebookGetContactFields);
-                    }
-                else
-                    {
-                    retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberOfPhoneNumberFields, _L("Amount of phone number fields in one contact?"), 
-                        ETrue, this, ECreatorPhonebookGetPhoneNumbersCount 
-                        );
-                    }
+                iDefaultFieldsSelected = ETrue;
+                finished = ETrue;
                 }
             else
                 {
-                iAddAllFields = aPositiveAction;
-                finished = ETrue;
+                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberOfPhoneNumberFields, _L("Amount of phone number fields in one contact?"), 
+                    ETrue, this, ECreatorPhonebookGetPhoneNumbersCount 
+                    );
                 }
             break;
         case ECreatorPhonebookGetPhoneNumbersCount:
@@ -76,6 +70,10 @@
                 );
             break;
         case ECreatorPhonebookGetEmailsCount:
+            retval = iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add all the other fields to contacts?"), this, ECreatorPhonebookContactsAllFields);
+            break;
+        case ECreatorPhonebookContactsAllFields:
+            iAddAllFields = aPositiveAction;
             // finaly we have all informations from user, start engine
             finished = ETrue;
             break;
@@ -109,7 +107,7 @@
         // add this command to command array
         iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
         // started exucuting commands
-        iEngine->ExecuteFirstCommandL( KSavingText );
+        iEngine->ExecuteFirstCommandL( *showText );
         }
     }
     
--- a/creator/engine/src/creator_scriptentry.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_scriptentry.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -84,14 +84,23 @@
     {
     User::LeaveIfNull(iSearchArray);
     
-    if( aUserData == EGetingScript && aPositiveAction && iSearchArray->Count() )
+    if( aUserData == EGetingScript )
         {
-        iObserver->FileChosenL( ETrue, iSearchArray->MdcaPoint(iSelectedItem) );
+        if(aPositiveAction)
+            {
+            iObserver->ScriptChosenL( ETrue, iSearchArray->MdcaPoint(iSelectedItem) );
+            }
+        else
+            {
+            iObserver->ScriptChosenL( EFalse );
+            }
         }
     else if( aUserData == EGetingRandomDataFile && aPositiveAction && iSearchArray->Count() )
         {
-        TFileName fileName;
-        if (iSelectedItem == (iSearchArray->Count() - 1))
+        if(aPositiveAction)
+            {
+            TFileName fileName;
+            if (iSelectedItem == (iSearchArray->Count() - 1))
                 {
                 // "default" (resource file) selected
                 fileName.Copy(KNullDesC);
@@ -101,15 +110,13 @@
                 // xml file selected
                 fileName.Copy(iSearchArray->MdcaPoint(iSelectedItem));
                 }
-        iObserver->FileChosenL( ETrue, fileName );
+            iObserver->RandomDataFileChosenL( ETrue, fileName );
+            }
+        else
+            {
+            iObserver->RandomDataFileChosenL( EFalse );
+            }
         }
-    else
-        {
-        iObserver->FileChosenL( EFalse );
-        }
-    delete iSearchArray;
-    iSearchArray = NULL;
-    iObserver = NULL;
     }
 
 // ---------------------------------------------------------------------------
@@ -127,6 +134,7 @@
 
     // init the search array
     delete iSearchArray;
+    iSearchArray = NULL;
     iSearchArray = new(ELeave) CDesCArrayFlat(20);
 
     // wait dialog
@@ -381,11 +389,15 @@
 #endif
 */
 
-TBool CCommandParser::GetRandomDataFilenameL(TDes& aFilename)
+TBool CCommandParser::GetRandomDataFilenameL(MCommandParserObserver *aObserver)
     {    
     LOGSTRING("Creator: CCommandParser::GetRandomDataFilenameL");
     TBool ret = EFalse;
 
+    User::LeaveIfNull( aObserver );
+    iObserver = aObserver;
+    iSelectedItem = 0;
+
     // init the search array
     if (iSearchArray)
     	{
@@ -466,7 +478,7 @@
         // add "default" (resource file) to list
         fileNameArray->AppendL(_L("Default"));
 
-		ret = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select random data file"), fileNameArray, &iSelectedItem, this);
+		ret = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select random data file"), fileNameArray, &iSelectedItem, this, EGetingRandomDataFile);
         CleanupStack::PopAndDestroy(fileNameArray);
         }
     else  // no random data files found from the search paths
--- a/creator/engine/src/creator_scriptparser.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_scriptparser.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -149,6 +149,7 @@
     {
     LOGSTRING2("Creator: CCreatorScriptParser::OnEndDocumentL (Error code: %d)", aErrorCode);
     User::LeaveIfError(aErrorCode);
+    iEngine->SortCommands();
     }
 
 void CCreatorScriptParser::OnStartPrefixMappingL(   const RString& /*aPrefix*/, 
--- a/creator/inc/engine.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/inc/engine.h	Fri Jun 11 13:39:09 2010 +0300
@@ -103,15 +103,24 @@
     {
 public:
     /**
-     * Called when CCommandParser user has choosen some file(script file, random data file)
+     * Called when CCommandParser user has choosen script file
      *
      * @since S60 10.1
      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
      * @param aFileName filename chosen by user
      * @return None.
      */
-    virtual void FileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
+    virtual void ScriptChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
 
+    /**
+     * Called when CCommandParser user has choosen random data file
+     *
+     * @since S60 10.1
+     * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
+     * @param aFileName filename chosen by user
+     * @return None.
+     */
+    virtual void RandomDataFileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
     };
 
 /**
@@ -135,6 +144,10 @@
 
 class CCreatorEngine : public CActive, public MUIObserver, public MCommandParserObserver
 	{
+enum ECreatorEngineState{
+    ECreatorEngineDeleteAllEntries,
+    ECreatorEngineDeleteAllCreatorEntries,
+};
 public:
     
     enum TRandomStringType
@@ -268,14 +281,24 @@
     
 public: // from MCommandParserObserver
     /**
-     * Called when CCommandParser user has choosen some file(script file, random data file)
+     * Called when CCommandParser user has choosen script file
      *
      * @since S60 10.1
      * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
      * @param aFileName filename chosen by user
      * @return None.
      */
-    virtual void FileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
+    virtual void ScriptChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
+    
+    /**
+     * Called when CCommandParser user has choosen random data file
+     *
+     * @since S60 10.1
+     * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
+     * @param aFileName filename chosen by user
+     * @return None.
+     */
+    virtual void RandomDataFileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
     
 public:
     void ExecuteOptionsMenuCommandL(TInt aCommand);
@@ -341,6 +364,8 @@
     void WriteEntryIdsToStoreL( RArray<TUint32>& aEntryIds, const TUid aModuleUid );
     void RemoveStoreL( const TUid aModuleUid );
 	void ProgressDialogCancelledL();
+	
+	void SortCommands();
     
 private:
     // needed by the engine itself
@@ -348,7 +373,6 @@
     CEikonEnv* iEnv;
     //CCreatorAppUi* iAppUi;
     TInt iCurrentEntry;
-    TInt iEntriesToBeCreated;
     TInt iFailedCommands;
 
     CDesCArrayFlat* iSoundFileArray;
--- a/creator/inc/enginewrapper.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/inc/enginewrapper.h	Fri Jun 11 13:39:09 2010 +0300
@@ -103,37 +103,37 @@
 	/**
 	* Create entries query dialog
 	*/
-	TBool EntriesQueryDialog(TInt* aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero = EFalse, MUIObserver* aObserver = NULL, int userData = 0);
+	TBool EntriesQueryDialog(TInt* aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero, MUIObserver* aObserver, TInt aUserData);
 
 	/**
 	* Create time query dialog
 	*/    
-    TBool TimeQueryDialog(TTime* aTime, const TDesC& aPrompt, MUIObserver* aObserver = NULL, int userData = 0);
+    TBool TimeQueryDialog(TTime* aTime, const TDesC& aPrompt, MUIObserver* aObserver, TInt aUserData);
 
 	/**
 	* Create yes or no query dialog
 	*/    
-    TBool YesNoQueryDialog(const TDesC& aPrompt, MUIObserver* aObserver = NULL, int userData = 0);
+    TBool YesNoQueryDialog(const TDesC& aPrompt, MUIObserver* aObserver, int userData);
 	
 	/**
 	* Popup list dialog for selecting item from dialog list
 	*/
-	TBool PopupListDialog(const TDesC& aPrompt, const CDesCArray* aFileNameArray, TInt* aIndex, MUIObserver* aObserver = NULL, TInt aUserData=0); 
+	TBool PopupListDialog(const TDesC& aPrompt, const CDesCArray* aFileNameArray, TInt* aIndex, MUIObserver* aObserver, TInt aUserData); 
 	
 	/**
 	* Directory query dialog
 	*/
-	bool DirectoryQueryDialog(const TDesC& aPrompt, TFileName& aDirectory);
+	TBool DirectoryQueryDialog(const TDesC& aPrompt, TDes& aDirectory, MUIObserver* aObserver, TInt aUserData);
 	
 	/**
 	* Create list query single-selection dialog
 	*/
-	TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt* aSeletedItem, MUIObserver* aObserver = NULL, TInt aUserData=0);
+	TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt* aSeletedItem, MUIObserver* aObserver, TInt aUserData);
 
 	/**
 	* Create list query multi-selection dialog
 	*/
-	TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* aObserver = NULL, TInt aUserData=0);
+	TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* aObserver, TInt aUserData);
 	
 	
 	/**
--- a/creator/inc/notifications.h	Thu May 27 12:52:19 2010 +0300
+++ b/creator/inc/notifications.h	Fri Jun 11 13:39:09 2010 +0300
@@ -56,31 +56,6 @@
      */
 	static HbProgressDialog* showProgressBar(const QString& text, int max);
 	
-	/**
-	* Entries query dialog
-	*/
-	static bool entriesQueryDialog(int& numberOfEntries, const QString& text, bool acceptsZero);
-    
-	/**
-	* Time query dialog
-	*/
-    static bool timeQueryDialog(QDate& date, const QString& text);
-
-	/**
-	* Yes or No query dialog
-	*/    
-    static bool yesNoQueryDialog(const QString& text);
-	
-	/**
-	* popup list dialog for selecting one item from list
-	*/
-	static void popupListDialog(const QString& text, QStringList& items, HbAbstractItemView::SelectionMode mode, QObject* receiver = 0, const char* member = 0);
-	
-	/**
-	* directory query dialog
-	*/
-	static bool directoryQueryDialog(const QString& text, QString& directory);
-
     /**
      * shows global HbGlobalCommonNote type note
      */
@@ -129,12 +104,16 @@
     Q_OBJECT
 public:
     static void launch(const QString& label, int* value, bool acceptZero,  MUIObserver* observer, int userData) throw( std::exception );
+    static void launch(const QString& label, TDes& value,  MUIObserver* observer, int userData) throw( std::exception );
 protected:
-    CreatorInputDialog(int*value, MUIObserver* observer, int userData);
+    CreatorInputDialog(int* value, MUIObserver* observer, int userData);
+    CreatorInputDialog(TDes& value, MUIObserver* observer, int userData);
 protected slots:
     void DialogClosed(HbAction*);
 private:
-    int *mValue;
+    int *mIntValue;
+    TDes& mStrValue;
+    TBuf<1> mDummy;
 };
 
 class CreatorSelectionDialog : public HbSelectionDialog, public CreatorDialog
--- a/creator/src/engine.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/src/engine.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -58,8 +58,6 @@
 _LIT(KEDriveError, "Not available");
 _LIT(KTempPathDrive, "d");
 _LIT(KTempPath, ":\\Creator\\");
-//_LIT(KSavingText, "Saving");
-_LIT(KDeletingText, "Deleting");
 const TInt KRegisterDrive = EDriveC;
 _LIT(KRegisterFileName, "creator_created_items.dat");
 _LIT(KResourceFileName, "z:\\Resource\\apps\\datacreator.RSC");
@@ -486,18 +484,17 @@
             iNotepad->DeleteAllL();
             break;
             }
-/*
+
         case ECmdDeleteIMPSs:
             {
-            iIMPS->DeleteAllL();
+//            iIMPS->DeleteAllL();
             break;
             }
         case ECmdDeleteCreatorIMPSs:
             {
-            iIMPS->DeleteAllCreatedByCreatorL();
+//            iIMPS->DeleteAllCreatedByCreatorL();
             break;
-            }
-*/
+            }            
         case ECmdDeleteBrowserBookmarks:
             {
             iBrowser->DeleteAllBookmarksL();
@@ -652,6 +649,12 @@
     }
 
 // ---------------------------------------------------------------------------
+void CCreatorEngine::SortCommands()
+	{
+	TKeyArrayFix iBufKey(_FOFF(TCommand, iCommandId),ECmpTInt);
+	iCommandArray->Sort(iBufKey);
+	}
+// ---------------------------------------------------------------------------
 
 // This callback function is called when cancel button of the progress bar was pressed
 
@@ -714,9 +717,6 @@
     // start from the beginning
     iCurrentEntry = 0;
 
-    // we'll retrieve a correct number for this later
-    iEntriesToBeCreated = 0;
-
     // init the command array
     __ASSERT_ALWAYS(!iCommandArray, User::Panic(_L("iCommandArray"), 701));
     iCommandArray = new(ELeave) CCommandArray(10000);
@@ -814,13 +814,7 @@
     iTimer.Cancel();
     }
 
-// ---------------------------------------------------------------------------
-void CCreatorEngine::QueryDialogClosedL( TBool /*aPositiveAction*/, TInt /*aUserData*/ )
-    {
-    
-    }
-
-void CCreatorEngine::FileChosenL( TBool aSuccess, const TDesC& aFileName )
+void CCreatorEngine::ScriptChosenL( TBool aSuccess, const TDesC& aFileName )
     {
     if( aSuccess )
         {
@@ -855,8 +849,6 @@
             msgBuf.Format(KErrMsg, parseErr);
             iEngineWrapper->ShowErrorMessage(msgBuf);
             ShutDownEnginesL();
-            delete iCommandParser;
-            iCommandParser = NULL;
             return;
             }         
         }
@@ -882,6 +874,7 @@
 
     // use the command parser module to init the command array from a script file
     delete iCommandParser;
+    iCommandParser = NULL;
     iCommandParser = CCommandParser::NewL(this);
     TBool ret = EFalse;
     TRAPD(err, ret = iCommandParser->OpenScriptL( this ) );
@@ -936,6 +929,63 @@
     }
 
 // ---------------------------------------------------------------------------
+void CCreatorEngine::QueryDialogClosedL( TBool aPositiveAction, TInt aUserData )
+    {
+    LOGSTRING("Creator: CCreatorEngine::QueryDialogClosedL");
+    
+    if( aPositiveAction == EFalse )
+        {
+        ShutDownEnginesL();
+        return;
+        }
+
+    switch(aUserData)
+        {
+        case ECreatorEngineDeleteAllEntries:
+            AppendToCommandArrayL( ECmdDeleteContacts, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteContactGroups, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCalendarEntries, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteBrowserBookmarks, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteBrowserBookmarkFolders, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteBrowserSavedPages, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteBrowserSavedPageFolders, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteLogs, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteMessages, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteIAPs, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteIMPSs, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteNotes, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteLandmarks, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
+            
+            // started exucuting delete commands
+            ExecuteFirstCommandL( KDeletingText );
+            break;
+        case ECreatorEngineDeleteAllCreatorEntries:
+            AppendToCommandArrayL( ECmdDeleteCreatorContacts, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorContactGroups, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorCalendarEntries, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarks, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarkFolders, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPages, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPageFolders, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorLogs, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorMessages, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorIAPs, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorIMPSs, NULL, 1 );
+            AppendToCommandArrayL( ECmdDeleteCreatorLandmarks, NULL, 1 );
+            
+            // started exucuting delete commands
+            ExecuteFirstCommandL( KDeletingText );
+            break;
+        default:
+            //some error
+             ShutDownEnginesL();
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
 
 void CCreatorEngine::ExecuteOptionsMenuCommandL(TInt aCommand)
     {
@@ -1106,27 +1156,7 @@
         {
         if ( aCommand == ECmdDeleteAllEntries )
             {
-            if ( iEngineWrapper->YesNoQueryDialog( _L("Delete all entries?") ) )
-                {
-                AppendToCommandArrayL( ECmdDeleteContacts, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteContactGroups, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCalendarEntries, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserBookmarks, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserBookmarkFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserSavedPages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteBrowserSavedPageFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteLogs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteMessages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteIAPs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteIMPSs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteNotes, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteLandmarks, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
-                
-                // started exucuting delete commands
-                ExecuteFirstCommandL( KDeletingText );
-                }
-            else
+            if ( !iEngineWrapper->YesNoQueryDialog( _L("Delete all entries?"), this, ECreatorEngineDeleteAllEntries) )
                 {
                 // cancelled, free resources
                 ShutDownEnginesL();
@@ -1134,58 +1164,23 @@
             }
         else if ( aCommand == ECmdDeleteAllCreatorEntries )
             {
-            if ( iEngineWrapper->YesNoQueryDialog( _L("Delete all entries created with Creator?") ) )
-                {
-                AppendToCommandArrayL( ECmdDeleteCreatorContacts, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorContactGroups, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorCalendarEntries, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarks, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarkFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPageFolders, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorLogs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorMessages, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorIAPs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorIMPSs, NULL, 1 );
-                AppendToCommandArrayL( ECmdDeleteCreatorLandmarks, NULL, 1 );
-                
-                // started exucuting delete commands
-                ExecuteFirstCommandL( KDeletingText );
-                }
-            else
+            if ( !iEngineWrapper->YesNoQueryDialog( _L("Delete all entries created with Creator?"), this, ECreatorEngineDeleteAllCreatorEntries ) )
                 {
                 // cancelled, free resources
                 ShutDownEnginesL();
                 }
             }
-        else if ( iUsedOptionsMenuModule->AskDataFromUserL( aCommand )  )
+        else if ( !iUsedOptionsMenuModule->AskDataFromUserL( aCommand )  )
             {
-            // add this command to command array
-//            AppendToCommandArrayL( aCommand, NULL, 1 );
-    
-            // started exucuting commands
-//            ExecuteFirstCommandL( KDeletingText );        
-            }
-        else
-            {
-            // cancelled, free resources
+            // cancelled or error, free resources
             ShutDownEnginesL();
             }
         }
 
     // ask user data, if query accepted start processing...
-    else if (iUsedOptionsMenuModule->AskDataFromUserL(aCommand))
+    else if (!iUsedOptionsMenuModule->AskDataFromUserL(aCommand))
         {
-        // add this command to command array
-        //AppendToCommandArrayL(aCommand, NULL, iEntriesToBeCreated);
-
-        // started exucuting commands
-        //ExecuteFirstCommandL( KSavingText );
-        }
-     else
-        {
-        // cancelled, free resources
+        // cancelled or error, free resources
         ShutDownEnginesL();
         }
     }
@@ -1240,20 +1235,23 @@
         }
      
     }
+// ---------------------------------------------------------------------------
+void CCreatorEngine::RandomDataFileChosenL( TBool aSuccess, const TDesC& aFileName )
+    {
+    if( aSuccess )
+        {
+        GetRandomDataFromFileL( aFileName );
+        }
+    }
 
 // ---------------------------------------------------------------------------
 
 TBool CCreatorEngine::GetRandomDataL()
 	{
-    TFileName fileName;
-    CCommandParser* commandParser = CCommandParser::NewLC(this);
-	TBool ret = commandParser->GetRandomDataFilenameL(fileName);
-    CleanupStack::PopAndDestroy(commandParser);
-    if (ret)
-        {
-        ret = GetRandomDataFromFileL(fileName);
-        }
-    return ret;
+    delete iCommandParser;
+    iCommandParser = NULL;
+    iCommandParser = CCommandParser::NewL( this );
+	return iCommandParser->GetRandomDataFilenameL( this );
 	}
 
 // ---------------------------------------------------------------------------
--- a/creator/src/enginewrapper.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/src/enginewrapper.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -116,6 +116,10 @@
 void EngineWrapper::ShowProgressBar(const TDesC& aPrompt, int aMax)
 {
 	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
+	if(iProgressDialog){
+        delete iProgressDialog;
+        iProgressDialog = NULL;
+	}
     iProgressDialog = Notifications::showProgressBar(text, aMax);
 	connect(iProgressDialog, SIGNAL(cancelled()), this, SLOT(ProgressDialogCancelled()));
 }
@@ -124,7 +128,8 @@
 
 void EngineWrapper::IncrementProgressbarValue()
 {
-    iProgressDialog->setProgressValue(iProgressDialog->progressValue() + 1);
+    if(iProgressDialog)
+        iProgressDialog->setProgressValue(iProgressDialog->progressValue() + 1);
 }
 
 // ---------------------------------------------------------------------------
@@ -132,8 +137,9 @@
 void EngineWrapper::CloseProgressbar()
 {
     if(iProgressDialog){
+        disconnect(iProgressDialog, SIGNAL(cancelled()), this, SLOT(ProgressDialogCancelled()));
         delete iProgressDialog;
-        iProgressDialog = 0;
+        iProgressDialog = NULL;
     }
 }
 
@@ -226,7 +232,6 @@
 				  aFileNameArray->MdcaPoint(i).Ptr(),
 				  aFileNameArray->MdcaPoint(i).Length()));
 	}
-	// TODO: HbSelectionDialog handle close & user choice
 	TBool success(EFalse);
     try{
         CreatorSelectionDialog::launch(text, itemList, aIndex, aObserver, aUserData);
@@ -241,16 +246,19 @@
 
 // ---------------------------------------------------------------------------	
 
-bool EngineWrapper::DirectoryQueryDialog(const TDesC& aPrompt, TFileName& aDirectory)
+TBool EngineWrapper::DirectoryQueryDialog(const TDesC& aPrompt, TDes& aDirectory, MUIObserver* aObserver, TInt aUserData)
 {
 	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
-	QString directory = QString((QChar*)aDirectory.Ptr(), aDirectory.Length());
-	bool ret = Notifications::directoryQueryDialog(text, directory);
-	if (ret == true) {
-		aDirectory = TFileName(directory.utf16());
-	}
-	return ret;
-
+	TBool success(EFalse);
+    try{
+        CreatorInputDialog::launch(text, aDirectory, aObserver, aUserData);
+        success = ETrue;
+    }
+    catch (std::exception& e)
+        {
+        Notifications::error( QString("exception: ")+e.what() );
+        }
+    return success;
 }
 
 
@@ -314,7 +322,6 @@
 			return ret;
 		}
 	}
-    // TODO: HbSelectionDialog handle close & user choice
 	TBool success(EFalse);
     try{
         CreatorSelectionDialog::launch(text, itemList, aIndex, aObserver, aUserData);
--- a/creator/src/notifications.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/src/notifications.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -75,6 +75,7 @@
 	HbProgressDialog *note = new HbProgressDialog(HbProgressDialog::ProgressDialog);
     note->setText(text);
     note->setMaximum(max);
+    note->setAutoClose(false);
     note->show();
     return note;
 
@@ -87,42 +88,6 @@
     showMessageBox(type, text, QString("Creator"), timeout);
 }
 
-// ---------------------------------------------------------------------------
-
-bool Notifications::directoryQueryDialog(const QString& text, QString& directory)
-{
-	bool err = false;
-    HbDialog *popup = new HbDialog();
-    popup->setDismissPolicy(HbPopup::TapOutside);
-    popup->setTimeout(HbPopup::NoTimeout);
-	
-	HbLabel *title = new HbLabel();
-    HbLineEdit *edit = new HbLineEdit();
-	HbAction *actionOk = new HbAction("Ok");
-	HbAction *actionCancel = new HbAction("Cancel");
-	
-	title->setPlainText(text);
-	popup->setHeadingWidget(title);
-	popup->setContentWidget(edit);
-	edit->setMaxLength(256);
-	edit->setText(directory);
-	edit->setSelection(0, directory.length());
-	
-	popup->setPrimaryAction(actionOk);
-    popup->setSecondaryAction(actionCancel);
-
-    // Launch popup syncronously
-    popup->setAttribute(Qt::WA_DeleteOnClose);
-    // TODO: handle dialog close & user input
-    popup->open();
-
-	// continue if ok selected and valid user input exists in line editor
-    /*if (action && action->text() == "Ok" && edit->text() != "") {
-		directory = edit->text();
-		err = true;
-	}*/
-	return err;
-}
 
 // ---------------------------------------------------------------------------
 
@@ -155,12 +120,21 @@
 CreatorInputDialog::CreatorInputDialog(int* value, MUIObserver* module, int userData) : 
     HbInputDialog(NULL),
     CreatorDialog(module, userData),
-    mValue(value)
+    mIntValue(value), 
+    mStrValue(mDummy)// will not be used
 {
     if(!value)
         throw std::invalid_argument("value cannot be the null!");
 }
 
+CreatorInputDialog::CreatorInputDialog(TDes& value, MUIObserver* module, int userData) : 
+    HbInputDialog(NULL),
+    CreatorDialog(module, userData),
+    mIntValue(NULL),
+    mStrValue(value)
+{
+}
+
 void CreatorInputDialog::launch(const QString& label, int* value, bool acceptsZero, MUIObserver* observer, int userData) throw( std::exception )
 {
     CreatorInputDialog* dlg = new CreatorInputDialog(value, observer, userData);
@@ -184,12 +158,29 @@
     dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
 }
 
+void CreatorInputDialog::launch(const QString& label, TDes& value, MUIObserver* observer, int userData) throw( std::exception )
+{
+    CreatorInputDialog* dlg = new CreatorInputDialog(value, observer, userData);
+    dlg->setPromptText(label);
+    dlg->lineEdit()->setMaxLength(value.MaxLength());
+    dlg->setValue(QString::fromUtf16(value.Ptr(), value.Length()));
+    dlg->lineEdit()->setSelection(0, dlg->value().toString().length());
+    dlg->setInputMode(TextInput);
+    dlg->setAttribute(Qt::WA_DeleteOnClose);
+    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
+}
+
 void CreatorInputDialog::DialogClosed(HbAction *action)
 {
     TBool PositiveAction(EFalse);
     if(action && (action->softKeyRole()==QAction::PositiveSoftKey || !action->text().compare("ok", Qt::CaseInsensitive))){
-        bool ok = false;
-        *mValue = value().toInt(&ok);
+        bool ok = true;
+        if( inputMode() == IntInput )
+            *mIntValue = value().toInt(&ok);
+        else if( inputMode() == TextInput && mStrValue.MaxLength() >= value().toString().length() )
+            mStrValue.Copy(value().toString().utf16());
+        else
+            ok = false;
         PositiveAction = ok ? ETrue : EFalse;
     }
     NotifyObserver(PositiveAction);
--- a/filebrowser/engine/FB.hrh	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/engine/FB.hrh	Fri Jun 11 13:39:09 2010 +0300
@@ -274,4 +274,15 @@
     EFileChecksumsSHA1
     };
 
+enum TListingMode
+    {
+    ENormalEntries = 0,
+    ESearchResults,
+    EOpenFiles,
+    EMsgAttachmentsInbox,
+    EMsgAttachmentsDrafts,
+    EMsgAttachmentsSentItems,
+    EMsgAttachmentsOutbox
+    };
+
 #endif      // FILEBROWSER_HRH
--- a/filebrowser/engine/FBFileUtils.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/engine/FBFileUtils.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -204,7 +204,7 @@
 
 // --------------------------------------------------------------------------------------------
 
-void CFileBrowserFileUtils::StartExecutingCommandsL(const TDesC& /*aLabel*/)
+void CFileBrowserFileUtils::StartExecutingCommandsL(const TDesC& aLabel)
     {
     if (iCommandArray->Count() >= 2)
         {
@@ -217,6 +217,8 @@
 //        iProgressInfo->SetFinalValue( CommandArrayCount() );
 //        iProgressDialog->RunLD();
 //        iProgressDialog->MakeVisible( ETrue );        
+        iEngine->FileBrowserUI()->ShowProgressDialog(aLabel, 0, CommandArrayCount());
+        isProgressDialog = ETrue;
         }
     else if (iCommandArray->Count() >= 1)
         {
@@ -226,6 +228,8 @@
 //        iWaitDialog->PrepareLC(R_GENERAL_WAIT_NOTE);
 //        iWaitDialog->SetTextL( aLabel );
 //        iWaitDialog->RunLD();
+        iEngine->FileBrowserUI()->ShowWaitDialog(aLabel);
+        isWaitDialog = ETrue;
         }
     else
         {
@@ -251,6 +255,15 @@
     __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("FileUtils:IsActive"), 333));
 
     // execute a command after a very short delay (25ms)
+    if (isWaitDialog)
+        {
+        iEngine->FileBrowserUI()->ProcessEvents();
+        }
+    if (isProgressDialog)
+        {
+        TInt newValue = iCurrentEntry;
+        iEngine->FileBrowserUI()->SetProgressValue(newValue);
+        }
     iTimer.After(iStatus, 25);
     SetActive();
     }
@@ -365,6 +378,16 @@
         iFileOps->DeActivateSecureBackUpViaFileOp();
 
         // dismiss any wait/progress dialogs        
+        if (isWaitDialog)
+            {
+            iEngine->FileBrowserUI()->CancelWaitDialog();
+            isWaitDialog = EFalse;
+            }
+        if (isProgressDialog)
+            {
+            iEngine->FileBrowserUI()->CancelProgressDialog();
+            isProgressDialog = EFalse;
+            }
 //        if (iWaitDialog)
 //            {
 //            TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); 
@@ -422,29 +445,29 @@
 
         RefreshViewL();
 
-		}
+            }
 	else
-		{
-		// maintain requests
-		iCurrentEntry++;
-
-        //LOGSTRING2("Creator: CCreatorEngine::CheckForMoreCommandsL iCurrentEntry=%d", iCurrentEntry);
-
-        ExecuteCommand();
-		}
+            {
+            // maintain requests
+            iCurrentEntry++;
+
+            //LOGSTRING2("Creator: CCreatorEngine::CheckForMoreCommandsL iCurrentEntry=%d", iCurrentEntry);
+
+            ExecuteCommand();
+            }
     }    
 // --------------------------------------------------------------------------------------------
 
 // This callback function is called when cancel button of the progress bar was pressed
-void CFileBrowserFileUtils::DialogDismissedL(TInt aButtonId)
+void CFileBrowserFileUtils::DialogDismissedL(/*TInt aButtonId*/)
     {
 //    iProgressDialog = NULL;
 //    iProgressInfo = NULL;
 //    iWaitDialog = NULL;
     
     // check if cancel button was pressed
-    if (aButtonId == EAknSoftkeyCancel)
-        {
+//    if (aButtonId == EAknSoftkeyCancel)
+//        {
         // cancel the active object, command executer 
         Cancel();
         
@@ -452,8 +475,10 @@
         
         ResetCommandArray();
 
+        isProgressDialog = EFalse;
+
         iEngine->FileBrowserUI()->ShowInformationNote(_L("Cancelled"), _L(""));
-        }
+//        }
     }
     
 // --------------------------------------------------------------------------------------------
--- a/filebrowser/engine/FBFileUtils.h	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/engine/FBFileUtils.h	Fri Jun 11 13:39:09 2010 +0300
@@ -28,6 +28,7 @@
 #include <msvapi.h>
 #include <AknProgressDialog.h>
 #include <tz.h>
+#include "FB.hrh"
 
 _LIT(KIRAppPath, "z:\\sys\\bin\\irapp.exe");
 _LIT(KBTAppPath, "z:\\sys\\bin\\btui.exe");
@@ -181,7 +182,7 @@
 
 
 
-class CFileBrowserFileUtils : public CActive, public MAknServerAppExitObserver, public MMsvSessionObserver, public MProgressDialogCallback 
+class CFileBrowserFileUtils : public CActive, public MAknServerAppExitObserver, public MMsvSessionObserver//, public MProgressDialogCallback
 	{
 private:
     enum TState // active object states
@@ -195,17 +196,6 @@
     	EClipBoardModeCopy
     	};
 
-    enum TListingMode
-    	{
-    	ENormalEntries = 0,
-    	ESearchResults,
-    	EOpenFiles,
-    	EMsgAttachmentsInbox,
-    	EMsgAttachmentsDrafts,
-    	EMsgAttachmentsSentItems,
-    	EMsgAttachmentsOutbox
-    	};
-    	    	
 public:
 	static CFileBrowserFileUtils* NewL(CEngine* aEngine);
 	~CFileBrowserFileUtils();
@@ -216,7 +206,7 @@
 
 private: // from CActive
 	void RunL();
-    TInt RunError(TInt aError);
+        TInt RunError(TInt aError);
 	void DoCancel();
 
 private: // from MAknServerAppExitObserver
@@ -225,8 +215,8 @@
 private: // from MMsvSessionObserver
     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
 
-private:  //from MProgressDialogCallback
-    void DialogDismissedL(TInt aButtonId);  
+public:  //from MProgressDialogCallback
+    void DialogDismissedL(/*TInt aButtonId*/);
     
 public: // command handling
     void StartExecutingCommandsL(const TDesC& aLabel);
@@ -343,6 +333,7 @@
     inline CFileEntryList* CurrentSelectionList() { return iCurrentSelectionList; }
     inline TBool IsDriveListViewActive() { return iCurrentPath==KNullDesC && iListingMode==ENormalEntries; }
     inline TBool IsNormalModeActive() { return iListingMode==ENormalEntries; }
+    inline TListingMode ListingMode() { return iListingMode; }
     inline TFileName CurrentPath() { return iCurrentPath; }
 	
     inline TSearchAttributes GetSearchAttributes(){ return iSearchAttributes; };
@@ -356,6 +347,8 @@
     CEngine*                        iEngine;
     CFileBrowserFileOps*            iFileOps;
 //    CAknWaitDialog*                 iWaitDialog;
+    TBool                           isWaitDialog;
+    TBool                           isProgressDialog;
 //    CAknProgressDialog*             iProgressDialog;
     CEikProgressInfo*               iProgressInfo;
     CCommandArray*                  iCommandArray;
--- a/filebrowser/engine/engine.h	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/engine/engine.h	Fri Jun 11 13:39:09 2010 +0300
@@ -78,10 +78,10 @@
 class MFileBrowserUI
 {
 public:
-    /**
-      * Method from getting current index
-      * @return current index.
-      */
+//    /**
+//      * Method from getting current index
+//      * @return current index.
+//      */
 //    virtual TInt QueryCurrentItemIndex() = 0;
 
     /**
@@ -106,14 +106,26 @@
      */
     virtual void ShowConfirmationNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
 
-//    /**
-//     * Shows progress bar with text
-//     * @param aText A text to be shown at top of the progress bar.
-//     * @param aMinimum A minimum progress bar value.
-//     * @param aMaximum A maximum progress bar value.
-//     * @return None.
-//     */
-//    virtual void ShowProgressBar(const TDesC& aText, TInt aMinimum, TInt aMaximum ) = 0;
+    /**
+     * Shows progress bar with text
+     * @param aText A text to be shown at top of the progress bar.
+     * @param aMinimum A minimum progress bar value.
+     * @param aMaximum A maximum progress bar value.
+     * @return None.
+     */
+    virtual void ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum ) = 0;
+
+    /**
+     * Cancel progress dialog
+     * @return None.
+     */
+    virtual void CancelProgressDialog() = 0;
+
+    /**
+      * Set progress dialog value
+      * @param aValue A vaule to be shown at top of the progress dialog.
+      */
+    virtual void SetProgressValue(TInt aValue) = 0;
 //
 //    /**
 //     * Sets progress bar value
--- a/filebrowser/group/ReleaseNotes_FileBrowser.txt	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/group/ReleaseNotes_FileBrowser.txt	Fri Jun 11 13:39:09 2010 +0300
@@ -1,7 +1,7 @@
 ===============================================================================
 
-RELEASE NOTES - FILEBROWSER v5.0.0
-RELEASED 23th April 2010
+RELEASE NOTES - FILEBROWSER v5.0.1
+RELEASED 21st May 2010
 
 SUPPORTS S60 3.0+
 
@@ -37,9 +37,11 @@
 
 ===============================================================================
 
-What's New in v5.0.0
+What's New in v5.0.1
 ====================
-- Orbit UI
+- Error fixes
+- All files to text file with file sizes
+- Usability improvements
 
 ===============================================================================
 
@@ -109,6 +111,10 @@
 Version History:
 ================
 
+Version 5.0.0 - 23th April 2010
+-----------------------------
+- Orbit UI
+
 Version 4.5.2 - 10th December 2009
 -----------------------------
 - Fix: UI layout problems fixed
--- a/filebrowser/ui/inc/enginewrapper.h	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/ui/inc/enginewrapper.h	Fri Jun 11 13:39:09 2010 +0300
@@ -81,9 +81,15 @@
     void ShowInformationNote(const TDesC &aDescText, const TDesC &aDescTitle);
     void ShowErrorNote(const TDesC& aDescText, TBool aNoTimeout = EFalse);
     void ShowConfirmationNote(const TDesC& aDescText, TBool aNoTimeout = EFalse);
+
+    void ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum);
+    void CancelProgressDialog();
+    void SetProgressValue(TInt aValue);
+
     void ShowWaitDialog(const TDesC& aText);
     void CancelWaitDialog();
     void ProcessEvents();
+
     TBool ShowConfirmationQuery(const TDesC& aDescText);
 
 public: 
@@ -100,6 +106,7 @@
 
     void startExecutingCommands(const QString &aCommandsExecutionMessage);
     void refreshView();
+    inline TListingMode listingMode() { return mEngine->FileUtils()->ListingMode(); }
 //    TBool IsCurrentDriveReadOnly();
 //    TBool IsCurrentItemDirectory();
     void moveUpOneLevel();
@@ -168,6 +175,7 @@
     void showFileCheckSums(const QModelIndex &aIndex, TFileBrowserCmdFileChecksums checksumType);
 
 private slots:
+        void progressDialogCancelled();
         void waitDialogCancelled();
 
 private:
@@ -176,6 +184,7 @@
     // List of found files results for Ui
     QStringList mFilesFound;
     FileBrowserSettings mSettings;
+    HbProgressDialog *mProgressDialog;
     HbProgressDialog *mWaitDialog;
     };
 
--- a/filebrowser/ui/inc/filebrowserview.h	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/ui/inc/filebrowserview.h	Fri Jun 11 13:39:09 2010 +0300
@@ -25,7 +25,7 @@
 #include <HbMainWindow>
 #include <HbApplication>
 
-#include <QDir>
+#include <QModelIndexList>
 
 // Forward declarations
 class QFileInfo;
@@ -39,6 +39,8 @@
 class HbToolBar;
 class HbLabel;
 class HbDialog;
+class HbAbstractViewItem;
+class HbMenu;
 
 class FileBrowserMainWindow;
 class EditorView;
@@ -55,25 +57,24 @@
     explicit FileBrowserView(FileBrowserMainWindow &mainWindow);
     virtual ~FileBrowserView();
     void init(EngineWrapper *engineWrapper);
-    QModelIndex currentItemIndex();
-    QModelIndexList getSelectedItemsOrCurrentItem();
 
 public slots:
     void refreshList();
 
 private:
     void fileOverwriteDialog();
-    void openListDialog(const QStringList& items, const QString &titleText, QObject* receiver, const char* member);
+    void openListDialog(const QStringList &items, const QString &titleText, QObject *receiver, const char *member);
+
+    void openPropertyDialog(const QStringList &propertyList, const QString &title);
 
-    void openPropertyDialog(const QStringList& propertyList, const QString& title);
+    QModelIndex currentItemIndex();
+    void storeSelectedItemsOrCurrentItem();
 
-    void createToolBar();
     // Menu related methods
     void createMenu();
     void createFileMenu();
     void createEditMenu();
     void createViewMenu();
-    void createDiskAdminMenu();
     void createToolsMenu();
 
     void createSelectionMenuItem();
@@ -81,6 +82,13 @@
     void createAboutMenuItem();
     void createExitMenuItem();
 
+    void createContextMenu();
+    void createFileContextMenu();
+    void createEditContextMenu();
+    void createViewContextMenu();
+    void createDiskAdminContextMenu();
+    void createToolBar();
+
 //    void refreshList();
     void populateFolderContent();
 
@@ -143,10 +151,10 @@
     void doDiskAdminSetDrivePassword(HbAction *);
 
     void diskAdminUnlockDrive();
-    void doDiskAdminUnlockDrive(HbAction *action);
+    void doDiskAdminUnlockDrive(HbAction *);
 
     void diskAdminClearDrivePassword();
-    void doDiskAdminClearDrivePassword(HbAction *action);
+    void doDiskAdminClearDrivePassword(HbAction *);
 
     void diskAdminEraseDrivePassword();
     void doDiskAdminEraseDrivePassword(HbAction *);
@@ -163,10 +171,10 @@
     void doDiskAdminScanDrive(HbAction *);
 
     void diskAdminSetDriveName();
-    void doDiskAdminSetDriveName(HbAction *action);
+    void doDiskAdminSetDriveName(HbAction *);
 
     void diskAdminSetDriveVolumeLabel();
-    void doDiskAdminSetDriveVolumeLabel(HbAction*);
+    void doDiskAdminSetDriveVolumeLabel(HbAction *);
 
     void diskAdminEjectDrive();
     void diskAdminDismountDrive();
@@ -193,14 +201,14 @@
     void toolsDisableExtendedErrors();
     void toolsDumpMsgStoreWalk();
     void toolsEditDataTypes();
-    void toolsEnableExtendedErrors ();
+    void toolsEnableExtendedErrors();
 
     void toolsErrorSimulateLeave();
-    void doToolsErrorSimulateLeave(HbAction *action);
+    void doToolsErrorSimulateLeave(HbAction *);
 
     void toolsErrorSimulatePanic();
-    void doToolsErrorSimulatePanicCode(HbAction *action);
-    void doToolsErrorSimulatePanic(HbAction *action);
+    void doToolsErrorSimulatePanicCode(HbAction *);
+    void doToolsErrorSimulatePanic(HbAction *);
 
     void toolsErrorSimulateException();
     void doToolsErrorSimulateException(HbAction *);
@@ -233,11 +241,13 @@
 private slots:
     void itemHighlighted(const QModelIndex &index);
     //void itemSelected(const QModelIndex &index);
-    void updateMenu();
-    void selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/);
+    void updateOptionMenu();
+    void updateContextMenu();
+    void selectionChanged(const QItemSelection &, const QItemSelection &);
     void activated(const QModelIndex& index);
     void activateSelectionMode();
     void deActivateSelectionMode();
+    void onLongPressed(HbAbstractViewItem *, QPointF);
 
     void fileOpen(HbAction *);
     void fileOverwrite(HbAction *);
@@ -252,15 +262,14 @@
     HbLabel *mNaviPane;
     QGraphicsLinearLayout *mMainLayout;
 
-    QString mDirectory;
-    // selected path
-    QString mSelectedFilePath;
-    // initial path
-    //QDir mInitDirPath;
     // file info contains all needed information of selected file from file model
-    QModelIndexList mClipboardIndices;
+    QModelIndexList mClipboardIndexes;
+    QModelIndexList mSelectionIndexes;
+
     FileBrowserModel *mFileBrowserModel;
-    MenuAction mFileViewMenuActions;
+    OptionMenuActions mOptionMenuActions;
+    ContextMenuActions mContextMenuActions;
+    HbMenu *mContextMenu;
     HbAction *mToolbarBackAction;
 
     // flags
@@ -270,6 +279,7 @@
     bool mRemoveFileAfterCopied;
     bool mClipBoardInUse;
     bool mFolderContentChanged;
+    QModelIndex mCurrentIndex;
 
     // temporarily storage
     QString mOldPassword;
--- a/filebrowser/ui/inc/menuaction.h	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/ui/inc/menuaction.h	Fri Jun 11 13:39:09 2010 +0300
@@ -21,11 +21,10 @@
 class HbMenu;
 class HbAction;
 
-class MenuAction
+class OptionMenuActions
 {
 public:
-    MenuAction() :
-            //NoAction = 0,
+    OptionMenuActions() :
             mFileMenu(0),
             mFileBackMoveUp(0),
             mFileOpenDrive(0),
@@ -114,10 +113,9 @@
 
     }
 
-    ~MenuAction() { }
+    ~OptionMenuActions() { }
 public:
     //File menu operations
-    //NoAction = 0,
     HbMenu *mFileMenu;
     HbAction *mFileBackMoveUp;
     HbAction *mFileOpenDrive;
@@ -219,41 +217,40 @@
 };
 
 
-class FileViewDriveContextMenu
+class ContextMenuActions
 {
 public:
-    FileViewDriveContextMenu() :
-//            //NoAction = 0,
-//            mFileMenu(0),
-//            mFileBackMoveUp(0),
-//            mFileOpenDrive(0),
-//            mFileOpenDirectory(0),
-//            mFileSearch(0),
-//            mFileNewMenu(0),
-//            mFileNewFile(0),
-//            mFileNewDirectory(0),
-//            mFileDelete(0),
-//            mFileRename(0),
-//            mFileTouch(0),
-//            mFileProperties(0),
-//            mFileChecksumsMenu(0),
-//            mFileChecksumsMD5(0),
-//            mFileChecksumsMD2(0),
-//            mFileChecksumsSHA1(0),
-//            mFileSetAttributes(0),
-//            //Edit -
-//            mEditMenu(0),
+    ContextMenuActions() :
+            mFileMenu(0),
+            mFileBackMoveUp(0),
+            mFileOpenDrive(0),
+            mFileOpenDirectory(0),
+            mFileSearch(0),
+            mFileNewMenu(0),
+            mFileNewFile(0),
+            mFileNewDirectory(0),
+            mFileDelete(0),
+            mFileRename(0),
+            mFileTouch(0),
+            mFileProperties(0),
+            mFileChecksumsMenu(0),
+            mFileChecksumsMD5(0),
+            mFileChecksumsMD2(0),
+            mFileChecksumsSHA1(0),
+            mFileSetAttributes(0),
+            //Edit -
+            mEditMenu(0),
 //            mEditSnapShotToE(0),
-//            mEditCut(0),
-//            mEditCopy(0),
-//            mEditPaste(0),
-//            mEditCopyToFolder(0),
-//            mEditMoveToFolder(0),
+            mEditCut(0),
+            mEditCopy(0),
+            mEditPaste(0),
+            mEditCopyToFolder(0),
+            mEditMoveToFolder(0),
 //            mEditSelect(0),
 //            mEditUnselect(0),
 //            mEditSelectAll(0),
 //            mEditUnselectAll(0),
-//            // View -
+            // View -
 //            mViewMenu(0),
 //            mViewFilterEntries(0),
 //            mViewRefresh(0),
@@ -308,36 +305,35 @@
 
     }
 
-    ~FileViewDriveContextMenu() { }
+    ~ContextMenuActions() { }
 public:
     //File menu operations
-    //NoAction = 0,
-//    HbMenu *mFileMenu;
-//    HbAction *mFileBackMoveUp;
-//    HbAction *mFileOpenDrive;
-//    HbAction *mFileOpenDirectory;
-//    HbAction *mFileSearch;
-//    HbMenu *mFileNewMenu;
-//    HbAction *mFileNewFile;
-//    HbAction *mFileNewDirectory;
-//    HbAction *mFileDelete;
-//    HbAction *mFileRename;
-//    HbAction *mFileTouch;
-//    HbAction *mFileProperties;
-//    HbMenu *mFileChecksumsMenu;
-//    HbAction *mFileChecksumsMD5;
-//    HbAction *mFileChecksumsMD2;
-//    HbAction *mFileChecksumsSHA1;
-//    HbAction *mFileSetAttributes;
-//
-//    //Edit -
-//    HbMenu *mEditMenu;
+    HbMenu *mFileMenu;
+    HbAction *mFileBackMoveUp;
+    HbAction *mFileOpenDrive;
+    HbAction *mFileOpenDirectory;
+    HbAction *mFileSearch;
+    HbMenu *mFileNewMenu;
+    HbAction *mFileNewFile;
+    HbAction *mFileNewDirectory;
+    HbAction *mFileDelete;
+    HbAction *mFileRename;
+    HbAction *mFileTouch;
+    HbAction *mFileProperties;
+    HbMenu *mFileChecksumsMenu;
+    HbAction *mFileChecksumsMD5;
+    HbAction *mFileChecksumsMD2;
+    HbAction *mFileChecksumsSHA1;
+    HbAction *mFileSetAttributes;
+
+    //Edit -
+    HbMenu *mEditMenu;
 //    HbAction *mEditSnapShotToE;
-//    HbAction *mEditCut;
-//    HbAction *mEditCopy;
-//    HbAction *mEditPaste;
-//    HbAction *mEditCopyToFolder;
-//    HbAction *mEditMoveToFolder;
+    HbAction *mEditCut;
+    HbAction *mEditCopy;
+    HbAction *mEditPaste;
+    HbAction *mEditCopyToFolder;
+    HbAction *mEditMoveToFolder;
 //    HbAction *mEditSelect;
 //    HbAction *mEditUnselect;
 //    HbAction *mEditSelectAll;
@@ -407,168 +403,5 @@
 //    HbAction *mToolsShowOpenFilesHere;
 };
 
-class FileViewFileContextMenu
-{
-public:
-    FileViewFileContextMenu() :
-            //NoAction = 0,
-            mFileMenu(0),
-            mFileBackMoveUp(0),
-//            mFileOpenDrive(0),
-//??            mFileOpenDirectory(0),
-//            mFileSearch(0),
-            mFileNewMenu(0),
-            mFileNewFile(0),
-            mFileNewDirectory(0),
-            mFileDelete(0),
-            mFileRename(0),
-            mFileTouch(0),
-            mFileProperties(0),
-            mFileChecksumsMenu(0),
-            mFileChecksumsMD5(0),
-            mFileChecksumsMD2(0),
-            mFileChecksumsSHA1(0),
-            mFileSetAttributes(0),
-            //Edit -
-            mEditMenu(0),
-//??            mEditSnapShotToE(0),
-            mEditCut(0),
-            mEditCopy(0),
-            mEditPaste(0),
-            mEditCopyToFolder(0),
-            mEditMoveToFolder(0)
-//            mEditSelect(0),
-//            mEditUnselect(0),
-//            mEditSelectAll(0),
-//            mEditUnselectAll(0),
-//            // View -
-//            mViewMenu(0),
-//            mViewFilterEntries(0),
-//            mViewRefresh(0),
-//            // Tools -
-//            mToolsMenu(0),
-//            mToolsAllAppsToTextFile(0),
-//            mToolsAllFilesToTextFile(0),
-//            mToolsAvkonIconCacheMenu(0),
-//            mToolsAvkonIconCacheEnable(0),
-//            mToolsAvkonIconCacheDisable(0),
-//            mToolsDisableExtendedErrors(0),
-//            mToolsDumpMsgStoreWalk(0),
-//            mToolsEditDataTypes(0),
-//            mToolsEnableExtendedErrors(0),
-//            mToolsErrorSimulateMenu(0),
-//            mToolsErrorSimulateLeave(0),
-//            mToolsErrorSimulatePanic(0),
-//            mToolsErrorSimulateException(0),
-//            mToolsMessageAttachmentsMenu(0),
-//            mToolsMessageInbox(0),
-//            mToolsMessageDrafts(0),
-//            mToolsMessageSentItems(0),
-//            mToolsMessageOutbox(0),
-//            //    mLocalConnectivityMenu(0),
-//            //    mToolsLocalConnectivityActivateInfrared(0),
-//            //    mToolsLocalConnectivityLaunchBTUI(0),
-//            //    mToolsLocalConnectivityLaunchUSBUI(0),
-//            mToolsMemoryInfo(0),
-//            mToolsSecureBackupMenu(0),
-//            mToolsSecureBackStart(0),
-//            mToolsSecureBackRestore(0),
-//            mToolsSecureBackStop(0),
-//            mToolsSetDebugMask(0),
-//            mToolsShowOpenFilesHere(0),
-//            mSelection(0),
-//            mSetting(0),
-//            mAbout(0),
-//            mExit(0)
-    {
-
-    }
-
-    ~FileViewFileContextMenu() { }
-public:
-    //File menu operations
-    //NoAction = 0,
-    HbMenu *mFileMenu;
-    HbAction *mFileBackMoveUp;
-//    HbAction *mFileOpenDrive;
-//??    HbAction *mFileOpenDirectory;
-//    HbAction *mFileSearch;
-    HbMenu *mFileNewMenu;
-    HbAction *mFileNewFile;
-    HbAction *mFileNewDirectory;
-    HbAction *mFileDelete;
-    HbAction *mFileRename;
-    HbAction *mFileTouch;
-    HbAction *mFileProperties;
-    HbMenu *mFileChecksumsMenu;
-    HbAction *mFileChecksumsMD5;
-    HbAction *mFileChecksumsMD2;
-    HbAction *mFileChecksumsSHA1;
-    HbAction *mFileSetAttributes;
-
-    //Edit -
-    HbMenu *mEditMenu;
-//??    HbAction *mEditSnapShotToE;
-    HbAction *mEditCut;
-    HbAction *mEditCopy;
-    HbAction *mEditPaste;
-    HbAction *mEditCopyToFolder;
-    HbAction *mEditMoveToFolder;
-//    HbAction *mEditSelect;
-//    HbAction *mEditUnselect;
-//    HbAction *mEditSelectAll;
-//    HbAction *mEditUnselectAll;
-//
-//    // View -
-//    HbMenu *mViewMenu;
-//    HbAction *mViewFilterEntries;
-//    HbAction *mViewRefresh;
-//
-//    // Tools -
-//    HbMenu *mToolsMenu;
-//    HbAction *mToolsAllAppsToTextFile;
-//    HbAction *mToolsAllFilesToTextFile;
-//
-//    HbMenu *mToolsAvkonIconCacheMenu;
-//    HbAction *mToolsAvkonIconCacheEnable;
-//    HbAction *mToolsAvkonIconCacheDisable;
-//
-//    HbAction *mToolsDisableExtendedErrors;
-//    HbAction *mToolsDumpMsgStoreWalk;
-//    HbAction *mToolsEditDataTypes;
-//
-//    HbAction *mToolsEnableExtendedErrors;
-//
-//    HbMenu *mToolsErrorSimulateMenu;
-//    HbAction *mToolsErrorSimulateLeave;
-//    HbAction *mToolsErrorSimulatePanic;
-//    HbAction *mToolsErrorSimulateException;
-//
-//    HbMenu *mToolsMessageAttachmentsMenu;
-//    HbAction *mToolsMessageInbox;
-//    HbAction *mToolsMessageDrafts;
-//    HbAction *mToolsMessageSentItems;
-//    HbAction *mToolsMessageOutbox;
-//
-//    HbMenu *mToolsLocalConnectivityMenu;
-//    HbAction *mToolsLocalConnectivityActivateInfrared;
-//    HbAction *mToolsLocalConnectivityLaunchBTUI;
-//    HbAction *mToolsLocalConnectivityLaunchUSBUI;
-//
-//    HbAction *mToolsMemoryInfo;
-//
-//    HbMenu *mToolsSecureBackupMenu;
-//    HbAction *mToolsSecureBackStart;
-//    HbAction *mToolsSecureBackRestore;
-//    HbAction *mToolsSecureBackStop;
-//
-//    HbAction *mToolsSetDebugMask;
-//    HbAction *mToolsShowOpenFilesHere;
-//
-//    HbAction *mSelection;
-//    HbAction *mSetting;
-//    HbAction *mAbout;
-//    HbAction *mExit;
-};
 
 #endif // MENUACTION_H
--- a/filebrowser/ui/src/enginewrapper.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/ui/src/enginewrapper.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -36,6 +36,7 @@
     : mEngine(0),
     mFilesFound(),
     mSettings(0),
+    mProgressDialog(0),
     mWaitDialog(0)
 {
 }
@@ -48,6 +49,9 @@
         TRAP_IGNORE(mEngine->DeActivateEngineL());
         delete mEngine;
     } 
+    if (mProgressDialog)
+        delete mProgressDialog;
+
     if (mWaitDialog)
         delete mWaitDialog;
 }
@@ -730,6 +734,38 @@
     Notifications::showConfirmationNote(qText, aNoTimeout);
 }
 
+void EngineWrapper::ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum )
+{
+    const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
+    if (!mProgressDialog) {
+        mProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
+        QObject::connect(mProgressDialog, SIGNAL(cancelled ()), this, SLOT(progressDialogCancelled()));
+    }
+
+    mProgressDialog->setText(qText);
+    mProgressDialog->setMinimum(aMinimum);
+    mProgressDialog->setMaximum(aMaximum);
+    mEngine->FileUtils()->SetAllowProcessing(true);
+    mProgressDialog->show();
+}
+
+void EngineWrapper::CancelProgressDialog()
+{
+    if (mProgressDialog)
+        mProgressDialog->cancel();
+}
+
+void EngineWrapper::SetProgressValue(TInt aValue)
+{
+    if (mProgressDialog)
+        mProgressDialog->setProgressValue(aValue);
+}
+
+void EngineWrapper::progressDialogCancelled()
+{
+    mEngine->FileUtils()->DialogDismissedL();
+}
+
 void EngineWrapper::ShowWaitDialog(const TDesC& aDescText)
 {
     const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
--- a/filebrowser/ui/src/filebrowserview.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/ui/src/filebrowserview.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -62,16 +62,17 @@
     mToolBar(0),
     mNaviPane(0),
     mMainLayout(0),
-    mDirectory(),
-    mSelectedFilePath(),
     mFileBrowserModel(0),
-    mFileViewMenuActions(),
+    mOptionMenuActions(),
+    mContextMenuActions(),
+    mContextMenu(0),
     mToolbarBackAction(0),
     mItemHighlighted(false),
     mLocationChanged(false),
     mRemoveFileAfterCopied(false),
-    mClipBoardInUse(false),
+//    mClipBoardInUse(false),
     mFolderContentChanged(false),
+    mCurrentIndex(),
     mOldPassword(),
     mPanicCategory(),
     mAbsoluteFilePath(),
@@ -84,6 +85,7 @@
     setTitle("File Browser");
 
     createMenu();
+    createContextMenu();
     createToolBar();
 }
 
@@ -108,6 +110,8 @@
     mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
 
     connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
+    connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
+            this, SLOT(onLongPressed(HbAbstractViewItem*, QPointF)));
 
     mNaviPane = new HbLabel(this);
     mNaviPane->setPlainText(QString(" ")); // TODO get from settings or default
@@ -130,12 +134,457 @@
 //    if (mEngineWrapper) {
 //        delete mEngineWrapper;
 //    }
+    if (mContextMenu) {
+        mContextMenu->deleteLater();
+    }
+
     delete mFileBrowserModel;
     delete mListView;
     delete mToolBar;
 }
 
 /**
+  Initial setup for options menu.
+  Dynamic menu update during the runtime is performed by updateOptionMenu() which
+  to menu's aboutToShow() signal.
+  */
+void FileBrowserView::createMenu()
+{
+    createFileMenu();
+    createEditMenu();
+    createViewMenu();
+    createToolsMenu();
+
+    createSelectionMenuItem();
+    createSettingsMenuItem();
+    createAboutMenuItem();
+    createExitMenuItem();
+
+    // menu dynamic update
+    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(updateOptionMenu()));
+}
+
+/**
+  Initial setup for File submenu
+  */
+void FileBrowserView::createFileMenu()
+{
+    mOptionMenuActions.mFileMenu = menu()->addMenu("File");
+
+    mOptionMenuActions.mFileBackMoveUp = mOptionMenuActions.mFileMenu->addAction("Back/Move up (<-)", this, SLOT(fileBackMoveUp()));
+    mOptionMenuActions.mFileOpenDrive = mOptionMenuActions.mFileMenu->addAction("Open drive (->)", this, SLOT(fileOpenDrive()));
+    mOptionMenuActions.mFileOpenDirectory = mOptionMenuActions.mFileMenu->addAction("Open directory (->)", this, SLOT(fileOpenDirectory()));
+    mOptionMenuActions.mFileSearch = mOptionMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
+    //mOptionMenuActions.mFileSearch->setVisible(false);
+
+    mOptionMenuActions.mFileNewMenu = mOptionMenuActions.mFileMenu->addMenu("New");
+    mOptionMenuActions.mFileNewFile = mOptionMenuActions.mFileNewMenu->addAction("File", this, SLOT(fileNewFile()));
+    mOptionMenuActions.mFileNewDirectory = mOptionMenuActions.mFileNewMenu->addAction("Directory", this, SLOT(fileNewDirectory()));
+
+    mOptionMenuActions.mFileDelete = mOptionMenuActions.mFileMenu->addAction("Delete", this, SLOT(fileDelete()));
+    mOptionMenuActions.mFileRename = mOptionMenuActions.mFileMenu->addAction("Rename", this, SLOT(fileRename()));
+    mOptionMenuActions.mFileTouch = mOptionMenuActions.mFileMenu->addAction("Touch", this, SLOT(fileTouch()));
+    mOptionMenuActions.mFileProperties = mOptionMenuActions.mFileMenu->addAction("Properties", this, SLOT(fileProperties()));
+
+//    mOptionMenuActions.mFileChecksumsMenu = mOptionMenuActions.mFileMenu->addMenu("Checksums");
+//    mOptionMenuActions.mFileChecksumsMD5 = mOptionMenuActions.mFileChecksumsMenu->addAction("MD5", this, SLOT(fileChecksumsMD5()));
+//    mOptionMenuActions.mFileChecksumsMD2 = mOptionMenuActions.mFileChecksumsMenu->addAction("MD2", this, SLOT(fileChecksumsMD2()));
+//    mOptionMenuActions.mFileChecksumsSHA1 = mOptionMenuActions.mFileChecksumsMenu->addAction("SHA-1", this, SLOT(fileChecksumsSHA1()));
+
+    mOptionMenuActions.mFileSetAttributes = mOptionMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
+    mOptionMenuActions.mFileSetAttributes->setVisible(false);
+}
+
+/**
+  Initial setup for Edit submenu
+  */
+void FileBrowserView::createEditMenu()
+{
+    mOptionMenuActions.mEditMenu = menu()->addMenu("Edit");
+
+    mOptionMenuActions.mEditSnapShotToE = mOptionMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
+    mOptionMenuActions.mEditSnapShotToE->setVisible(false);
+    mOptionMenuActions.mEditCut = mOptionMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
+    mOptionMenuActions.mEditCopy = mOptionMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
+    mOptionMenuActions.mEditPaste = mOptionMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
+
+    mOptionMenuActions.mEditCopyToFolder = mOptionMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
+    mOptionMenuActions.mEditMoveToFolder = mOptionMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
+
+    mOptionMenuActions.mEditSelect = mOptionMenuActions.mEditMenu->addAction("Select", this, SLOT(editSelect()));
+    mOptionMenuActions.mEditUnselect = mOptionMenuActions.mEditMenu->addAction("Unselect", this, SLOT(editUnselect()));
+    mOptionMenuActions.mEditSelectAll = mOptionMenuActions.mEditMenu->addAction("Select all", this, SLOT(editSelectAll()));
+    mOptionMenuActions.mEditUnselectAll = mOptionMenuActions.mEditMenu->addAction("Unselect all", this, SLOT(editUnselectAll()));
+}
+
+/**
+  Initial setup for View submenu
+  */
+void FileBrowserView::createViewMenu()
+{
+    mOptionMenuActions.mViewMenu = menu()->addMenu("View");
+    mOptionMenuActions.mViewMenu->menuAction()->setVisible(false);
+
+    mOptionMenuActions.mViewFilterEntries = mOptionMenuActions.mViewMenu->addAction("Filter entries", this, SLOT(viewFilterEntries()));
+    mOptionMenuActions.mViewRefresh = mOptionMenuActions.mViewMenu->addAction("Refresh", this, SLOT(viewRefresh()));
+}
+
+/**
+  Initial setup for Tools submenu
+  */
+void FileBrowserView::createToolsMenu()
+{
+    mOptionMenuActions.mToolsMenu = menu()->addMenu("Tools");
+
+    mOptionMenuActions.mToolsAllAppsToTextFile = mOptionMenuActions.mToolsMenu->addAction("All apps to a text file", this, SLOT(toolsAllAppsToTextFile()));
+    mOptionMenuActions.mToolsAllAppsToTextFile->setVisible(false);
+    mOptionMenuActions.mToolsAllFilesToTextFile = mOptionMenuActions.mToolsMenu->addAction("All files to a text file", this, SLOT(toolsAllFilesToTextFile()));
+    //mOptionMenuActions.mToolsAllFilesToTextFile->setVisible(false);
+
+    mOptionMenuActions.mToolsAvkonIconCacheMenu = mOptionMenuActions.mToolsMenu->addMenu("Avkon icon cache");
+    mOptionMenuActions.mToolsAvkonIconCacheMenu->menuAction()->setVisible(false);
+    mOptionMenuActions.mToolsAvkonIconCacheEnable = mOptionMenuActions.mToolsAvkonIconCacheMenu->addAction("Enable", this, SLOT(toolsAvkonIconCacheEnable()));
+    mOptionMenuActions.mToolsAvkonIconCacheDisable = mOptionMenuActions.mToolsAvkonIconCacheMenu->addAction("Clear and disable", this, SLOT(toolsAvkonIconCacheDisable()));
+
+    mOptionMenuActions.mToolsDisableExtendedErrors = mOptionMenuActions.mToolsMenu->addAction("Disable extended errors", this, SLOT(toolsDisableExtendedErrors()));
+    mOptionMenuActions.mToolsDumpMsgStoreWalk = mOptionMenuActions.mToolsMenu->addAction("Dump msg. store walk", this, SLOT(toolsDumpMsgStoreWalk()));
+    mOptionMenuActions.mToolsDumpMsgStoreWalk->setVisible(false);
+    mOptionMenuActions.mToolsEditDataTypes = mOptionMenuActions.mToolsMenu->addAction("Edit data types", this, SLOT(toolsEditDataTypes()));
+    mOptionMenuActions.mToolsEditDataTypes->setVisible(false);
+    mOptionMenuActions.mToolsEnableExtendedErrors = mOptionMenuActions.mToolsMenu->addAction("Enable extended errors", this, SLOT(toolsEnableExtendedErrors()));
+
+    mOptionMenuActions.mToolsErrorSimulateMenu = mOptionMenuActions.mToolsMenu->addMenu("Error simulate");
+    mOptionMenuActions.mToolsErrorSimulateLeave = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Leave", this, SLOT(toolsErrorSimulateLeave()));
+    mOptionMenuActions.mToolsErrorSimulatePanic = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Panic", this, SLOT(toolsErrorSimulatePanic()));
+    mOptionMenuActions.mToolsErrorSimulatePanic->setVisible(false);
+    mOptionMenuActions.mToolsErrorSimulateException = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Exception", this, SLOT(toolsErrorSimulateException()));
+
+//    mOptionMenuActions.mLocalConnectivityMenu = mOptionMenuActions.mToolsMenu->addMenu("Local connectivity");
+//    mOptionMenuActions.mToolsLocalConnectivityActivateInfrared = mOptionMenuActions.mLocalConnectivityMenu->addAction("Activate infrared", this, SLOT(toolsLocalConnectivityActivateInfrared()));
+//    mOptionMenuActions.mToolsLocalConnectivityLaunchBTUI = mOptionMenuActions.mLocalConnectivityMenu->addAction("Launch BT UI", this, SLOT(toolsLocalConnectivityLaunchBTUI()));
+//    mOptionMenuActions.mToolsLocalConnectivityLaunchUSBUI = mOptionMenuActions.mLocalConnectivityMenu->addAction("Launch USB UI", this, SLOT(toolsLocalConnectivityLaunchUSBUI()));
+
+    mOptionMenuActions.mToolsMessageAttachmentsMenu = mOptionMenuActions.mToolsMenu->addMenu("Message attachments");
+    mOptionMenuActions.mToolsMessageAttachmentsMenu->menuAction()->setVisible(false);
+    mOptionMenuActions.mToolsMessageInbox = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Inbox", this, SLOT(toolsMessageInbox()));
+    mOptionMenuActions.mToolsMessageDrafts = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Drafts", this, SLOT(toolsMessageDrafts()));
+    mOptionMenuActions.mToolsMessageSentItems = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Sent items", this, SLOT(toolsMessageSentItems()));
+    mOptionMenuActions.mToolsMessageOutbox = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Outbox", this, SLOT(toolsMessageOutbox()));
+
+    mOptionMenuActions.mToolsMemoryInfo = mOptionMenuActions.mToolsMenu->addAction("Memory info", this, SLOT(toolsMemoryInfo()));
+    mOptionMenuActions.mToolsMemoryInfo->setVisible(false);
+
+    mOptionMenuActions.mToolsSecureBackupMenu = mOptionMenuActions.mToolsMenu->addMenu("Secure backup");
+    mOptionMenuActions.mToolsSecureBackupMenu->menuAction()->setVisible(false);
+    mOptionMenuActions.mToolsSecureBackStart = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Start backup", this, SLOT(toolsSecureBackStart()));
+    mOptionMenuActions.mToolsSecureBackRestore = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Start restore", this, SLOT(toolsSecureBackRestore()));
+    mOptionMenuActions.mToolsSecureBackStop = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Stop", this, SLOT(toolsSecureBackStop()));
+
+    mOptionMenuActions.mToolsSetDebugMask = mOptionMenuActions.mToolsMenu->addAction("Set debug mask", this, SLOT(toolsSetDebugMaskQuestion()));
+    mOptionMenuActions.mToolsShowOpenFilesHere = mOptionMenuActions.mToolsMenu->addAction("Show open files here", this, SLOT(toolsShowOpenFilesHere()));
+    mOptionMenuActions.mToolsShowOpenFilesHere->setVisible(false);
+}
+
+/**
+  Creates Selection mode menu item in option menu
+  */
+void FileBrowserView::createSelectionMenuItem()
+{
+    if (!mOptionMenuActions.mSelection) {
+        mOptionMenuActions.mSelection = menu()->addAction("Selection mode");
+        mOptionMenuActions.mSelection->setToolTip("Selection mode");
+        mOptionMenuActions.mSelection->setCheckable(true);
+        connect(mOptionMenuActions.mSelection, SIGNAL(triggered()), this, SLOT(selectionModeChanged()));
+    }
+}
+
+/**
+  Creates Setting menu item in option menu
+  */
+void FileBrowserView::createSettingsMenuItem()
+{
+    mOptionMenuActions.mSetting = menu()->addAction("Settings...");
+    connect(mOptionMenuActions.mSetting, SIGNAL(triggered()), this, SIGNAL(aboutToShowSettingsView()));
+}
+
+
+/**
+  Creates About menu item in option menu
+  */
+void FileBrowserView::createAboutMenuItem()
+{
+    // about note
+    mOptionMenuActions.mAbout = menu()->addAction("About");
+    connect(mOptionMenuActions.mAbout, SIGNAL(triggered()), this, SLOT(about()));
+}
+
+/**
+  Creates Exit menu item in option menu
+  */
+void FileBrowserView::createExitMenuItem()
+{
+    // application exit
+    mOptionMenuActions.mExit = menu()->addAction("Exit");
+    connect(mOptionMenuActions.mExit, SIGNAL(triggered()), qApp, SLOT(quit()));
+}
+
+/**
+  update menu: disk admin available only in device root view. edit available only in folder view
+  when file or folder content exist in current folder, or clipboard has copied item.
+  file and view menus updated every time regarding the folder content.
+  tools, settings, about, exit always available.
+  If there's remove and add operations at same time, always remove first
+  to keep to the correct menu items order.
+  */
+void FileBrowserView::updateOptionMenu()
+{
+    bool isFileItemListEmpty = mFileBrowserModel->rowCount() == 0;
+    bool isDriveListActive = mEngineWrapper->isDriveListViewActive();
+    bool isNormalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
+    bool currentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();   //iModel->FileUtils()->IsCurrentDriveReadOnly();
+    bool currentItemDirectory = mEngineWrapper->getFileEntry(currentItemIndex()).isDir();
+    bool listBoxSelections = mListView->selectionModel()->selection().count() == 0;
+    bool isSelectionMode = mOptionMenuActions.mSelection && mOptionMenuActions.mSelection->isChecked();
+    bool emptyClipBoard = !mEngineWrapper->isClipBoardListInUse();
+    bool showSnapShot = false;           //iModel->FileUtils()->DriveSnapShotPossible();
+
+    bool showEditMenu(true);
+    if (isDriveListActive) {
+        if (!showSnapShot || isFileItemListEmpty && emptyClipBoard)
+            showEditMenu = false;
+        else
+            showEditMenu = true;
+    } else {
+        if (isFileItemListEmpty && emptyClipBoard)
+            showEditMenu = false;
+        else
+            showEditMenu = true;
+    }
+
+    mOptionMenuActions.mEditMenu->menuAction()->setVisible(showEditMenu);
+    // TODO mContextMenuActions.mDiskAdminMenu->menuAction()->setVisible(isDriveListActive);
+
+    mOptionMenuActions.mFileBackMoveUp->setVisible( !isDriveListActive);
+
+    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpen, isFileItemListEmpty || isDriveListActive || currentItemDirectory);
+    mOptionMenuActions.mFileOpenDrive->setVisible( !(isFileItemListEmpty || !isDriveListActive));
+    mOptionMenuActions.mFileOpenDirectory->setVisible( !(isFileItemListEmpty || isDriveListActive || !currentItemDirectory));
+
+    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileView, isFileItemListEmpty || listBoxSelections || currentItemDirectory || isDriveListActive);
+    //aMenuPane->SetItemDimmed(EFileBrowserCmd FileEdit, isFileItemListEmpty || listBoxSelections || currentItemDirectory || isDriveListActive);
+    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileSendTo, isFileItemListEmpty || driveListActive || currentItemDirectory);
+
+    mOptionMenuActions.mFileNewMenu->menuAction()->setVisible(!(isDriveListActive || currentDriveReadOnly));
+    mOptionMenuActions.mFileDelete->setVisible(!isFileItemListEmpty && !isDriveListActive && !currentDriveReadOnly && isSelectionMode);
+    mOptionMenuActions.mFileRename->setVisible(!isFileItemListEmpty && !isDriveListActive && !currentDriveReadOnly && !listBoxSelections && isSelectionMode);
+    mOptionMenuActions.mFileTouch->setVisible(!(isFileItemListEmpty || isDriveListActive || currentDriveReadOnly));
+    mOptionMenuActions.mFileProperties->setVisible(!(isFileItemListEmpty || listBoxSelections));
+    // TODO mOptionMenuActions.mFileChecksumsMenu->setVisible(!(isFileItemListEmpty || listBoxSelections || currentItemDirectory || isDriveListActive));
+    // TODO mOptionMenuActions.mFileSetAttributes->setVisible(!(isFileItemListEmpty || isDriveListActive || currentDriveReadOnly));
+    // TODO mOptionMenuActions.mFileCompress->setVisible(!(currentDriveReadOnly || isFileItemListEmpty || listBoxSelections || currentItemDirectory || isDriveListActive));
+    // TODO mOptionMenuActions.mFileDecompress->setVisible(!(currentDriveReadOnly || isFileItemListEmpty || listBoxSelections || currentItemDirectory || isDriveListActive));
+
+//    bool currentSelected = true;    //iContainer->ListBox()->View()->ItemIsSelected(iContainer->ListBox()->View()->CurrentItemIndex());
+    bool allSelected = mListView->selectionModel()->selection().count() == mFileBrowserModel->rowCount();
+    bool noneSelected = mListView->selectionModel()->selection().count() != 0;
+
+    //mOptionMenuActions.mEditSnapShotToE->setVisible(isDriveListActive); // TODO
+    mOptionMenuActions.mEditCut->setVisible(!isDriveListActive && !currentDriveReadOnly && !isFileItemListEmpty && !isSelectionMode);
+    mOptionMenuActions.mEditCopy->setVisible(!isDriveListActive && !isFileItemListEmpty);
+    mOptionMenuActions.mEditPaste->setVisible(!(isDriveListActive || emptyClipBoard || currentDriveReadOnly));
+    mOptionMenuActions.mEditCopyToFolder->setVisible(!(isDriveListActive || isFileItemListEmpty));
+    mOptionMenuActions.mEditMoveToFolder->setVisible(!(isDriveListActive || currentDriveReadOnly || isFileItemListEmpty));
+
+    mOptionMenuActions.mEditSelect->setVisible(false/*!isDriveListActive && !currentSelected && !isFileItemListEmpty*/);
+    mOptionMenuActions.mEditUnselect->setVisible(false/*!isDriveListActive && currentSelected && !isFileItemListEmpty*/);
+    mOptionMenuActions.mEditSelectAll->setVisible(!isDriveListActive && !allSelected && !isFileItemListEmpty);
+    mOptionMenuActions.mEditUnselectAll->setVisible(!isDriveListActive && !noneSelected && !isFileItemListEmpty);
+
+    // TODO mOptionMenuActions.mViewSort->setVisible(!(!isNormalModeActive || isDriveListActive || isFileItemListEmpty));
+    // TODO mOptionMenuActions.mViewOrder->setVisible(!(!isNormalModeActive || isDriveListActive || isFileItemListEmpty));
+    mOptionMenuActions.mViewRefresh->setVisible(isNormalModeActive);
+    mOptionMenuActions.mViewFilterEntries->setVisible(!isFileItemListEmpty);
+
+    // TODO R_FILEBROWSER_VIEW_SORT_SUBMENU
+    // aMenuPane->SetItemButtonState(iModel->FileUtils()->SortMode(), EEikMenuItemSymbolOn);
+
+    // TODO R_FILEBROWSER_VIEW_ORDER_SUBMENU
+    // aMenuPane->SetItemButtonState(iModel->FileUtils()->OrderMode(), EEikMenuItemSymbolOn);
+
+    // aResourceId == R_FILEBROWSER_TOOLS_SUBMENU
+    bool noExtendedErrorsAllowed = mEngineWrapper->ErrRdFileExists();
+    mOptionMenuActions.mToolsDisableExtendedErrors->setVisible(noExtendedErrorsAllowed);
+    mOptionMenuActions.mToolsEnableExtendedErrors->setVisible(!noExtendedErrorsAllowed);
+
+//    bool infraRedAllowed = mEngineWrapper->FileExists(KIRAppPath);
+//    bool bluetoothAllowed = mEngineWrapper->FileExists(KBTAppPath);
+//    bool usbAllowed = mEngineWrapper->FileExists(KUSBAppPath);
+//
+//    bool noLocalCon = !infraRedAllowed && !bluetoothAllowed && !usbAllowed;
+//    mOptionMenuActions.mToolsLocalConnectivityMenu->menuAction()->setVisible(!noLocalCon);
+//
+//    mOptionMenuActions.mToolsLocalConnectivityActivateInfrared->setVisible(infraRedAllowed);
+//    mOptionMenuActions.mToolsLocalConnectivityLaunchBTUI->setVisible(bluetoothAllowed);
+//    mOptionMenuActions.mToolsLocalConnectivityLaunchUSBUI->setVisible(usbAllowed);
+}
+
+void FileBrowserView::createContextMenu()
+{
+    mContextMenu = new HbMenu();
+    connect(mContextMenu, SIGNAL(aboutToShow()), this, SLOT(updateContextMenu()));
+
+    createFileContextMenu();
+    createEditContextMenu();
+    createViewContextMenu();
+    createDiskAdminContextMenu();
+}
+
+
+void FileBrowserView::createFileContextMenu()
+{
+    mContextMenuActions.mFileMenu = mContextMenu->addMenu("File");
+
+    mContextMenuActions.mFileBackMoveUp = mContextMenuActions.mFileMenu->addAction("Back/Move up (<-)", this, SLOT(fileBackMoveUp()));
+    mContextMenuActions.mFileOpenDrive = mContextMenuActions.mFileMenu->addAction("Open drive (->)", this, SLOT(fileOpenDrive()));
+    mContextMenuActions.mFileOpenDirectory = mContextMenuActions.mFileMenu->addAction("Open directory (->)", this, SLOT(fileOpenDirectory()));
+//    mContextMenuActions.mFileSearch = mContextMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
+    //mContextMenuActions.mFileSearch->setVisible(false);
+
+//    mContextMenuActions.mFileNewMenu = mContextMenuActions.mFileMenu->addMenu("New");
+//    mContextMenuActions.mFileNewFile = mContextMenuActions.mFileNewMenu->addAction("File", this, SLOT(fileNewFile()));
+//    mContextMenuActions.mFileNewDirectory = mContextMenuActions.mFileNewMenu->addAction("Directory", this, SLOT(fileNewDirectory()));
+
+    mContextMenuActions.mFileDelete = mContextMenuActions.mFileMenu->addAction("Delete", this, SLOT(fileDelete()));
+    mContextMenuActions.mFileRename = mContextMenuActions.mFileMenu->addAction("Rename", this, SLOT(fileRename()));
+    mContextMenuActions.mFileTouch = mContextMenuActions.mFileMenu->addAction("Touch", this, SLOT(fileTouch()));
+    mContextMenuActions.mFileProperties = mContextMenuActions.mFileMenu->addAction("Properties", this, SLOT(fileProperties()));
+
+    mContextMenuActions.mFileChecksumsMenu = mContextMenuActions.mFileMenu->addMenu("Checksums");
+    mContextMenuActions.mFileChecksumsMD5 = mContextMenuActions.mFileChecksumsMenu->addAction("MD5", this, SLOT(fileChecksumsMD5()));
+    mContextMenuActions.mFileChecksumsMD2 = mContextMenuActions.mFileChecksumsMenu->addAction("MD2", this, SLOT(fileChecksumsMD2()));
+    mContextMenuActions.mFileChecksumsSHA1 = mContextMenuActions.mFileChecksumsMenu->addAction("SHA-1", this, SLOT(fileChecksumsSHA1()));
+
+//    mContextMenuActions.mFileSetAttributes = mContextMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
+//    mContextMenuActions.mFileSetAttributes->setVisible(false);
+}
+
+void FileBrowserView::createEditContextMenu()
+{
+    mContextMenuActions.mEditMenu = mContextMenu->addMenu("Edit");
+
+    //mContextMenuActions.mEditSnapShotToE = mContextMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
+//    mContextMenuActions.mEditSnapShotToE->setVisible(false);
+    mContextMenuActions.mEditCut = mContextMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
+    mContextMenuActions.mEditCopy = mContextMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
+    mContextMenuActions.mEditPaste = mContextMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
+
+    mContextMenuActions.mEditCopyToFolder = mContextMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
+    mContextMenuActions.mEditMoveToFolder = mContextMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
+}
+
+void FileBrowserView::createViewContextMenu()
+{
+
+}
+
+/**
+  Initial setup for Disk Admin submenu
+  */
+void FileBrowserView::createDiskAdminContextMenu()
+{
+    mContextMenuActions.mDiskAdminMenu = mContextMenu->addMenu("Disk admin");
+    //mContextMenuActions.mDiskAdminMenu->menuAction()->setVisible(false);
+
+    mContextMenuActions.mDiskAdminSetDrivePassword = mContextMenuActions.mDiskAdminMenu->addAction("Set drive password", this, SLOT(diskAdminSetDrivePassword()));
+    mContextMenuActions.mDiskAdminUnlockDrive = mContextMenuActions.mDiskAdminMenu->addAction("Unlock drive", this, SLOT(diskAdminUnlockDrive()));
+    mContextMenuActions.mDiskAdminClearDrivePassword = mContextMenuActions.mDiskAdminMenu->addAction("Clear drive password", this, SLOT(diskAdminClearDrivePassword()));
+    mContextMenuActions.mDiskAdminEraseDrivePassword = mContextMenuActions.mDiskAdminMenu->addAction("Erase drive password", this, SLOT(diskAdminEraseDrivePassword()));
+
+    mContextMenuActions.mDiskAdminFormatDrive = mContextMenuActions.mDiskAdminMenu->addAction("Format drive", this, SLOT(diskAdminFormatDrive()));
+    mContextMenuActions.mDiskAdminFormatDrive->setVisible(false);
+    mContextMenuActions.mDiskAdminQuickFormatDrive = mContextMenuActions.mDiskAdminMenu->addAction("Quick format drive", this, SLOT(diskAdminQuickFormatDrive()));
+    mContextMenuActions.mDiskAdminQuickFormatDrive->setVisible(false);
+
+    mContextMenuActions.mDiskAdminCheckDisk = mContextMenuActions.mDiskAdminMenu->addAction("Check disk", this, SLOT(diskAdminCheckDisk()));
+    mContextMenuActions.mDiskAdminScanDrive = mContextMenuActions.mDiskAdminMenu->addAction("Scan drive", this, SLOT(diskAdminScanDrive()));
+    mContextMenuActions.mDiskAdminSetDriveName = mContextMenuActions.mDiskAdminMenu->addAction("Set drive name", this, SLOT(diskAdminSetDriveName()));
+    mContextMenuActions.mDiskAdminSetDriveVolumeLabel = mContextMenuActions.mDiskAdminMenu->addAction("Set drive volume label", this, SLOT(diskAdminSetDriveVolumeLabel()));
+    mContextMenuActions.mDiskAdminEjectDrive = mContextMenuActions.mDiskAdminMenu->addAction("Eject drive", this, SLOT(diskAdminEjectDrive()));
+    mContextMenuActions.mDiskAdminDismountDrive = mContextMenuActions.mDiskAdminMenu->addAction("Dismount drive", this, SLOT(diskAdminDismountDrive()));
+    mContextMenuActions.mDiskAdminEraseMBR = mContextMenuActions.mDiskAdminMenu->addAction("Erase MBR", this, SLOT(diskAdminEraseMBR()));
+    mContextMenuActions.mDiskAdminPartitionDrive = mContextMenuActions.mDiskAdminMenu->addAction("Partition drive", this, SLOT(diskAdminPartitionDrive()));
+}
+
+void FileBrowserView::updateContextMenu()
+{
+    bool isFileItemListEmpty = mFileBrowserModel->rowCount() == 0;
+    bool isDriveListActive = mEngineWrapper->isDriveListViewActive();
+//    bool isNormalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
+    bool currentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();
+    bool currentItemDirectory = mEngineWrapper->getFileEntry(mCurrentIndex /*currentItemIndex()*/).isDir();
+    bool listBoxSelections = mListView->selectionModel()->selection().count() == 0;
+    bool isSelectionMode = mOptionMenuActions.mSelection && mOptionMenuActions.mSelection->isChecked();
+    bool emptyClipBoard = !mEngineWrapper->isClipBoardListInUse();
+//    bool showSnapShot = false;           //iModel->FileUtils()->DriveSnapShotPossible();
+
+//    bool showEditMenu(true);
+//    if (isDriveListActive) {
+//        if (!showSnapShot || isFileItemListEmpty && emptyClipBoard)
+//            showEditMenu = false;
+//        else
+//            showEditMenu = true;
+//    } else {
+//        if (isFileItemListEmpty && emptyClipBoard)
+//            showEditMenu = false;
+//        else
+//            showEditMenu = true;
+//    }
+
+    // File submenu
+    mContextMenuActions.mFileBackMoveUp->setVisible( !isDriveListActive);
+    mContextMenuActions.mFileOpenDrive->setVisible( !isFileItemListEmpty && isDriveListActive);
+    mContextMenuActions.mFileOpenDirectory->setVisible( !isFileItemListEmpty && !isDriveListActive && currentItemDirectory);
+
+//    mContextMenuActions.mFileNewMenu->menuAction()->setVisible(!(isDriveListActive || currentDriveReadOnly));
+    mContextMenuActions.mFileDelete->setVisible(!isFileItemListEmpty && !isDriveListActive && !currentDriveReadOnly);
+    mContextMenuActions.mFileRename->setVisible(!isFileItemListEmpty && !isDriveListActive && !currentDriveReadOnly && !listBoxSelections);
+    mContextMenuActions.mFileTouch->setVisible(!isFileItemListEmpty && !isDriveListActive && !currentDriveReadOnly);
+    mContextMenuActions.mFileProperties->setVisible(!isFileItemListEmpty && !listBoxSelections && !isSelectionMode);
+
+    mContextMenuActions.mFileChecksumsMenu->menuAction()->setVisible(!(isFileItemListEmpty || isSelectionMode /*|| listBoxSelections*/ || currentItemDirectory || isDriveListActive));
+    // Edit submenu
+    mContextMenuActions.mEditMenu->menuAction()->setVisible(!isDriveListActive);
+    mContextMenuActions.mEditCut->setVisible(!(isDriveListActive || currentDriveReadOnly || isFileItemListEmpty));
+    mContextMenuActions.mEditCopy->setVisible(!(isDriveListActive || isFileItemListEmpty));
+    mContextMenuActions.mEditPaste->setVisible(!isDriveListActive && !emptyClipBoard && !currentDriveReadOnly);
+    mContextMenuActions.mEditCopyToFolder->setVisible(!(isDriveListActive || isFileItemListEmpty));
+    mContextMenuActions.mEditMoveToFolder->setVisible(!(isDriveListActive || currentDriveReadOnly || isFileItemListEmpty));
+    //DiskAdmin submenu
+    mContextMenuActions.mDiskAdminMenu->menuAction()->setVisible(isDriveListActive);
+}
+
+// ---------------------------------------------------------------------------
+
+void FileBrowserView::onLongPressed(HbAbstractViewItem *listViewItem, QPointF coords)
+{
+    //Q_UNUSED(listViewItem);
+
+//    QItemSelectionModel *selectionIndexes = mListView->selectionModel();
+
+    // by default use selected items
+//    if (selectionIndexes && selectionIndexes->hasSelection()) {
+//        mSelectionIndexes = mListView->selectionModel()->selectedIndexes();
+//    } else {
+        mCurrentIndex = listViewItem->modelIndex();
+//        mSelectionIndexes.clear();
+//        mSelectionIndexes.append(mModelIndex);
+//    }
+    mContextMenu->setPreferredPos(coords);
+    mContextMenu->show();
+}
+
+
+/**
   Create a file browser tool bar
   */
 void FileBrowserView::createToolBar()
@@ -148,335 +597,39 @@
     connect(mToolbarBackAction, SIGNAL(triggered()), this, SLOT(fileBackMoveUp()));
     mToolBar->addAction(mToolbarBackAction);
 
-    if (mFileViewMenuActions.mSelection) {
-        mToolBar->addAction(mFileViewMenuActions.mSelection);
+    if (mOptionMenuActions.mSelection) {
+        mToolBar->addAction(mOptionMenuActions.mSelection);
     }
 
     setToolBar(mToolBar);
 }
 
 /**
-  Initial setup for options menu.
-  Dynamic menu update during the runtime is performed by updateMenu() which
-  to menu's aboutToShow() signal.
-  */
-void FileBrowserView::createMenu()
-{
-    createFileMenu();
-    createEditMenu();
-    createViewMenu();
-    createDiskAdminMenu();
-    createToolsMenu();
-
-    createSelectionMenuItem();
-    createSettingsMenuItem();
-    createAboutMenuItem();
-    createExitMenuItem();
-
-    // menu dynamic update
-    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(updateMenu()));
-}
-
-/**
-  Initial setup for File submenu
-  */
-void FileBrowserView::createFileMenu()
-{
-    mFileViewMenuActions.mFileMenu = menu()->addMenu("File");
-
-    mFileViewMenuActions.mFileBackMoveUp = mFileViewMenuActions.mFileMenu->addAction("Back/Move up (<-)", this, SLOT(fileBackMoveUp()));
-    mFileViewMenuActions.mFileOpenDrive = mFileViewMenuActions.mFileMenu->addAction("Open drive (->)", this, SLOT(fileOpenDrive()));
-    mFileViewMenuActions.mFileOpenDirectory = mFileViewMenuActions.mFileMenu->addAction("Open directory (->)", this, SLOT(fileOpenDirectory()));
-    mFileViewMenuActions.mFileSearch = mFileViewMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
-    //mFileViewMenuActions.mFileSearch->setVisible(false);
-
-    mFileViewMenuActions.mFileNewMenu = mFileViewMenuActions.mFileMenu->addMenu("New");
-    mFileViewMenuActions.mFileNewFile = mFileViewMenuActions.mFileNewMenu->addAction("File", this, SLOT(fileNewFile()));
-    mFileViewMenuActions.mFileNewDirectory = mFileViewMenuActions.mFileNewMenu->addAction("Directory", this, SLOT(fileNewDirectory()));
-
-    mFileViewMenuActions.mFileDelete = mFileViewMenuActions.mFileMenu->addAction("Delete", this, SLOT(fileDelete()));
-    mFileViewMenuActions.mFileRename = mFileViewMenuActions.mFileMenu->addAction("Rename", this, SLOT(fileRename()));
-    mFileViewMenuActions.mFileTouch = mFileViewMenuActions.mFileMenu->addAction("Touch", this, SLOT(fileTouch()));
-    mFileViewMenuActions.mFileProperties = mFileViewMenuActions.mFileMenu->addAction("Properties", this, SLOT(fileProperties()));
-
-    mFileViewMenuActions.mFileChecksumsMenu = mFileViewMenuActions.mFileMenu->addMenu("Checksums");
-    mFileViewMenuActions.mFileChecksumsMD5 = mFileViewMenuActions.mFileChecksumsMenu->addAction("MD5", this, SLOT(fileChecksumsMD5()));
-    mFileViewMenuActions.mFileChecksumsMD2 = mFileViewMenuActions.mFileChecksumsMenu->addAction("MD2", this, SLOT(fileChecksumsMD2()));
-    mFileViewMenuActions.mFileChecksumsSHA1 = mFileViewMenuActions.mFileChecksumsMenu->addAction("SHA-1", this, SLOT(fileChecksumsSHA1()));
-
-    mFileViewMenuActions.mFileSetAttributes = mFileViewMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
-    mFileViewMenuActions.mFileSetAttributes->setVisible(false);
-}
-
-/**
-  Initial setup for Edit submenu
-  */
-void FileBrowserView::createEditMenu()
-{
-    mFileViewMenuActions.mEditMenu = menu()->addMenu("Edit");
-
-    mFileViewMenuActions.mEditSnapShotToE = mFileViewMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
-    mFileViewMenuActions.mEditSnapShotToE->setVisible(false);
-    mFileViewMenuActions.mEditCut = mFileViewMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
-    mFileViewMenuActions.mEditCopy = mFileViewMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
-    mFileViewMenuActions.mEditPaste = mFileViewMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
-
-    mFileViewMenuActions.mEditCopyToFolder = mFileViewMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
-    mFileViewMenuActions.mEditMoveToFolder = mFileViewMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
-
-    mFileViewMenuActions.mEditSelect = mFileViewMenuActions.mEditMenu->addAction("Select", this, SLOT(editSelect()));
-    mFileViewMenuActions.mEditUnselect = mFileViewMenuActions.mEditMenu->addAction("Unselect", this, SLOT(editUnselect()));
-    mFileViewMenuActions.mEditSelectAll = mFileViewMenuActions.mEditMenu->addAction("Select all", this, SLOT(editSelectAll()));
-    mFileViewMenuActions.mEditUnselectAll = mFileViewMenuActions.mEditMenu->addAction("Unselect all", this, SLOT(editUnselectAll()));
-}
-
-/**
-  Initial setup for View submenu
-  */
-void FileBrowserView::createViewMenu()
-{
-    mFileViewMenuActions.mViewMenu = menu()->addMenu("View");
-    mFileViewMenuActions.mViewMenu->menuAction()->setVisible(false);
-
-    mFileViewMenuActions.mViewFilterEntries = mFileViewMenuActions.mViewMenu->addAction("Filter entries", this, SLOT(viewFilterEntries()));
-    mFileViewMenuActions.mViewRefresh = mFileViewMenuActions.mViewMenu->addAction("Refresh", this, SLOT(viewRefresh()));
-}
-
-/**
-  Initial setup for Disk Admin submenu
-  */
-void FileBrowserView::createDiskAdminMenu()
-{
-    mFileViewMenuActions.mDiskAdminMenu = menu()->addMenu("Disk admin");
-    mFileViewMenuActions.mDiskAdminMenu->menuAction()->setVisible(false);
-
-    mFileViewMenuActions.mDiskAdminSetDrivePassword = mFileViewMenuActions.mDiskAdminMenu->addAction("Set drive password", this, SLOT(diskAdminSetDrivePassword()));
-    mFileViewMenuActions.mDiskAdminUnlockDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Unlock drive", this, SLOT(diskAdminUnlockDrive()));
-    mFileViewMenuActions.mDiskAdminClearDrivePassword = mFileViewMenuActions.mDiskAdminMenu->addAction("Clear drive password", this, SLOT(diskAdminClearDrivePassword()));
-    mFileViewMenuActions.mDiskAdminEraseDrivePassword = mFileViewMenuActions.mDiskAdminMenu->addAction("Erase drive password", this, SLOT(diskAdminEraseDrivePassword()));
-
-    mFileViewMenuActions.mDiskAdminFormatDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Format drive", this, SLOT(diskAdminFormatDrive()));
-    mFileViewMenuActions.mDiskAdminFormatDrive->setVisible(false);
-    mFileViewMenuActions.mDiskAdminQuickFormatDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Quick format drive", this, SLOT(diskAdminQuickFormatDrive()));
-    mFileViewMenuActions.mDiskAdminQuickFormatDrive->setVisible(false);
-
-    mFileViewMenuActions.mDiskAdminCheckDisk = mFileViewMenuActions.mDiskAdminMenu->addAction("Check disk", this, SLOT(diskAdminCheckDisk()));
-    mFileViewMenuActions.mDiskAdminScanDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Scan drive", this, SLOT(diskAdminScanDrive()));
-    mFileViewMenuActions.mDiskAdminSetDriveName = mFileViewMenuActions.mDiskAdminMenu->addAction("Set drive name", this, SLOT(diskAdminSetDriveName()));
-    mFileViewMenuActions.mDiskAdminSetDriveVolumeLabel = mFileViewMenuActions.mDiskAdminMenu->addAction("Set drive volume label", this, SLOT(diskAdminSetDriveVolumeLabel()));
-    mFileViewMenuActions.mDiskAdminEjectDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Eject drive", this, SLOT(diskAdminEjectDrive()));
-    mFileViewMenuActions.mDiskAdminDismountDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Dismount drive", this, SLOT(diskAdminDismountDrive()));
-    mFileViewMenuActions.mDiskAdminEraseMBR = mFileViewMenuActions.mDiskAdminMenu->addAction("Erase MBR", this, SLOT(diskAdminEraseMBR()));
-    mFileViewMenuActions.mDiskAdminPartitionDrive = mFileViewMenuActions.mDiskAdminMenu->addAction("Partition drive", this, SLOT(diskAdminPartitionDrive()));
-}
-
-/**
-  Initial setup for Tools submenu
-  */
-void FileBrowserView::createToolsMenu()
-{
-    mFileViewMenuActions.mToolsMenu = menu()->addMenu("Tools");
-
-    mFileViewMenuActions.mToolsAllAppsToTextFile = mFileViewMenuActions.mToolsMenu->addAction("All apps to a text file", this, SLOT(toolsAllAppsToTextFile()));
-    mFileViewMenuActions.mToolsAllAppsToTextFile->setVisible(false);
-    mFileViewMenuActions.mToolsAllFilesToTextFile = mFileViewMenuActions.mToolsMenu->addAction("All files to a text file", this, SLOT(toolsAllFilesToTextFile()));
-    //mFileViewMenuActions.mToolsAllFilesToTextFile->setVisible(false);
-
-    mFileViewMenuActions.mToolsAvkonIconCacheMenu = mFileViewMenuActions.mToolsMenu->addMenu("Avkon icon cache");
-    mFileViewMenuActions.mToolsAvkonIconCacheMenu->menuAction()->setVisible(false);
-    mFileViewMenuActions.mToolsAvkonIconCacheEnable = mFileViewMenuActions.mToolsAvkonIconCacheMenu->addAction("Enable", this, SLOT(toolsAvkonIconCacheEnable()));
-    mFileViewMenuActions.mToolsAvkonIconCacheDisable = mFileViewMenuActions.mToolsAvkonIconCacheMenu->addAction("Clear and disable", this, SLOT(toolsAvkonIconCacheDisable()));
-
-    mFileViewMenuActions.mToolsDisableExtendedErrors = mFileViewMenuActions.mToolsMenu->addAction("Disable extended errors", this, SLOT(toolsDisableExtendedErrors()));
-    mFileViewMenuActions.mToolsDumpMsgStoreWalk = mFileViewMenuActions.mToolsMenu->addAction("Dump msg. store walk", this, SLOT(toolsDumpMsgStoreWalk()));
-    mFileViewMenuActions.mToolsDumpMsgStoreWalk->setVisible(false);
-    mFileViewMenuActions.mToolsEditDataTypes = mFileViewMenuActions.mToolsMenu->addAction("Edit data types", this, SLOT(toolsEditDataTypes()));
-    mFileViewMenuActions.mToolsEditDataTypes->setVisible(false);
-    mFileViewMenuActions.mToolsEnableExtendedErrors = mFileViewMenuActions.mToolsMenu->addAction("Enable extended errors", this, SLOT(toolsEnableExtendedErrors()));
-
-    mFileViewMenuActions.mToolsErrorSimulateMenu = mFileViewMenuActions.mToolsMenu->addMenu("Error simulate");
-    mFileViewMenuActions.mToolsErrorSimulateLeave = mFileViewMenuActions.mToolsErrorSimulateMenu->addAction("Leave", this, SLOT(toolsErrorSimulateLeave()));
-    mFileViewMenuActions.mToolsErrorSimulatePanic = mFileViewMenuActions.mToolsErrorSimulateMenu->addAction("Panic", this, SLOT(toolsErrorSimulatePanic()));
-    mFileViewMenuActions.mToolsErrorSimulatePanic->setVisible(false);
-    mFileViewMenuActions.mToolsErrorSimulateException = mFileViewMenuActions.mToolsErrorSimulateMenu->addAction("Exception", this, SLOT(toolsErrorSimulateException()));
-
-//    mFileViewMenuActions.mLocalConnectivityMenu = mFileViewMenuActions.mToolsMenu->addMenu("Local connectivity");
-//    mFileViewMenuActions.mToolsLocalConnectivityActivateInfrared = mFileViewMenuActions.mLocalConnectivityMenu->addAction("Activate infrared", this, SLOT(toolsLocalConnectivityActivateInfrared()));
-//    mFileViewMenuActions.mToolsLocalConnectivityLaunchBTUI = mFileViewMenuActions.mLocalConnectivityMenu->addAction("Launch BT UI", this, SLOT(toolsLocalConnectivityLaunchBTUI()));
-//    mFileViewMenuActions.mToolsLocalConnectivityLaunchUSBUI = mFileViewMenuActions.mLocalConnectivityMenu->addAction("Launch USB UI", this, SLOT(toolsLocalConnectivityLaunchUSBUI()));
-
-    mFileViewMenuActions.mToolsMessageAttachmentsMenu = mFileViewMenuActions.mToolsMenu->addMenu("Message attachments");
-    mFileViewMenuActions.mToolsMessageAttachmentsMenu->menuAction()->setVisible(false);
-    mFileViewMenuActions.mToolsMessageInbox = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Inbox", this, SLOT(toolsMessageInbox()));
-    mFileViewMenuActions.mToolsMessageDrafts = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Drafts", this, SLOT(toolsMessageDrafts()));
-    mFileViewMenuActions.mToolsMessageSentItems = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Sent items", this, SLOT(toolsMessageSentItems()));
-    mFileViewMenuActions.mToolsMessageOutbox = mFileViewMenuActions.mToolsMessageAttachmentsMenu->addAction("Outbox", this, SLOT(toolsMessageOutbox()));
-
-    mFileViewMenuActions.mToolsMemoryInfo = mFileViewMenuActions.mToolsMenu->addAction("Memory info", this, SLOT(toolsMemoryInfo()));
-    mFileViewMenuActions.mToolsMemoryInfo->setVisible(false);
-
-    mFileViewMenuActions.mToolsSecureBackupMenu = mFileViewMenuActions.mToolsMenu->addMenu("Secure backup");
-    mFileViewMenuActions.mToolsSecureBackupMenu->menuAction()->setVisible(false);
-    mFileViewMenuActions.mToolsSecureBackStart = mFileViewMenuActions.mToolsSecureBackupMenu->addAction("Start backup", this, SLOT(toolsSecureBackStart()));
-    mFileViewMenuActions.mToolsSecureBackRestore = mFileViewMenuActions.mToolsSecureBackupMenu->addAction("Start restore", this, SLOT(toolsSecureBackRestore()));
-    mFileViewMenuActions.mToolsSecureBackStop = mFileViewMenuActions.mToolsSecureBackupMenu->addAction("Stop", this, SLOT(toolsSecureBackStop()));
-
-    mFileViewMenuActions.mToolsSetDebugMask = mFileViewMenuActions.mToolsMenu->addAction("Set debug mask", this, SLOT(toolsSetDebugMaskQuestion()));
-    mFileViewMenuActions.mToolsShowOpenFilesHere = mFileViewMenuActions.mToolsMenu->addAction("Show open files here", this, SLOT(toolsShowOpenFilesHere()));
-    mFileViewMenuActions.mToolsShowOpenFilesHere->setVisible(false);
-}
-
-/**
-  Creates Selection mode menu item in option menu
-  */
-void FileBrowserView::createSelectionMenuItem()
-{
-    if (!mFileViewMenuActions.mSelection) {
-        mFileViewMenuActions.mSelection = menu()->addAction("Selection mode");
-        mFileViewMenuActions.mSelection->setToolTip("Selection mode");
-        mFileViewMenuActions.mSelection->setCheckable(true);
-        connect(mFileViewMenuActions.mSelection, SIGNAL(triggered()), this, SLOT(selectionModeChanged()));
-    }
-}
-
-/**
-  Creates Setting menu item in option menu
-  */
-void FileBrowserView::createSettingsMenuItem()
-{
-    mFileViewMenuActions.mSetting = menu()->addAction("Settings...");
-    connect(mFileViewMenuActions.mSetting, SIGNAL(triggered()), this, SIGNAL(aboutToShowSettingsView()));
-}
-
-
-/**
-  Creates About menu item in option menu
-  */
-void FileBrowserView::createAboutMenuItem()
-{
-    // about note
-    mFileViewMenuActions.mAbout = menu()->addAction("About");
-    connect(mFileViewMenuActions.mAbout, SIGNAL(triggered()), this, SLOT(about()));
-}
-
-/**
-  Creates Exit menu item in option menu
-  */
-void FileBrowserView::createExitMenuItem()
-{
-    // application exit
-    mFileViewMenuActions.mExit = menu()->addAction("Exit");
-    connect(mFileViewMenuActions.mExit, SIGNAL(triggered()), qApp, SLOT(quit()));
-}
-
-/**
-  update menu: disk admin available only in device root view. edit available only in folder view
-  when file or folder content exist in current folder, or clipboard has copied item.
-  file and view menus updated every time regarding the folder content.
-  tools, settings, about, exit always available.
-  If there's remove and add operations at same time, always remove first
-  to keep to the correct menu items order.
-  */
-void FileBrowserView::updateMenu()
-{
-    bool emptyListBox = mFileBrowserModel->rowCount() == 0;           //iContainer->ListBoxNumberOfVisibleItems() == 0;
-    bool driveListActive = mEngineWrapper->isDriveListViewActive(); //iModel->FileUtils()->IsDriveListViewActive();
-    bool normalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
-    bool currentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();   //iModel->FileUtils()->IsCurrentDriveReadOnly();
-    bool currentItemDirectory = mEngineWrapper->getFileEntry(currentItemIndex()).isDir();   //iModel->FileUtils()->IsCurrentItemDirectory();
-    bool listBoxSelections = mListView->selectionModel()->selection().count() == 0;      //iContainer->ListBoxSelectionIndexesCount() == 0;
-    bool emptyClipBoard = !mEngineWrapper->isClipBoardListInUse();
-    bool showSnapShot = false;           //iModel->FileUtils()->DriveSnapShotPossible();
-
-    bool showEditMenu(true);
-    if (driveListActive) {
-        if (!showSnapShot || emptyListBox && emptyClipBoard)
-            showEditMenu = false;
-        else
-            showEditMenu = true;
-    } else {
-        if (emptyListBox && emptyClipBoard)
-            showEditMenu = false;
-        else
-            showEditMenu = true;
-    }
-
-    mFileViewMenuActions.mEditMenu->menuAction()->setVisible(showEditMenu);
-    // TODO mFileViewMenuActions.mDiskAdminMenu->menuAction()->setVisible(driveListActive);
-
-    mFileViewMenuActions.mFileBackMoveUp->setVisible( !driveListActive);
-
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpen, emptyListBox || driveListActive || currentItemDirectory);
-    mFileViewMenuActions.mFileOpenDrive->setVisible( !(emptyListBox || !driveListActive));
-    mFileViewMenuActions.mFileOpenDirectory->setVisible( !(emptyListBox || driveListActive || !currentItemDirectory));
-
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileView, emptyListBox || listBoxSelections || currentItemDirectory || driveListActive);
-    //aMenuPane->SetItemDimmed(EFileBrowserCmd FileEdit, emptyListBox || listBoxSelections || currentItemDirectory || driveListActive);
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileSendTo, emptyListBox || driveListActive || currentItemDirectory);
-
-    mFileViewMenuActions.mFileNewMenu->menuAction()->setVisible(!(driveListActive || currentDriveReadOnly));
-    mFileViewMenuActions.mFileDelete->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly));
-    mFileViewMenuActions.mFileRename->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly || listBoxSelections));
-    mFileViewMenuActions.mFileTouch->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly));
-    mFileViewMenuActions.mFileProperties->setVisible(!(emptyListBox || listBoxSelections));
-    // TODO mFileViewMenuActions.mFileChecksums->setVisible(!(emptyListBox || listBoxSelections || currentItemDirectory || driveListActive));
-    // TODO mFileViewMenuActions.mFileSetAttributes->setVisible(!(emptyListBox || driveListActive || currentDriveReadOnly));
-    // TODO mFileViewMenuActions.mFileCompress->setVisible(!(currentDriveReadOnly || emptyListBox || listBoxSelections || currentItemDirectory || driveListActive));
-    // TODO mFileViewMenuActions.mFileDecompress->setVisible(!(currentDriveReadOnly || emptyListBox || listBoxSelections || currentItemDirectory || driveListActive));
-
-    bool currentSelected = true;    //iContainer->ListBox()->View()->ItemIsSelected(iContainer->ListBox()->View()->CurrentItemIndex());
-    bool allSelected = mListView->selectionModel()->selection().count() == mFileBrowserModel->rowCount();        //iContainer->ListBox()->SelectionIndexes()->Count() == iContainer->ListBox()->Model()->NumberOfItems();
-    bool noneSelected = mListView->selectionModel()->selection().count() != 0;       //iContainer->ListBox()->SelectionIndexes()->Count() == 0;
-
-    //mFileViewMenuActions.mEditSnapShotToE->setVisible(driveListActive); // TODO
-    mFileViewMenuActions.mEditCut->setVisible(!(driveListActive || currentDriveReadOnly || emptyListBox));
-    mFileViewMenuActions.mEditCopy->setVisible(!(driveListActive || emptyListBox));
-    mFileViewMenuActions.mEditPaste->setVisible(!(driveListActive || emptyClipBoard || currentDriveReadOnly));
-    mFileViewMenuActions.mEditCopyToFolder->setVisible(!(driveListActive || emptyListBox));
-    mFileViewMenuActions.mEditMoveToFolder->setVisible(!(driveListActive || currentDriveReadOnly || emptyListBox));
-    mFileViewMenuActions.mEditSelect->setVisible(!(driveListActive || currentSelected || emptyListBox));
-    mFileViewMenuActions.mEditUnselect->setVisible(!(driveListActive || !currentSelected || emptyListBox));
-    mFileViewMenuActions.mEditSelectAll->setVisible(!(driveListActive || allSelected || emptyListBox));
-    mFileViewMenuActions.mEditUnselectAll->setVisible(!(driveListActive || noneSelected || emptyListBox));
-
-    // TODO mFileViewMenuActions.mViewSort->setVisible(!(!normalModeActive || driveListActive || emptyListBox));
-    // TODO mFileViewMenuActions.mViewOrder->setVisible(!(!normalModeActive || driveListActive || emptyListBox));
-    mFileViewMenuActions.mViewRefresh->setVisible(normalModeActive);
-    mFileViewMenuActions.mViewFilterEntries->setVisible(!emptyListBox);
-
-    // TODO R_FILEBROWSER_VIEW_SORT_SUBMENU
-    // aMenuPane->SetItemButtonState(iModel->FileUtils()->SortMode(), EEikMenuItemSymbolOn);
-
-    // TODO R_FILEBROWSER_VIEW_ORDER_SUBMENU
-    // aMenuPane->SetItemButtonState(iModel->FileUtils()->OrderMode(), EEikMenuItemSymbolOn);
-
-    // aResourceId == R_FILEBROWSER_TOOLS_SUBMENU
-    bool noExtendedErrorsAllowed = mEngineWrapper->ErrRdFileExists();
-    mFileViewMenuActions.mToolsDisableExtendedErrors->setVisible(noExtendedErrorsAllowed);
-    mFileViewMenuActions.mToolsEnableExtendedErrors->setVisible(!noExtendedErrorsAllowed);
-
-//    bool infraRedAllowed = mEngineWrapper->FileExists(KIRAppPath);
-//    bool bluetoothAllowed = mEngineWrapper->FileExists(KBTAppPath);
-//    bool usbAllowed = mEngineWrapper->FileExists(KUSBAppPath);
-//
-//    bool noLocalCon = !infraRedAllowed && !bluetoothAllowed && !usbAllowed;
-//    mFileViewMenuActions.mToolsLocalConnectivityMenu->menuAction()->setVisible(!noLocalCon);
-//
-//    mFileViewMenuActions.mToolsLocalConnectivityActivateInfrared->setVisible(infraRedAllowed);
-//    mFileViewMenuActions.mToolsLocalConnectivityLaunchBTUI->setVisible(bluetoothAllowed);
-//    mFileViewMenuActions.mToolsLocalConnectivityLaunchUSBUI->setVisible(usbAllowed);
-}
-
-/**
   Refresh FileBrowser view
   */
 void FileBrowserView::refreshList()
 {
     mEngineWrapper->refreshView();
-    mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
+//    mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
     mListView->reset();
     mListView->setModel(mFileBrowserModel);
     mToolbarBackAction->setEnabled(!mEngineWrapper->isDriveListViewActive());
+
+    TListingMode listingMode = mEngineWrapper->listingMode();
+    if (listingMode == ENormalEntries)
+        mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
+    else if (listingMode == ESearchResults)
+        mNaviPane->setPlainText(QString(tr("Search results")));
+    else if (listingMode == EOpenFiles)
+        mNaviPane->setPlainText(QString(tr("Open files")));
+    else if (listingMode == EMsgAttachmentsInbox)
+        mNaviPane->setPlainText(QString(tr("Attachments in Inbox")));
+    else if (listingMode == EMsgAttachmentsDrafts)
+        mNaviPane->setPlainText(QString(tr("Attachments in Drafts")));
+    else if (listingMode == EMsgAttachmentsSentItems)
+        mNaviPane->setPlainText(QString(tr("Attachments in Sent Items")));
+    else if (listingMode == EMsgAttachmentsOutbox)
+        mNaviPane->setPlainText(QString(tr("Attachments in Outbox")));
 }
 
 /**
@@ -626,16 +779,17 @@
     dialog->open();
 }
 
-QModelIndexList FileBrowserView::getSelectedItemsOrCurrentItem()
+void FileBrowserView::storeSelectedItemsOrCurrentItem()
 {
-    QModelIndexList modelIndexList;
     QItemSelectionModel *selectionIndexes = mListView->selectionModel();
 
     // by default use selected items
     if (selectionIndexes) {
         if (selectionIndexes->hasSelection()) {
-            modelIndexList = mListView->selectionModel()->selectedIndexes();
+            mSelectionIndexes = mListView->selectionModel()->selectedIndexes();
         } else { // or if none selected, use the current item index
+            mSelectionIndexes.clear();
+            mSelectionIndexes.append(mCurrentIndex);
 //            QModelIndex currentIndex = currentItemIndex();
 //            if (mFileBrowserModel->rowCount(currentItemIndex) > currentItemIndex && currentItemIndex >= 0)
 //            {
@@ -643,15 +797,14 @@
 //            }
         }
     }
-    mClipBoardInUse = true;
-    return modelIndexList;
+//    mClipBoardInUse = true;
 }
 
 // ---------------------------------------------------------------------------
 
 QModelIndex FileBrowserView::currentItemIndex()
 {
-    return mListView->selectionModel()->currentIndex();
+    return mCurrentIndex;//mListView->selectionModel()->currentIndex();
 }
 
 // ---------------------------------------------------------------------------
@@ -694,13 +847,13 @@
     mLocationChanged = true;
     // get selected drive or directory from list view model and open it:
     //if (mListView->selectionModel()->hasSelection()) {
-    if (mListView->selectionModel()->selection().count() != 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->moveDownToDirectory(currentIndex);
+//    if (mListView->selectionModel()->selection().count() != 0) {
+//        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->moveDownToDirectory(mCurrentIndex);
         populateFolderContent();
-    } else {
-        Notifications::showErrorNote("not selected item!");
-    }
+//    } else {
+//        Notifications::showErrorNote("not selected item!");
+//    }
 }
 
 void FileBrowserView::fileOpenDirectory()
@@ -708,13 +861,13 @@
     mLocationChanged = true;
     // get selected drive or directory from list view model and open it:
     //if (mListView->selectionModel()->hasSelection()) {
-    if (mListView->selectionModel()->selection().count() != 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->moveDownToDirectory(currentIndex);
+//    if (mListView->selectionModel()->selection().count() != 0) {
+//        QModelIndex currentIndex = currentItemIndex();
+        mEngineWrapper->moveDownToDirectory(mCurrentIndex);
         populateFolderContent();
-    } else {
-        Notifications::showErrorNote("not selected item!");
-    }
+//    } else {
+//        Notifications::showErrorNote("not selected item!");
+//    }
 }
 
 void FileBrowserView::fileSearch()
@@ -779,9 +932,9 @@
   */
 void FileBrowserView::fileDelete()
 {
-    QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
+    storeSelectedItemsOrCurrentItem();
     const QString messageFormat = "Delete %1 entries?";
-    QString message = messageFormat.arg(currentSelection.count());
+    QString message = messageFormat.arg(mSelectionIndexes.count());
     HbMessageBox::question(message, this, SLOT(doFileDelete(HbAction*)));
 }
 
@@ -791,8 +944,8 @@
 void FileBrowserView::doFileDelete(HbAction* action)
 {
     if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
-        mEngineWrapper->deleteItems(currentSelection);
+        //storeSelectedItemsOrCurrentItem();
+        mEngineWrapper->deleteItems(mSelectionIndexes);
         refreshList();
     }
 }
@@ -802,12 +955,12 @@
   */
 void FileBrowserView::fileRename()
 {
-    QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
-    mEngineWrapper->setCurrentSelection(currentSelection);
+    storeSelectedItemsOrCurrentItem();
+    mEngineWrapper->setCurrentSelection(mSelectionIndexes);
 
-    for (int i(0), ie(currentSelection.count()); i < ie; ++i ) {
+    for (int i(0), ie(mSelectionIndexes.count()); i < ie; ++i ) {
         mProceed = (i == ie-1); // if the last item
-        mModelIndex = currentSelection.at(i);
+        mModelIndex = mSelectionIndexes.at(i);
         FileEntry entry = mEngineWrapper->getFileEntry(mModelIndex);
 
         QString heading = QString("Enter new name");
@@ -857,8 +1010,8 @@
   */
 void FileBrowserView::fileTouch()
 {
-    QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
-    mEngineWrapper->setCurrentSelection(currentSelection);
+    storeSelectedItemsOrCurrentItem();
+    mEngineWrapper->setCurrentSelection(mSelectionIndexes);
 
     if (mEngineWrapper->selectionHasDirs()) {
         const QString message = "Recurse touch for all selected dirs?";
@@ -900,8 +1053,8 @@
 
 void FileBrowserView::fileChecksums(TFileBrowserCmdFileChecksums checksumType)
 {
-    QModelIndex currentIndex = currentItemIndex();
-    mEngineWrapper->showFileCheckSums(currentIndex, checksumType);
+//    QModelIndex currentIndex = currentItemIndex();
+    mEngineWrapper->showFileCheckSums(mCurrentIndex, checksumType);
 }
 
 /**
@@ -933,11 +1086,12 @@
   */
 void FileBrowserView::editCut()
 {
-    mClipboardIndices = getSelectedItemsOrCurrentItem();
+    storeSelectedItemsOrCurrentItem();
+    mClipboardIndexes = mSelectionIndexes;
 
-    mEngineWrapper->clipboardCut(mClipboardIndices);
+    mEngineWrapper->clipboardCut(mClipboardIndexes);
 
-    int operations = mClipboardIndices.count();
+    int operations = mClipboardIndexes.count();
     const QString message = QString ("%1 entries cut to clipboard");
     QString noteMsg = message.arg(operations);
 
@@ -950,11 +1104,12 @@
   */
 void FileBrowserView::editCopy()
 {
-    mClipboardIndices = getSelectedItemsOrCurrentItem();
+    storeSelectedItemsOrCurrentItem();
+    mClipboardIndexes = mSelectionIndexes;
 
-    mEngineWrapper->clipboardCopy(mClipboardIndices);
+    mEngineWrapper->clipboardCopy(mClipboardIndexes);
 
-    int operations = mClipboardIndices.count();
+    int operations = mClipboardIndexes.count();
 
     const QString message = QString ("%1 entries copied to clipboard");
     QString noteMsg = message.arg(operations);
@@ -972,7 +1127,7 @@
 
     // TODO Set entry items here
 
-    someEntryExists = mEngineWrapper->isDestinationEntriesExists(mClipboardIndices, mEngineWrapper->currentPath());
+    someEntryExists = mEngineWrapper->isDestinationEntriesExists(mClipboardIndexes, mEngineWrapper->currentPath());
     if (someEntryExists) {
         fileOverwriteDialog();
     }
@@ -999,10 +1154,10 @@
         bool someEntryExists(false);
 
         // TODO Set entry items here
-        QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
-        mEngineWrapper->setCurrentSelection(currentSelection);
+        storeSelectedItemsOrCurrentItem();
+        mEngineWrapper->setCurrentSelection(mSelectionIndexes);
 
-        someEntryExists = mEngineWrapper->isDestinationEntriesExists(currentSelection, targetDir);
+        someEntryExists = mEngineWrapper->isDestinationEntriesExists(mSelectionIndexes, targetDir);
         if (someEntryExists) {
             fileOverwriteDialog();
         }
@@ -1031,10 +1186,10 @@
         bool someEntryExists(false);
 
         // TODO Set entry items here
-        QModelIndexList currentSelection = getSelectedItemsOrCurrentItem();
-        mEngineWrapper->setCurrentSelection(currentSelection);
+        storeSelectedItemsOrCurrentItem();
+        mEngineWrapper->setCurrentSelection(mSelectionIndexes);
 
-        someEntryExists = mEngineWrapper->isDestinationEntriesExists(currentSelection, targetDir);
+        someEntryExists = mEngineWrapper->isDestinationEntriesExists(mSelectionIndexes, targetDir);
         if (someEntryExists) {
             fileOverwriteDialog();
         }
@@ -1758,7 +1913,7 @@
 // ---------------------------------------------------------------------------
 void FileBrowserView::selectionModeChanged()
 {
-    if (mFileViewMenuActions.mSelection->isChecked()) {
+    if (mOptionMenuActions.mSelection->isChecked()) {
          activateSelectionMode();
      } else {
          deActivateSelectionMode();
--- a/filebrowser/ui/src/notifications.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/filebrowser/ui/src/notifications.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -38,7 +38,7 @@
 void Notifications::showAboutNote()
 {
     showMessageBox(HbMessageBox::MessageTypeInformation,
-                   "Version 5.0.0 - 23h April 2010. Copyright © 2010 Nokia Corporation"
+                   "Version 5.0.1 - 21st May 2010. Copyright © 2010 Nokia Corporation"
                         "and/or its subsidiary(-ies). All rights reserved."
                         "Licensed under Eclipse Public License v1.0.",
                    "About File Browser"
--- a/htiui/HtiAdmin/data/1020DEB6.rss	Thu May 27 12:52:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  A startup control file to add HtiFramework.exe to startup list.
-*
-*/
-
-#include <StartupItem.rh>
-
-RESOURCE STARTUP_ITEM_INFO hti_framework
-    {
-    executable_name = "!:\\sys\\bin\\HtiFramework.exe";
-    recovery = EStartupItemExPolicyNone;
-    }
-
-
-// End of file
--- a/htiui/HtiAdmin/group/HtiAdmin.mmp	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/HtiAdmin/group/HtiAdmin.mmp	Fri Jun 11 13:39:09 2010 +0300
@@ -57,11 +57,6 @@
 TARGETPATH      /private/10003a3f/apps
 END
 
-START RESOURCE  1020DEB6.rss
-HEADER
-TARGETPATH      /private/101f875a/import
-END
-
 LIBRARY         apparc.lib
 LIBRARY         avkon.lib
 LIBRARY         cone.lib
--- a/htiui/HtiAdminQt/HtiAdmin.pro	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/HtiAdminQt/HtiAdmin.pro	Fri Jun 11 13:39:09 2010 +0300
@@ -1,19 +1,3 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
 TEMPLATE = app
 TARGET = HtiAdmin
 DEPENDPATH += .
--- a/htiui/HtiDeviceReboot/src/HtiDeviceReboot.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/HtiDeviceReboot/src/HtiDeviceReboot.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -80,7 +80,7 @@
                 }
             else
                 {
-                error = Reboot((RStarterSession::TResetReason)input);
+                error = Reboot(static_cast<RStarterSession::TResetReason>(input));
                 }
             }
         }
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -631,7 +631,7 @@
                         TInt language = iInstOpts.iLang;
                         if (parameters.Length() == offset+2)
                             {
-                            language = parameters[offset] + parameters[offset+1]<<8;
+                            language = parameters[offset] + (parameters[offset+1]<<8);
                             }
                         if (parameters.Length() == offset+1)
                             {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/data/2002EA9D.rss	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  HTI service plugin for playing audio.
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+
+//  INCLUDES
+#include <ecom/registryinfo.rh>
+
+//  CONSTANTS
+
+//  MACROS
+
+
+//  RESOURCE DEFINITIONS
+// -----------------------------------------------------------------------------
+//
+// theInfo
+// ECom registry info resource.
+//
+// -----------------------------------------------------------------------------
+//
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    // UID for the DLL
+    dll_uid = 0x2002EA9D;
+    // Declare array of interface info
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            // UID of interface that is implemented
+            interface_uid = 0x1020DEB7;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x2002EA9E;
+                    version_no         = 1;
+                    display_name       = "Camera Service";
+                    default_data       = "Camera";
+                    opaque_data        = "";
+                    }
+                };
+            }
+        };
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/inc/EngineVideoRecording.h	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,524 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Video recording engine implementation class.
+*
+*/
+
+#ifndef ENGINEVIDEORECORDING_H
+#define ENGINEVIDEORECORDING_H
+
+//  INCLUDES
+#include <ecam.h>
+#include <videorecorder.h>
+#include <e32std.h>
+
+// CONSTANTS
+const TInt KCameraPriority = -1; // Relative priority (-100...100) of camera HW
+
+// FORWARD DECLARATIONS
+class CVideoRecorderUtility;
+class CVideoRecordingQualityLevels;
+
+
+class TEngineVideoRecordingInfo
+    {
+    public:
+
+        // Camera hardware version present.
+        TVersion iHardwareVersion;
+        // Camera driver software version present.
+        TVersion iSoftwareVersion;
+        // Actual orientation of the camera.
+        TCameraInfo::TCameraOrientation iOrientation;
+
+        // Bitfield of CCamera::TOptions available. 
+        TUint32 iOptionsSupported;
+        // Bitfield of CCamera::TFlash modes available.
+        TUint32 iFlashModesSupported;
+        // Bitfield of CCamera::TExposure modes available.
+        TUint32 iExposureModesSupported;
+        // Bitfield of CCamera::TWhiteBalance modes available.
+        TUint32 iWhiteBalanceModesSupported;
+
+        // Minimum zoom value allowed. Must be negative or 
+        // zero (for not supported).
+        TInt iMinZoom;
+        // Maximum zoom value allowed. Must be positive or 
+        // zero (for not supported).
+        TInt iMaxZoom;
+        // Maximum digital zoom value allowed. Must be positive or 
+        // zero (for not supported).
+        TInt iMaxDigitalZoom;
+
+        // Image size multiplier corresponding to minimum zoom value. 
+        // Must be between 0 and 1 inclusive.
+        TReal32 iMinZoomFactor;
+        // Image size multiplier corresponding to maximum zoom value. 
+        // Must be greater than or equal to 1.
+        TReal32 iMaxZoomFactor;
+        // Image size multiplier corresponding to maximum digital zoom value. 
+        // Must be greater than or equal to 1.
+        TReal32 iMaxDigitalZoomFactor;
+
+        // Count of still image capturing sizes allowed.
+        TInt iNumImageSizesSupported;
+        // Bitfield of still image CCamera::TFormat values supported.
+        TUint32 iImageFormatsSupported;
+    
+        // Count of still image capturing quality levels initialized.
+        TInt iNumStillQualityLevelsSupported;
+        // Count of video recording quality levels initialized.
+        TInt iNumVideoQualityLevelsSupported;
+
+        // Bitfield of CCaeEngine::TOptions available. 
+        TUint32 iCaeOptionsSupported;
+
+        // Integer (e.g. -9) that corresponds to minimum EV compensation value.
+        TInt iMinEvCompensation;
+        // Integer (e.g. 9) that corresponds to maximum EV compensation value.
+        TInt iMaxEvCompensation;
+        // Minimum camera EV compensation value (e.g. -3.0).
+        TReal32 iMinEvCompensationValue;
+        // Maximum camera EV compensation value (e.g. 3.0).
+        TReal32 iMaxEvCompensationValue;
+    };
+
+class MEngineVideoRecordingObserver
+    {
+
+    public:
+        /**
+        * Called asynchronously when CEngineVideoRecording::Init(), CCaeEngine::CEngineVideoRecording(), 
+        * or CEngineVideoRecording::Reserve() completes.
+        * Indicates if Video Recording Engine is ready for operation, 
+        * the camera is reserved and its power is switched on.
+        * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+        * @return void
+        */
+        virtual void MevroInitComplete( TInt aError ) = 0;
+    
+        /**
+        * Called asynchronously when preparing of video recording completes 
+        * after PrepareVideoRecordingL() has been called.
+        * May be called second time with an error code after a successful preparation 
+        * if video recording loses its prepared state for some reason (e.g. audio HW 
+        * is reserved for some other application).
+        * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+        * @return void
+        */
+        virtual void MevroVideoPrepareComplete( TInt aError ) = 0;
+
+        /**
+        * Called (possibly asynchronously) when video recording is running 
+        * after CEngineVideoRecording::StartVideoRecording() or 
+        * CEngineVideoRecording::ResumeVideoRecording() has been called.
+        * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+        * @return void
+        */
+        virtual void MevroVideoRecordingOn( TInt aError ) = 0;
+
+        /**
+        * Called (possibly asynchronously) when video recording is paused after 
+        * CEngineVideoRecording::PauseVideoRecording() has been called.
+        * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+        * @return void
+        */
+        virtual void MevroVideoRecordingPaused( TInt aError ) = 0;
+
+        /**
+        * Called (possibly asynchronously) when video recording is completed 
+        * after CEngineVideoRecording::StopVideoRecording() has been called or 
+        * recording has been completed for some other reason.
+        * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+        * if aError == KErrDiskFull, then disk storage is full.
+        * if aError == KErrCompletion, then clip max size was reached.
+        * @return void
+        */
+        virtual void MevroVideoRecordingComplete( TInt aError ) = 0;
+    };
+
+
+NONSHARABLE_CLASS( CEngineVideoRecording ) : public CBase,
+        public MVideoRecorderUtilityObserver,
+        public MCameraObserver,
+        public MCameraObserver2
+    {
+    public:
+    // Possible zooming modes.
+    enum TZoomMode
+        {
+        EZoomModeDigital        = 0x00, // Digital zoom (default).
+        EZoomModeOptical        = 0x01, // Optical zoom.
+        EZoomModeOpticalDigital = 0x02  // Optical+digital zoom.
+        };
+    
+    public:
+        /**
+        * Destructor.
+        */
+        virtual ~CEngineVideoRecording();
+        
+        // Construction and destruction
+        static CEngineVideoRecording* NewL(MEngineVideoRecordingObserver& aObserver,
+                TInt aCameraIndex);
+        
+        void InitL();
+        
+        void InitVideoRecorderL();
+    
+        void SetVideoRecordingFileNameL( 
+            const TDesC& aVideoClipFileName );
+        
+        void ChangeVideoFileNameL();
+        
+        void PrepareVideoRecordingL( 
+            TInt aVideoQualityIndex );
+
+        void PrepareVideoRecordingL( 
+            const TSize&  aFrameSize, 
+            TReal32       aFrameRate, 
+            TInt          aBitRate, 
+            TBool         aAudioEnabled,
+            const TDesC8& aMimeType, 
+            const TDesC&  aPreferredSupplier, 
+            const TDesC8& aVideoType = KNullDesC8, 
+            const TDesC8& aAudioType = KNullDesC8 );
+
+        void PrepareVideoRecordingL( 
+            const TSize&  aFrameSize, 
+            TReal32       aFrameRate, 
+            TInt          aBitRate, 
+            TBool         aAudioEnabled,
+            TInt          aAudioBitRate, 
+            const TDesC8& aMimeType, 
+            const TDesC&  aPreferredSupplier, 
+            const TDesC8& aVideoType, 
+            const TDesC8& aAudioType );
+        
+        void CloseVideoRecording();
+
+        TInt VideoQualityIndex() const;
+        
+        TInt VideoQualityCount() const;
+
+        void GetVideoFrameSize( 
+            TInt   aVideoQualityIndex, 
+            TSize& aSize ) const;
+
+        TReal32 VideoFrameRate( 
+            TInt aVideoQualityIndex ) const;
+
+        TInt EstimatedVideoRecordingBitRateL( 
+            TInt aVideoQualityIndex ) const;
+
+        void SetVideoClipMaxSizeL( 
+            TInt aMaxClipSizeInBytes = 0 );
+
+        TInt VideoClipMaxSize() const;
+
+        void SetVideoAudioL( 
+            TBool aAudioEnabled );
+
+        TBool VideoAudio() const;
+
+        void StartVideoRecording();
+
+        void StopVideoRecording();
+
+        void PauseVideoRecording();
+
+        void ResumeVideoRecording();
+
+        TTimeIntervalMicroSeconds RemainingVideoRecordingTime() const;
+
+        TBool IsVideoRecording() const;
+        
+        void Reserve();
+
+        void Release();
+
+        void PowerOn();
+
+        void PowerOff();
+    
+        void SetZoomModeL(TZoomMode aZoomMode = EZoomModeDigital);
+    
+        TZoomMode ZoomMode() const;
+    
+        void SetZoomValueL(TInt aZoomValue = 0);
+    
+        TInt ZoomValue() const;
+        
+        TInt MaxZoomValue() const;
+        TInt MinZoomValue() const;
+    
+        void SetBrightnessL(TInt aBrightness = 0);
+    
+        TInt Brightness() const;
+    
+        void SetContrastL(TInt aContrast = 0);
+    
+        TInt Contrast() const;
+    
+        void SetExposureModeL(CCamera::TExposure aExposureMode =
+                CCamera::EExposureAuto);
+    
+        CCamera::TExposure ExposureMode() const;
+    
+        void SetWhiteBalanceModeL(CCamera::TWhiteBalance aWhiteBalanceMode =
+                CCamera::EWBAuto);
+    
+        CCamera::TWhiteBalance WhiteBalanceMode() const;
+    
+        void SetFlashModeL(CCamera::TFlash aFlashMode = CCamera::EFlashNone);
+    
+        CCamera::TFlash FlashMode() const;
+    
+        void ResetToDefaultsL();
+    private:
+        void InitializeInfo(const CCamera& aCamera);
+    
+        /**
+         * Checks that power is on. If not, then leaves.
+         * @since 2.1
+         * @return void
+         */
+        void CheckPowerL();
+    
+        void CancelVideoRecording();
+    
+        void PrepareVideoSettingsL();
+    
+        void FindVideoUidsL(const TDesC8& aMimeType,
+                const TDesC& aPreferredSupplier);
+    
+        TFourCC ConvertAndSetVideoAudioTypeL(const TDesC8& aAudioType);
+    
+    private:    
+        
+        /**
+         * From MVideoRecorderUtilityObserver
+         * Notification to the client that the opening of the video clip has completed,
+         * successfully, or otherwise.
+         * @param  aError
+         *          The status of the video recorder after initialisation.
+         *          This is either KErrNone if the open has completed successfully,
+         *          or one of the system wide error codes.
+         */
+        virtual void MvruoOpenComplete(TInt aError);  
+
+        /**
+         * From MVideoRecorderUtilityObserver
+         * Notification that video recorder is ready to begin recording. This callback
+         * is generated in response to a call to Prepare.
+         * @param  aError
+         *          This is either KErrNone if the video recorder has been prepared for
+         *          recording successfully, or one of the system wide error codes
+         */
+        virtual void MvruoPrepareComplete(TInt aError);
+
+        /**
+         * From MVideoRecorderUtilityObserver
+         * Notification that video recording has completed. This is not called if
+         * recording is explicitly stopped by calling Stop.
+         * @param  aError
+         *          This is either KErrNone if recording was completed successfully,
+         *          or one of the system wide error codes.
+         */
+        virtual void MvruoRecordComplete(TInt aError);
+
+        /**
+         * From MVideoRecorderUtilityObserver
+         * General event notification from controller. These events are specified by
+         * the supplier of the controller.
+         * @param  aEvent
+         * The event sent by the controller.
+         */
+        virtual void MvruoEvent(const TMMFEvent& aEvent);
+        
+    private: // From Camera Observer / ECam.h
+
+        void ReserveComplete( 
+            TInt aError );
+
+        void PowerOnComplete( 
+            TInt aError );
+
+        void ViewFinderFrameReady( 
+            CFbsBitmap& aFrame ){};
+
+        void ImageReady( 
+            CFbsBitmap* aBitmap, 
+            HBufC8*     aData, 
+            TInt        aError ){};
+
+        void FrameBufferReady( 
+            MFrameBuffer* /*aFrameBuffer*/, 
+            TInt          /*aError*/ ) {}; // Empty default because not in use.
+        
+    private: // From Camera Observer2 / ECam.h
+        
+        void HandleEvent(const TECAMEvent& aEvent);
+
+        void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError){};
+
+        void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError){};
+    
+        void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError){};
+    protected:  
+
+        /**
+        * C++ default constructor.
+        */
+        CEngineVideoRecording();
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL(MEngineVideoRecordingObserver& aObserver,
+                TInt aCameraIndex);
+
+    private:
+        // Camera API implementation object.
+        CCamera* iCamera;
+        
+        // Video Recorder API implementation object.
+        CVideoRecorderUtility* iVideoRecorder;
+        
+        // Video Recording observer
+        MEngineVideoRecordingObserver* iVideoRecordingObserver;
+    
+        // Video Recording Engine info object.
+        TEngineVideoRecordingInfo* iInfo;
+        
+        // Video recording quality levels container.
+        CVideoRecordingQualityLevels* iVideoQualityLevels;
+        
+        // Video recording frame size.
+        // This is ptr because video recorder is not necessarily initialized.
+        TSize* iVideoFrameSize;
+
+        // Video recording frame size (to be prepared).
+        // This is ptr because video recorder is not necessarily initialized.
+        TSize* iVideoFrameSizePrep;
+
+        // Video clip file name.
+        HBufC* iVideoClipFileName;
+        
+        // Video Recorder video type.
+        HBufC8* iVideoType;
+        
+        // Boolean indicating if camera module is reserved for the engine.
+        TBool iReserved;
+
+        // Boolean indicating if camera module power is on.
+        TBool iPowerOn;
+        
+        // Boolean indicating if video recording is initialized.
+        TBool iVideoInitialized;
+    
+        // Boolean indicating if video recording is opened.
+        TBool iVideoOpened;
+    
+        // Boolean indicating if video recording is prepared.
+        TBool iVideoPrepared;
+        
+        // Boolean indicating if video recording is currently running.
+        TBool iVideoRecordingRunning;
+
+        // Boolean indicating if video recording is currently paused.
+        TBool iVideoRecordingPaused;
+        
+        // Video recording quality level index currently prepared.
+        TInt iVideoQualityIndex;
+
+        // Handle to the camera used.
+        TInt iCameraHandle;
+
+        // Video Recorder controller UID.
+        TUid iVideoControllerUid;
+
+        // Video Recorder format UID.
+        TUid iVideoFormatUid;
+
+        // Video Recorder audio type.
+        TFourCC iVideoAudioType;
+
+        //// Camera module settings related variables. ////
+
+            // Current zoom mode.
+            TZoomMode iZoomMode;
+
+            // Current zoom value.
+            TInt iZoomValue;
+
+            // Current brightness value.
+            TInt iBrightness;
+
+            // Current contrast value.
+            TInt iContrast;
+
+            // Camera exposure mode.
+            CCamera::TExposure iExposureMode;
+
+            // Camera white balance mode.
+            CCamera::TWhiteBalance iWhiteBalanceMode;
+
+            // Camera flash mode.
+            CCamera::TFlash iFlashMode;
+    //// Video recording parameters prepared. ////
+        
+        // Video recording frame rate.
+        TReal32 iVideoFrameRate;
+
+        // Video recording bit rate.
+        TInt iVideoBitRate;
+
+        // Boolean indicating if audio is enabled with video recording.
+        TBool iVideoAudioEnabled;
+
+        // Video recording audio bit rate.
+        TInt iVideoAudioBitRate;
+
+        // Video recording maximum clip size in bytes.
+        TInt iMaxClipSizeInBytes;
+
+    //// Video recording parameters to be prepared. ////
+
+        // Video recording frame rate (to be prepared).
+        TReal32 iVideoFrameRatePrep;
+
+        // Video recording bit rate (to be prepared).
+        TInt iVideoBitRatePrep;
+
+        // Boolean indicating if audio is enabled with video recording (to be prepared).
+        TBool iVideoAudioEnabledPrep;
+
+        // Video recording audio bit rate (to be prepared).
+        TInt iVideoAudioBitRatePrep;
+
+        // Video recording maximum clip size in bytes (to be prepared).
+        TInt iMaxClipSizeInBytesPrep;
+
+        // Boolean indicating if parameters are/were prepared in video recording preparation..
+        TBool iPrepPars;
+
+        // Boolean indicating if video audio bit rate should be prepared.
+        TBool iPrepareVideoAudioBitRate;
+    };
+
+
+
+
+#endif //ENGINEVIDEORECORDING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/inc/VideoRecordingQualityLevels.h	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Engine video quality level and container.
+*
+*/
+
+#ifndef VIDEORECORDINGQUALITYLEVELS_H_
+#define VIDEORECORDINGQUALITYLEVELS_H_
+
+
+const TInt KMaxVideoStringParLength = 32;
+const TInt KMaxAudioTypeStringParLength = 4;
+
+const TInt KMaxVideoQltyLevelCount = 6;
+
+const TInt KImgWidthSubQCIF  = 128; 
+const TInt KImgHeightSubQCIF = 96; 
+
+const TInt KImgWidthQCIF     = 176; 
+const TInt KImgHeightQCIF    = 144; 
+
+const TInt KImgWidthCIF      = 352; 
+const TInt KImgHeightCIF     = 288; 
+
+_LIT8(KVideoMimeType, "video/3gpp");
+
+_LIT(KPreferredSupplier, "Nokia");
+
+_LIT8(KVideoType, "video/H263-2000");
+
+_LIT8(KAudioType, " AMR");
+
+class CVideoRecordingQualityLevel : public CBase
+    {
+public:
+    CVideoRecordingQualityLevel(){}
+    virtual ~CVideoRecordingQualityLevel(){}
+    
+public:
+
+    // The video recording frame size.
+    TSize iFrameSize;
+
+    // The video recording frame rate.
+    TReal32 iFrameRate;
+
+    // The video recording bit rate.
+    TInt iBitRate;
+
+    // A Boolean indicating if video recording audio is enabled or not.
+    TBool iAudioEnabled;
+
+    // The video recording audio bit rate.
+    TInt iAudioBitRate;
+
+    // The video MIME type (e.g. "video/3gpp").
+    TBuf8<KMaxVideoStringParLength> iMimeType;
+
+    // The preferred supplier of video controller (e.g. "Company X").
+    TBuf<KMaxVideoStringParLength> iPreferredSupplier;
+
+    // The video type (e.g. "video/H263-2000").
+    TBuf8<KMaxVideoStringParLength> iVideoType;
+
+    // The audio type expressed with four characters (e.g. " AMR").
+    TBuf8<KMaxAudioTypeStringParLength> iAudioType;
+
+    // The estimated video recording bit rate to storage (bits per second).
+    TInt iStorageRate;
+    };
+
+
+class CVideoRecordingQualityLevels : public CBase
+    {
+public:
+    /**
+    * Destructor.
+    */
+    virtual ~CVideoRecordingQualityLevels();
+    
+    /**
+    * Two-phased constructor.
+    */
+    static CVideoRecordingQualityLevels* NewL();
+
+    /**
+    * Initializes quality levels to hardcoded default values.
+    * @return The count of quality levels initialized
+    */
+    TInt InitDefaultsL();
+    
+    /**
+    * Gets the quality level count.
+    * @return Quality level count
+    */
+    TInt Count() const;
+
+    /**
+    * Gets the specified quality level.
+    * @param aIndex Quality level index
+    * @return Video quality level
+    */
+    CVideoRecordingQualityLevel& At( 
+        TInt aIndex ) const;
+    
+private:
+
+    /**
+    * C++ constructor.
+    */
+    CVideoRecordingQualityLevels();
+
+    /**
+    * Symbian OS 2nd phase constructor that can leave.
+    */
+    void ConstructL();
+    
+private:
+
+    // Supported video recording quality levels.
+    CArrayFixFlat<CVideoRecordingQualityLevel>* iQualityLevels;
+    };
+
+#endif /* VIDEORECORDINGQUALITYLEVELS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/src/EngineVideoRecording.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,1429 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Engine implementation video recording methods.
+*
+*/
+
+
+// INCLUDE FILES
+#include <HtiLogging.h>
+#include <AudioPreference.h>                // For MMF audio preference definitions.
+
+
+#include "EngineVideoRecording.h"
+#include "VideoRecordingQualityLevels.h"
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CEngineVideoRecording::CEngineVideoRecording
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CEngineVideoRecording::CEngineVideoRecording() :
+    iZoomMode( EZoomModeDigital ), 
+    iExposureMode( CCamera::EExposureAuto ),
+    iWhiteBalanceMode( CCamera::EWBAuto ), 
+    iFlashMode( CCamera::EFlashNone ),
+    iMaxClipSizeInBytes( KMMFNoMaxClipSize ), 
+    iMaxClipSizeInBytesPrep( KMMFNoMaxClipSize )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CEngineVideoRecording::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CEngineVideoRecording::ConstructL(MEngineVideoRecordingObserver& aObserver,
+        TInt aCameraIndex)
+    {
+    HTI_LOG_FUNC_IN( "CEngineVideoRecording::ConstructL" );
+    iVideoRecordingObserver = &aObserver;
+    
+    if ( ( aCameraIndex < 0 ) || 
+         ( aCameraIndex >= CCamera::CamerasAvailable() ) )
+        {
+        HTI_LOG_FORMAT("Cae: CEngineVideoRecording::ConstructL leaving KErrHardwareNotAvailable, aCameraIndex=%d", aCameraIndex );
+        User::Leave( KErrHardwareNotAvailable );
+        }
+
+    // Create a new Camera API implementation object, if supported
+    TRAPD( err, iCamera = CCamera::New2L( static_cast<MCameraObserver2&>(*this), aCameraIndex, KCameraPriority ) );
+    if ( err )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::ConstructL() CCamera::New2L return code=%d", err ); 
+
+        // Create old Camera API implementation object.
+        iCamera = CCamera::NewL( static_cast<MCameraObserver&>(*this), aCameraIndex );
+        HTI_LOG_TEXT("CEngineVideoRecording::ConstructL() using MCameraObserver"); 
+        }
+    else
+        {
+    HTI_LOG_TEXT("CEngineVideoRecording::ConstructL() using MCameraObserver2"); 
+        }
+
+
+    // Get camera handle.
+    iCameraHandle = iCamera->Handle();
+    
+    // Create and initialize info object.
+    iInfo = new( ELeave ) TEngineVideoRecordingInfo;
+    InitializeInfo( *iCamera );
+    
+    HTI_LOG_FUNC_OUT( "CEngineVideoRecording::ConstructL" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CEngineVideoRecording::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CEngineVideoRecording* CEngineVideoRecording::NewL(MEngineVideoRecordingObserver& aObserver,
+        TInt aCameraIndex)
+    {
+    CEngineVideoRecording* self = new (ELeave) CEngineVideoRecording;
+    CleanupStack::PushL( self );
+    self->ConstructL(aObserver, aCameraIndex);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// Destructor
+CEngineVideoRecording::~CEngineVideoRecording()
+    {
+    HTI_LOG_FUNC_IN( "CEngineVideoRecording::~CEngineVideoRecording");
+
+        delete iVideoType;
+        delete iVideoClipFileName;
+
+        // Turn camera power off first, then release camera.
+        if ( iCamera ) 
+            {
+            if ( iReserved ) 
+                {
+                if ( iPowerOn ) 
+                    {
+                    iCamera->PowerOff();
+                    }
+                iCamera->Release();
+                }
+            }
+
+        delete iVideoFrameSizePrep;
+        delete iVideoFrameSize;
+
+        delete iVideoRecorder;
+
+        delete iVideoQualityLevels;
+        
+        delete iCamera;
+
+        REComSession::FinalClose();
+
+        HTI_LOG_FUNC_OUT( "CEngineVideoRecording::~CEngineVideoRecording");
+    }
+
+void CEngineVideoRecording::InitL( )
+    {
+    HTI_LOG_FUNC_IN( "CEngineVideoRecording::InitL");
+
+    // To allow re-initialization, release the camera (first cancels possible 
+    // activities and turns camera power off).
+    Release();
+   
+    iCamera->Reserve();
+
+    HTI_LOG_FUNC_OUT( "CEngineVideoRecording::InitL");
+    }
+
+void CEngineVideoRecording::InitializeInfo( 
+    const CCamera& aCamera )
+    {
+
+    // Initialise Camera (API) info.
+
+    TCameraInfo cameraInfo;
+    aCamera.CameraInfo( cameraInfo );
+
+    iInfo->iHardwareVersion = cameraInfo.iHardwareVersion;
+    iInfo->iSoftwareVersion = cameraInfo.iSoftwareVersion;
+
+    iInfo->iOrientation = cameraInfo.iOrientation;
+
+    iInfo->iOptionsSupported = cameraInfo.iOptionsSupported;
+    
+    iInfo->iFlashModesSupported = cameraInfo.iFlashModesSupported;
+
+    iInfo->iExposureModesSupported = cameraInfo.iExposureModesSupported;
+
+    iInfo->iWhiteBalanceModesSupported = cameraInfo.iWhiteBalanceModesSupported;
+
+    iInfo->iMinZoom = cameraInfo.iMinZoom;
+    iInfo->iMaxZoom = cameraInfo.iMaxZoom;
+    iInfo->iMaxDigitalZoom = cameraInfo.iMaxDigitalZoom;
+
+    iInfo->iMinZoomFactor = cameraInfo.iMinZoomFactor;
+    iInfo->iMaxZoomFactor = cameraInfo.iMaxZoomFactor;
+    iInfo->iMaxDigitalZoomFactor = cameraInfo.iMaxDigitalZoomFactor;
+
+    iInfo->iNumImageSizesSupported = cameraInfo.iNumImageSizesSupported;
+    iInfo->iImageFormatsSupported = cameraInfo.iImageFormatsSupported;
+
+    // Initialize EV compensation info (no supported in this version)
+    iInfo->iMinEvCompensation = 0;
+    iInfo->iMaxEvCompensation = 0;
+    iInfo->iMinEvCompensationValue = 0;
+    iInfo->iMaxEvCompensationValue = 0;
+
+    // Initialize engine info.
+
+    iInfo->iNumStillQualityLevelsSupported = 0; // Quality levels are initialized separately.
+    iInfo->iNumVideoQualityLevelsSupported = 0; // Quality levels are initialized separately.
+
+    }
+void CEngineVideoRecording::InitVideoRecorderL()
+    {
+    HTI_LOG_FUNC_IN( "CEngineVideoRecording::InitVideoRecorderL()");
+
+    iVideoInitialized = EFalse;
+
+    // Close video recording if previously opened/prepared.
+    CloseVideoRecording();
+    
+    // (Re-)initialize these.
+    iMaxClipSizeInBytes = KMMFNoMaxClipSize; 
+    iMaxClipSizeInBytesPrep = KMMFNoMaxClipSize;
+
+    // Create video quality levels container object.
+    iVideoQualityLevels = CVideoRecordingQualityLevels::NewL();
+
+    // Destroy possible video clip file name. (Its allocated elsewhere when file name is set.)
+    delete iVideoClipFileName;
+    iVideoClipFileName = NULL;
+
+    // Create video recorder.
+    delete iVideoRecorder;
+    iVideoRecorder = NULL;
+    iVideoRecorder = CVideoRecorderUtility::NewL( *this , KAudioPriorityVideoRecording,
+        TMdaPriorityPreference( KAudioPrefVideoRecording ) );
+
+    delete iVideoFrameSize;
+    iVideoFrameSize = NULL;
+    iVideoFrameSize = new( ELeave ) TSize();
+    
+    delete iVideoFrameSizePrep;
+    iVideoFrameSizePrep = NULL;
+    iVideoFrameSizePrep = new( ELeave ) TSize();
+
+    iInfo->iNumVideoQualityLevelsSupported = iVideoQualityLevels->InitDefaultsL();
+    iVideoInitialized = ETrue;
+
+    HTI_LOG_FUNC_OUT( "CEngineVideoRecording::InitVideoRecorderL()");
+    }
+
+void CEngineVideoRecording::SetVideoRecordingFileNameL( 
+    const TDesC& aVideoClipFileName )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetVideoRecordingFileNameL");
+
+    if ( !iVideoInitialized || iVideoRecordingRunning ) 
+        {
+        HTI_LOG_TEXT("CEngineVideoRecording::SetVideoRecordingFileNameL leaving KErrNotReady" );
+        User::Leave( KErrNotReady );
+        }
+
+    if ( aVideoClipFileName.Length() > 0 )
+        {
+        // Memorize the video clip file name.
+        delete iVideoClipFileName;
+        iVideoClipFileName = NULL;
+        iVideoClipFileName = aVideoClipFileName.AllocL();
+        }
+    else 
+        {
+        HTI_LOG_TEXT("CEngineVideoRecording::SetVideoRecordingFileNameL leaving KErrArgument");
+        User::Leave( KErrArgument );
+        }
+
+    if ( iVideoPrepared ) 
+        {
+        // Does the actual change of file name, only if video is prepared.
+        // Note: Variated implementation
+        ChangeVideoFileNameL();
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetVideoRecordingFileNameL");
+    }
+
+void CEngineVideoRecording::ChangeVideoFileNameL()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::ChangeVideoFileNameL");
+
+    // Close if previously prepared.
+    CloseVideoRecording();
+    // Open video recorder.
+    iVideoOpened = ETrue; // This is always set to ETrue when 
+                          // OpenFileL has been called to allow 
+                          // freeing resources by CloseVideoRecording().
+    iVideoRecorder->OpenFileL( iVideoClipFileName->Des(),
+                               iCameraHandle,
+                               iVideoControllerUid,
+                               iVideoFormatUid, 
+                               iVideoType->Des(),  
+                               iVideoAudioType );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::ChangeVideoFileNameL");
+    }
+
+void CEngineVideoRecording::PrepareVideoRecordingL( 
+    TInt aVideoQualityIndex )
+    {
+    HTI_LOG_TEXT("CEngineVideoRecording::PrepareVideoRecordingL with video quality index");
+
+    if ( ( aVideoQualityIndex < 0 ) || 
+         ( aVideoQualityIndex >= iVideoQualityLevels->Count() ) ) 
+        {
+        HTI_LOG_TEXT("PrepareVideoRecordingL() leaving KErrArgument");
+        User::Leave( KErrArgument );
+        }
+    
+    PrepareVideoRecordingL( iVideoQualityLevels->At( aVideoQualityIndex ).iFrameSize, 
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iFrameRate, 
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iBitRate, 
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iAudioEnabled,
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iAudioBitRate, 
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iMimeType, 
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iPreferredSupplier, 
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iVideoType,    
+                            iVideoQualityLevels->At( aVideoQualityIndex ).iAudioType );
+    
+    iVideoQualityIndex = aVideoQualityIndex;
+    }
+
+void CEngineVideoRecording::PrepareVideoRecordingL( 
+    const TSize&  aFrameSize, 
+    TReal32       aFrameRate, 
+    TInt          aBitRate, 
+    TBool         aAudioEnabled,
+    const TDesC8& aMimeType, 
+    const TDesC&  aPreferredSupplier, 
+    const TDesC8& aVideoType, 
+    const TDesC8& aAudioType )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::PrepareVideoRecordingL");
+    // Leave if not initialized properly or busy doing something else.
+    if ( !iVideoInitialized || 
+         !iVideoClipFileName || 
+         iVideoRecordingRunning   ) 
+        {
+        HTI_LOG_TEXT("PrepareVideoRecordingL leaving KErrNotReady");
+        User::Leave( KErrNotReady );
+        }
+
+    CheckPowerL();
+    
+    // Leave if video clip file name is not set properly.
+    if ( iVideoClipFileName->Length() == 0 )
+        {
+        HTI_LOG_TEXT("PrepareVideoRecordingL() leaving KErrArgument (iVideoClipFileName)");
+        User::Leave( KErrArgument );
+        }
+
+    // Close if previously opened/prepared.
+    CloseVideoRecording();
+
+    // Find values for iVideoControllerUid and iVideoFormatUid.
+    // Those are also needed if clip file name is changed when prepared.
+    FindVideoUidsL( aMimeType, aPreferredSupplier );
+
+    // Memorize video type.
+    delete iVideoType;
+    iVideoType = NULL;
+    iVideoType = aVideoType.AllocL();
+
+    // Convert audio type from TDesC8 to TFourCC.
+    iVideoAudioType = ConvertAndSetVideoAudioTypeL( aAudioType );
+
+    // Memorize the parameters to be prepared.
+    *iVideoFrameSizePrep   = aFrameSize;
+    iVideoFrameRatePrep    = aFrameRate;
+    iVideoBitRatePrep      = aBitRate;
+    iVideoAudioEnabledPrep = aAudioEnabled;
+
+    // Open video recorder.
+    iVideoOpened = ETrue; // This is always set to ETrue when 
+                          // OpenFileL has been called to allow 
+                          // freeing resources by CloseVideoRecording().
+    iVideoRecorder->OpenFileL( iVideoClipFileName->Des(),
+                               iCameraHandle,
+                               iVideoControllerUid,
+                               iVideoFormatUid, 
+                               iVideoType->Des(),  
+                               iVideoAudioType );
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::PrepareVideoRecordingL");
+    }
+
+void CEngineVideoRecording::PrepareVideoRecordingL( 
+    const TSize&  aFrameSize, 
+    TReal32       aFrameRate, 
+    TInt          aBitRate, 
+    TBool         aAudioEnabled,
+    TInt          aAudioBitRate, 
+    const TDesC8& aMimeType, 
+    const TDesC&  aPreferredSupplier, 
+    const TDesC8& aVideoType, 
+    const TDesC8& aAudioType )
+    {
+    HTI_LOG_TEXT("CEngineVideoRecording::PrepareVideoRecordingL with audio bit rate");
+    // Memorize video audio bit rate value to be prepared.
+    iVideoAudioBitRatePrep = aAudioBitRate;
+    // Force audio bit rate preparation.
+    iPrepareVideoAudioBitRate = ETrue;
+
+    // Call the version without audio bit rate argument.
+    // This is possible because the separate PrepareVideoSettingsL() is doing
+    // settings after succesfull opening of video recording.
+    PrepareVideoRecordingL( aFrameSize, 
+                            aFrameRate, 
+                            aBitRate, 
+                            aAudioEnabled, 
+                            aMimeType, 
+                            aPreferredSupplier, 
+                            aVideoType, 
+                            aAudioType );
+    }
+
+void CEngineVideoRecording::CloseVideoRecording()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::CloseVideoRecording");
+
+    if ( iVideoPrepared ) 
+        {
+        CancelVideoRecording();
+        iVideoPrepared = EFalse;
+        }
+
+    if ( iVideoOpened )
+        {
+        iVideoRecorder->Close();
+        iVideoOpened = EFalse;
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::CloseVideoRecording");
+    }
+
+TInt CEngineVideoRecording::VideoQualityIndex() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::VideoQualityIndex");
+
+    TInt qualityIndex( -1 );
+    if ( iVideoPrepared )
+        {
+        qualityIndex = iVideoQualityIndex;
+        }
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::VideoQualityIndex");
+    return qualityIndex;
+    }
+
+TInt CEngineVideoRecording::VideoQualityCount() const
+        {
+        return iVideoQualityLevels->Count();
+        }
+
+
+void CEngineVideoRecording::GetVideoFrameSize( 
+    TInt aVideoQualityIndex, 
+    TSize& aFrameSize ) const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::GetVideoFrameSize");
+    
+    if ( aVideoQualityIndex >= 0 &&  
+         aVideoQualityIndex < iVideoQualityLevels->Count() )
+        {
+        aFrameSize = iVideoQualityLevels->At( aVideoQualityIndex ).iFrameSize;
+        }
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::GetVideoFrameSize");
+    }
+
+TReal32 CEngineVideoRecording::VideoFrameRate( 
+    TInt aVideoQualityIndex ) const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::VideoFrameRate");
+
+    TReal32 frameRate( 0.0 );
+    if ( aVideoQualityIndex >= 0 &&  
+         aVideoQualityIndex < iVideoQualityLevels->Count() )
+        {
+        frameRate = iVideoQualityLevels->At( aVideoQualityIndex ).iFrameRate;
+        }
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::VideoFrameRate");
+    return frameRate;
+    }
+
+TInt CEngineVideoRecording::EstimatedVideoRecordingBitRateL( 
+    TInt aVideoQualityIndex ) const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::EstimatedVideoRecordingBitRateL");
+
+    TInt storageRate( 0 );
+    if ( aVideoQualityIndex >= 0 &&  
+         aVideoQualityIndex < iVideoQualityLevels->Count() )
+        {
+        storageRate = iVideoQualityLevels->At( aVideoQualityIndex ).iStorageRate;
+        }
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::EstimatedVideoRecordingBitRateL");
+    return storageRate;
+    }
+
+void CEngineVideoRecording::SetVideoClipMaxSizeL( 
+    TInt aMaxClipSizeInBytes )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetVideoClipMaxSizeL");
+
+    if ( !iVideoInitialized || iVideoRecordingRunning ) 
+        {
+        HTI_LOG_TEXT("SetVideoClipMaxSizeL leaving KErrNotReady");
+        User::Leave( KErrNotReady );
+        }
+
+    if ( aMaxClipSizeInBytes > 0 ) 
+        {
+        iMaxClipSizeInBytesPrep = aMaxClipSizeInBytes;
+        }
+    else 
+        {
+        iMaxClipSizeInBytesPrep = KMMFNoMaxClipSize;
+        }
+
+    if ( iVideoPrepared )
+        {
+        iPrepPars = ETrue;
+        iVideoRecorder->SetMaxClipSizeL( iMaxClipSizeInBytesPrep );
+        iVideoRecorder->Prepare();
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetVideoClipMaxSizeL");
+    }
+
+TInt CEngineVideoRecording::VideoClipMaxSize() const 
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::VideoClipMaxSize");
+
+    TInt maxClipSizeInBytes( 0 );
+    if ( iMaxClipSizeInBytes != KMMFNoMaxClipSize ) 
+        {
+        maxClipSizeInBytes = iMaxClipSizeInBytes;
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::VideoClipMaxSize");
+    return maxClipSizeInBytes;
+    }
+
+void CEngineVideoRecording::SetVideoAudioL( 
+    TBool aAudioEnabled )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetVideoAudioL");
+
+    if ( !iVideoInitialized || iVideoRecordingRunning ) 
+        {
+        HTI_LOG_TEXT("SetVideoAudioL leaving KErrNotReady");
+        User::Leave( KErrNotReady );
+        }
+
+    iVideoAudioEnabledPrep = aAudioEnabled;
+    iVideoRecorder->SetAudioEnabledL( iVideoAudioEnabledPrep );
+    iPrepPars = ETrue;
+    iVideoRecorder->Prepare();
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetVideoAudioL");
+    }
+
+TBool CEngineVideoRecording::VideoAudio() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::VideoAudio");
+
+    TBool audioEnabled( EFalse );
+    if ( iVideoRecorder )
+        {
+        TRAPD( error, { audioEnabled = iVideoRecorder->AudioEnabledL(); } );
+        if ( error != KErrNone ) 
+            {
+            audioEnabled = EFalse;
+            }
+        }
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::VideoAudio");
+    return audioEnabled;
+    }
+
+void CEngineVideoRecording::StartVideoRecording()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::StartVideoRecording");
+
+    TInt error( KErrNone );
+
+    if ( iVideoPrepared && !iVideoRecordingRunning ) 
+        {
+        iVideoRecordingRunning = ETrue;
+        iVideoRecordingPaused = EFalse;
+        
+       // Start video recording.
+        iVideoRecorder->Record();
+        }
+    else 
+        {
+        error = KErrNotReady;
+        }
+
+
+    iVideoRecordingObserver->MevroVideoRecordingOn( error );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::StartVideoRecording");
+    }
+
+void CEngineVideoRecording::StopVideoRecording()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::StopVideoRecording");
+        
+    TInt stoppingError( KErrNone );
+    
+    if ( iVideoRecordingRunning ) 
+        {
+        iVideoRecordingRunning = EFalse;
+        stoppingError = iVideoRecorder->Stop();
+        
+        // Can't be paused anymore.
+        iVideoRecordingPaused = EFalse;
+        }
+    else 
+        {
+        stoppingError = KErrNotReady;
+        }
+
+    iVideoRecordingObserver->MevroVideoRecordingComplete( stoppingError );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::StopVideoRecording");
+    }
+
+void CEngineVideoRecording::PauseVideoRecording()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::PauseVideoRecording");
+
+    TInt error( KErrNone );
+
+    if ( iVideoRecordingRunning && !iVideoRecordingPaused ) 
+        {
+        // Pause video recording.
+        TRAP( error, iVideoRecorder->PauseL() );
+
+        if ( error == KErrNone ) 
+            {
+            iVideoRecordingPaused = ETrue;
+            }
+        }
+    else 
+        {
+        error = KErrNotReady;
+        }
+
+    iVideoRecordingObserver->MevroVideoRecordingPaused( error );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::PauseVideoRecording");
+    }
+
+void CEngineVideoRecording::ResumeVideoRecording()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::ResumeVideoRecording");
+
+    TInt error( KErrNone );
+
+    if ( iVideoRecordingRunning && iVideoRecordingPaused ) 
+        {
+        // Start video recording.
+        iVideoRecorder->Record();
+        iVideoRecordingPaused = EFalse;
+        }
+    else 
+        {
+        error = KErrNotReady;
+        }
+
+    iVideoRecordingObserver->MevroVideoRecordingOn( error );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::ResumeVideoRecording");
+    }
+
+TTimeIntervalMicroSeconds CEngineVideoRecording::RemainingVideoRecordingTime() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::RemainingVideoRecordingTime");
+    
+    TTimeIntervalMicroSeconds remaining( 0 );
+    if ( iVideoRecorder )
+        {
+        remaining = iVideoRecorder->RecordTimeAvailable();
+        }
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::RemainingVideoRecordingTime");
+    return remaining;
+    }
+
+TBool CEngineVideoRecording::IsVideoRecording() const
+    {
+    return iVideoRecordingRunning;    
+    }
+
+
+void CEngineVideoRecording::CancelVideoRecording()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::CancelVideoRecording");
+    
+    if ( iVideoRecordingRunning ) 
+        {
+        iVideoRecordingRunning = EFalse;
+        // Stop video recording. Do not call MevroVideoRecordingComplete()
+        (void) iVideoRecorder->Stop();
+        iVideoRecordingPaused = EFalse;
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::CancelVideoRecording");
+    }
+
+void CEngineVideoRecording::PrepareVideoSettingsL()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::PrepareVideoSettingsL");
+
+    iVideoRecorder->SetVideoFrameSizeL( *iVideoFrameSizePrep );
+    iVideoRecorder->SetVideoFrameRateL( iVideoFrameRatePrep );
+    iVideoRecorder->SetVideoBitRateL( iVideoBitRatePrep );
+    iVideoRecorder->SetAudioEnabledL( iVideoAudioEnabledPrep );
+    if ( iPrepareVideoAudioBitRate )
+        {
+        iVideoRecorder->SetAudioBitRateL( iVideoAudioBitRatePrep );
+        iPrepareVideoAudioBitRate = EFalse;
+        }
+    iVideoRecorder->SetMaxClipSizeL( iMaxClipSizeInBytesPrep );
+
+    // Set the recording gain to the maximum
+    TInt gain = iVideoRecorder->GainL();
+    HTI_LOG_FORMAT("CEngineVideoRecording::PrepareVideoSettingsL() GainL was %d", gain );
+    gain = iVideoRecorder->MaxGainL();
+    HTI_LOG_FORMAT("CEngineVideoRecording::PrepareVideoSettingsL() MaxGainL is %d", gain );
+    iVideoRecorder->SetGainL( gain );
+    gain = iVideoRecorder->GainL();
+    HTI_LOG_FORMAT("CEngineVideoRecording::PrepareVideoSettingsL() GainL set to %d", gain );
+
+    iPrepPars = ETrue;
+    iVideoRecorder->Prepare();
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::PrepareVideoSettingsL");
+    }
+
+void CEngineVideoRecording::FindVideoUidsL(
+    const TDesC8& aMimeType, 
+    const TDesC&  aPreferredSupplier )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::FindVideoUidsL");
+
+    iVideoControllerUid.iUid = 0;
+    iVideoFormatUid.iUid = 0; 
+
+    // Retrieve a list of possible controllers from ECOM.
+    //
+    // Controller must support recording the requested mime type.
+    // Controller must be provided by preferred supplier.
+
+    CMMFControllerPluginSelectionParameters* cSelect = 
+        CMMFControllerPluginSelectionParameters::NewLC();
+    CMMFFormatSelectionParameters* fSelect = 
+        CMMFFormatSelectionParameters::NewLC();
+
+    fSelect->SetMatchToMimeTypeL( aMimeType );
+    cSelect->SetRequiredRecordFormatSupportL( *fSelect );
+    cSelect->SetPreferredSupplierL( aPreferredSupplier,
+       CMMFPluginSelectionParameters::EOnlyPreferredSupplierPluginsReturned );
+
+    RMMFControllerImplInfoArray controllers;
+    CleanupResetAndDestroyPushL( controllers );
+    cSelect->ListImplementationsL( controllers );
+
+    if ( controllers.Count() < 1 )
+        {
+        // No appropriate controllers found.
+        HTI_LOG_TEXT("CEngineVideoRecording::FindVideoUidsL() leaving KErrNotSupported (no controllers found)");
+        User::Leave( KErrNotSupported );
+        }
+
+    TBool found( EFalse );
+    for ( TInt contInd = 0; contInd < controllers.Count() && !found; contInd++ ) // there can be more than one controller, search from all of them
+        {
+        // Get the controller UID.
+        iVideoControllerUid = controllers[contInd]->Uid();
+        HTI_LOG_FORMAT("CEngineVideoRecording::FindVideoUidsL()  iVideoControllerUid=%x", iVideoControllerUid.iUid );
+
+        // Inquires the controller about supported formats.
+        RMMFFormatImplInfoArray formats = controllers[contInd]->RecordFormats();
+
+        // Get the first format that supports our mime type.
+        for ( TInt i = 0; i < formats.Count(); i++ )
+            {
+            if ( formats[i]->SupportsMimeType( aMimeType ) )
+                {
+                iVideoFormatUid = formats[i]->Uid(); // set the UID
+                found = ETrue;
+                HTI_LOG_FORMAT("CEngineVideoRecording::FindVideoUidsL() Found iVideoFormatUid=%x", iVideoFormatUid.iUid);
+                break;
+                }
+            }
+        }
+    if ( !found )
+        {
+        // No appropriate video format found.
+        HTI_LOG_TEXT("CEngineVideoRecording::FindVideoUidsL() leaving KErrNotSupported (no video format found)");
+        User::Leave( KErrNotSupported );
+        }
+
+    CleanupStack::PopAndDestroy( 3, cSelect ); // cselect, fselect, controllers
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::FindVideoUidsL");
+    }
+
+
+TFourCC CEngineVideoRecording::ConvertAndSetVideoAudioTypeL(
+    const TDesC8& aAudioType )
+    {
+    if ( aAudioType == KNullDesC8 )
+        {
+        return KMMFFourCCCodeNULL;
+        }
+    else
+        {
+        if ( aAudioType.Length() != 4 ) 
+            {
+            User::Leave( KErrArgument );
+            }
+        return TFourCC( aAudioType[0], aAudioType[1], aAudioType[2], aAudioType[3] );
+        }
+    }
+
+void CEngineVideoRecording::Reserve()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::Reserve");
+
+    if ( !iReserved ) 
+        {
+        iCamera->Reserve();
+        }
+    else if ( !iPowerOn ) // in case previous reserve ok, but poweron failed
+        {
+        PowerOn();
+        }
+
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::Reserve");
+    }
+
+
+void CEngineVideoRecording::Release()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::Release");
+
+    if ( iReserved ) 
+        {
+        PowerOff();         // Cancel all activities (if any) and turn power off.
+        iCamera->Release(); // Release Camera HW.
+        iReserved = EFalse;
+        iVideoPrepared = EFalse;
+        iVideoOpened = EFalse;
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::Release");
+    }
+
+
+void CEngineVideoRecording::PowerOn()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::PowerOn");
+
+    if ( iReserved && !iPowerOn ) 
+        {
+        iCamera->PowerOn();
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::PowerOn");
+    }
+
+
+void CEngineVideoRecording::PowerOff()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::PowerOff");
+
+    if ( iPowerOn ) 
+        {
+        iCamera->PowerOff();
+        iPowerOn = EFalse;
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::PowerOff");
+    }
+
+
+void CEngineVideoRecording::SetZoomModeL( 
+    TZoomMode aZoomMode )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetZoomModeL");
+
+    // Currently supporting digital and optical zooms, not EZoomModeOpticalDigital.
+    if ( ( aZoomMode != EZoomModeDigital ) && ( aZoomMode != EZoomModeOptical ) )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::SetZoomModeL leaving KErrNotSupported, aZoomMode=%d", aZoomMode );
+        User::Leave( KErrNotSupported );
+        }
+
+    iZoomMode = aZoomMode;
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetZoomModeL");
+    }
+
+
+CEngineVideoRecording::TZoomMode CEngineVideoRecording::ZoomMode() const
+    {
+    HTI_LOG_TEXT("CEngineVideoRecording::ZoomMode");
+
+    return iZoomMode;
+    }
+
+
+void CEngineVideoRecording::SetZoomValueL( 
+    TInt aZoomValue )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetZoomValueL");
+
+    CheckPowerL();
+
+    switch ( iZoomMode )
+        {
+        case EZoomModeDigital:
+            // Leave if zoom factor is out of range.
+            if ( ( aZoomValue < 0 ) || 
+                 ( aZoomValue > iInfo->iMaxDigitalZoom ) )
+                {
+                HTI_LOG_FORMAT("CEngineVideoRecording::SetZoomValueL leaving KErrArgument, aZoomValue=%d", aZoomValue );
+                HTI_LOG_FORMAT("The min digital zool value is 0, the max is %d", iInfo->iMaxDigitalZoom);
+                User::Leave( KErrArgument );
+                }
+            // Set DIGITAL zoom value.
+            iCamera->SetDigitalZoomFactorL( aZoomValue );
+            iZoomValue = aZoomValue;
+            break;
+        case EZoomModeOptical:
+            // Leave if zoom factor is out of range.
+            if ( ( aZoomValue < iInfo->iMinZoom ) || 
+                 ( aZoomValue > iInfo->iMaxZoom ) )
+                {
+                HTI_LOG_FORMAT("CEngineVideoRecording::SetZoomValueL leaving KErrArgument, aZoomValue=%d", aZoomValue );
+                HTI_LOG_FORMAT("The max optical zoom value is %d", iInfo->iMaxZoom);
+                HTI_LOG_FORMAT("The min optical zoom value is %d", iInfo->iMinZoom);
+                if(iInfo->iMinZoom == iInfo->iMaxZoom)
+                    {
+                    User::Leave(KErrNotSupported);
+                    }
+                User::Leave( KErrArgument );
+                }
+            // Set OPTICAL zoom value.
+            iCamera->SetZoomFactorL( aZoomValue );
+            iZoomValue = aZoomValue;
+            break;
+        default:
+            // EZoomModeOpticalDigital not supported
+            HTI_LOG_FORMAT("CEngineVideoRecording::SetZoomValueL leaving KErrNotSupported, iZoomMode=%d", iZoomMode );
+            User::Leave( KErrNotSupported );
+            break;
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetZoomValueL");
+    }
+
+
+TInt CEngineVideoRecording::ZoomValue() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::ZoomValue");
+    
+    TInt zoomValue( 0 );
+    if ( iPowerOn )
+        {
+        switch ( iZoomMode )
+            {
+            case EZoomModeDigital:
+                zoomValue = iCamera->DigitalZoomFactor();
+                break;
+            case EZoomModeOptical:
+                zoomValue = iCamera->ZoomFactor();
+                break;
+            default:
+                // EZoomModeOpticalDigital not supported
+                break;
+            }
+        }    
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::ZoomValue");
+    return zoomValue;
+    }
+
+TInt CEngineVideoRecording::MaxZoomValue() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MaxZoomValue");
+    
+    TInt zoomValue( 0 );
+    if ( iPowerOn )
+        {
+        switch ( iZoomMode )
+            {
+            case EZoomModeDigital:
+                zoomValue = iInfo->iMaxDigitalZoom;
+                break;
+            case EZoomModeOptical:
+                zoomValue = iInfo->iMaxZoom;
+                break;
+            default:
+                // EZoomModeOpticalDigital not supported
+                break;
+            }
+        }
+        
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::MaxZoomValue");
+    return zoomValue;
+    }
+
+TInt CEngineVideoRecording::MinZoomValue() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MinZoomValue");
+    
+    TInt zoomValue( 0 );
+    if ( iPowerOn )
+        {
+        switch ( iZoomMode )
+            {
+            case EZoomModeDigital:
+                zoomValue = 0;
+                break;
+            case EZoomModeOptical:
+                zoomValue = iInfo->iMinZoom;
+                break;
+            default:
+                // EZoomModeOpticalDigital not supported
+                break;
+            }
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::MinZoomValue");
+    return zoomValue;
+    }
+void CEngineVideoRecording::SetBrightnessL( 
+    TInt aBrightness )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetBrightnessL");
+    // Leave if not supported.
+    if ( !( iInfo->iOptionsSupported & TCameraInfo::EBrightnessSupported ) )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::SetBrightnessL leaving KErrNotSupported, aBrightness=%d", aBrightness );
+        User::Leave( KErrNotSupported );
+        }
+
+    CheckPowerL();
+
+    iCamera->SetBrightnessL( aBrightness );
+    iBrightness = aBrightness;
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetBrightnessL"); 
+    }
+
+
+TInt CEngineVideoRecording::Brightness() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::Brightness");
+
+    TInt brightness( 0 );
+    if ( iPowerOn && ( iInfo->iOptionsSupported & TCameraInfo::EBrightnessSupported ) )
+        {
+        brightness = iCamera->Brightness();
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::Brightness");
+    return brightness;
+    }
+
+
+void CEngineVideoRecording::SetContrastL( 
+    TInt aContrast )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetContrastL");
+    
+    // Leave if not supported.
+    if ( !( iInfo->iOptionsSupported & TCameraInfo::EContrastSupported ) )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::SetContrastL leaving KErrNotSupported, aContrast=%d", aContrast );
+        User::Leave( KErrNotSupported );
+        }
+
+    CheckPowerL();
+
+    iCamera->SetContrastL( aContrast );
+    iContrast = aContrast;
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetContrastL");
+    }
+
+
+TInt CEngineVideoRecording::Contrast() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::Contrast");
+    TInt contrast( 0 );
+    if ( iPowerOn && ( iInfo->iOptionsSupported & TCameraInfo::EContrastSupported ) )
+        {
+        contrast = iCamera->Contrast();
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::Contrast");
+    return contrast;
+    }
+
+
+void CEngineVideoRecording::SetExposureModeL( 
+    CCamera::TExposure aExposureMode )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetExposureModeL");
+
+    // Leave is requested exposure mode is not supported, 
+    // EExposureAuto should be always supported.
+    if ( ( ( aExposureMode != CCamera::EExposureAuto ) && 
+          !( aExposureMode & iInfo->iExposureModesSupported ) ) ||
+           ( aExposureMode < 0 ) )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::SetExposureModeL leaving KErrNotSupported, aExposureMode=%d", aExposureMode );
+        User::Leave( KErrNotSupported );
+        }
+
+    CheckPowerL();
+
+    iCamera->SetExposureL( aExposureMode );
+    iExposureMode = aExposureMode;
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetExposureModeL");
+    }
+
+
+CCamera::TExposure CEngineVideoRecording::ExposureMode() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::ExposureMode");
+
+    CCamera::TExposure exposureMode( CCamera::EExposureAuto );
+    if ( iPowerOn )
+        {
+        exposureMode = iCamera->Exposure();
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::ExposureMode");
+    return exposureMode;
+    }
+
+
+void CEngineVideoRecording::SetWhiteBalanceModeL( 
+    CCamera::TWhiteBalance aWhiteBalanceMode )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetWhiteBalanceModeL");
+
+    // Leave is requested WB mode is not supported. 
+    // EWBAuto is always supported.
+    if ( ( ( aWhiteBalanceMode != CCamera::EWBAuto ) && 
+          !( aWhiteBalanceMode & iInfo->iWhiteBalanceModesSupported ) ) ||
+           ( aWhiteBalanceMode < 0 ) )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::SetWhiteBalanceModeL leaving KErrNotSupported, aWhiteBalanceMode=%d", aWhiteBalanceMode );
+        User::Leave( KErrNotSupported );
+        }
+    
+    CheckPowerL();
+
+    iCamera->SetWhiteBalanceL( aWhiteBalanceMode );
+    iWhiteBalanceMode = aWhiteBalanceMode;
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetWhiteBalanceModeL");
+    }
+
+
+CCamera::TWhiteBalance CEngineVideoRecording::WhiteBalanceMode() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::WhiteBalanceMode");
+
+    CCamera::TWhiteBalance whiteBalanceMode( CCamera::EWBAuto );
+    if ( iPowerOn )
+        {
+        whiteBalanceMode = iCamera->WhiteBalance();
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::WhiteBalanceMode");
+    return whiteBalanceMode;
+    }
+
+
+void CEngineVideoRecording::SetFlashModeL( 
+    CCamera::TFlash aFlashMode )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::SetFlashModeL");
+    
+    // Leave is requested flash mode is not supported. 
+    // EFlashNone is always supported.
+    if ( ( ( aFlashMode != CCamera::EFlashNone ) && 
+          !( aFlashMode & iInfo->iFlashModesSupported ) ) || 
+           ( aFlashMode < 0 ) )
+        {
+        HTI_LOG_FORMAT("CEngineVideoRecording::SetFlashModeL leaving KErrNotSupported, aFlashMode=%d", aFlashMode );
+        User::Leave( KErrNotSupported );
+        }
+
+    CheckPowerL();
+
+    iCamera->SetFlashL( aFlashMode );
+    iFlashMode = aFlashMode;
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::SetFlashModeL");
+    }
+
+
+CCamera::TFlash CEngineVideoRecording::FlashMode() const
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::FlashMode");
+
+    CCamera::TFlash flashMode( CCamera::EFlashNone );
+    if ( iPowerOn )
+        {
+        flashMode = iCamera->Flash();
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::FlashMode");
+    return flashMode;
+    }
+
+
+void CEngineVideoRecording::ResetToDefaultsL()
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::ResetToDefaultsL");
+
+    SetExposureModeL();
+    SetWhiteBalanceModeL();
+    SetZoomModeL();
+    SetZoomValueL();
+    SetFlashModeL();
+
+    // Reset this setting only if it is supported by Camera API.
+    if ( iInfo->iOptionsSupported & TCameraInfo::EBrightnessSupported )
+        {
+        SetBrightnessL();
+        }
+
+    // Reset this setting only if it is supported by Camera API.
+    if ( iInfo->iOptionsSupported & TCameraInfo::EContrastSupported )
+        {
+        SetContrastL();
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::ResetToDefaultsL");
+    }
+
+void CEngineVideoRecording::CheckPowerL()
+    {
+    if ( !iPowerOn ) 
+        {
+        HTI_LOG_TEXT("CEngineVideoRecording::CheckPowerL() leaving KErrNotReady (iPowerOn)");
+        User::Leave( KErrNotReady );
+        }
+    }
+
+void CEngineVideoRecording::MvruoOpenComplete(TInt aError)
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MvruoOpenComplete");
+
+    HTI_LOG_FORMAT("aError = %d", aError);
+    if ( aError == KErrNone )
+        {
+        // To get default video audio bit rate.
+        TRAP( aError, { iVideoAudioBitRate = iVideoRecorder->AudioBitRateL(); } );
+        // (ignore possible error)
+        // Prepare settings only if no errors in opening.
+        TRAP( aError, PrepareVideoSettingsL() );
+        if ( aError != KErrNone ) 
+            {
+            iVideoRecordingObserver->MevroVideoPrepareComplete( aError );
+            }
+        }
+    else
+        {
+        iVideoRecordingObserver->MevroVideoPrepareComplete( aError );
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::MvruoOpenComplete");
+    }
+
+void CEngineVideoRecording::MvruoPrepareComplete(TInt aError)
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MvruoPrepareComplete");
+
+    HTI_LOG_FORMAT("aError = %d", aError);
+    if ( iVideoOpened && ( aError == KErrNone ) )
+        {
+        iVideoPrepared = ETrue; // Later errors with settings after 
+                                // do not change the value.
+        }
+
+    if ( iPrepPars )
+        {
+        iPrepPars = EFalse;
+        // If no error, then fresh parameters are valid.
+        // Otherwise, old parameters are kept.
+        if ( aError == KErrNone )
+            {
+            *iVideoFrameSize    = *iVideoFrameSizePrep;
+            iVideoFrameRate     = iVideoFrameRatePrep;
+            iVideoBitRate       = iVideoBitRatePrep;
+            iVideoAudioEnabled  = iVideoAudioEnabledPrep;
+            iVideoAudioBitRate  = iVideoAudioBitRatePrep;
+            iMaxClipSizeInBytes = iMaxClipSizeInBytesPrep;
+            }
+        else 
+            {
+            *iVideoFrameSizePrep    = *iVideoFrameSize;
+            iVideoFrameRatePrep     = iVideoFrameRate;
+            iVideoBitRatePrep       = iVideoBitRate;
+            iVideoAudioEnabledPrep  = iVideoAudioEnabled;
+            iVideoAudioBitRatePrep  = iVideoAudioBitRate;
+            iMaxClipSizeInBytesPrep = iMaxClipSizeInBytes;
+            }
+        }
+
+    iVideoRecordingObserver->MevroVideoPrepareComplete( aError );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::MvruoPrepareComplete");
+    }
+
+void CEngineVideoRecording::MvruoRecordComplete(TInt aError)
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MvruoRecordComplete");
+
+    HTI_LOG_FORMAT("aError = %d", aError);    
+
+    // Recording stopped: can't be paused anymore.
+    iVideoRecordingPaused = EFalse; 
+        
+    if ( iVideoRecordingRunning) // To ensure that McaeoVideoRecordingComplete 
+        {                                                   // gets called just once per recording.
+        iVideoRecordingRunning = EFalse;
+        
+        // Close video recording always in error case. Otherwise the camcorder plugin would
+        // be in indeterminated state. 
+        // The code KErrCompletion means that video reocording has been completed by timer
+        if ( aError && aError != KErrCompletion && aError != KErrDiskFull ) 
+            { 
+            CloseVideoRecording();
+            }
+            
+        iVideoRecordingObserver->MevroVideoRecordingComplete( aError );
+        }
+    
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MvruoRecordComplete");
+    }
+
+void CEngineVideoRecording::MvruoEvent(const TMMFEvent& /*aEvent*/)
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::MvruoEvent");
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::MvruoEvent");
+    }
+
+void CEngineVideoRecording::ReserveComplete(                                 
+    TInt aError )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::ReserveComplete");
+
+    if ( aError == KErrNone )
+        {
+        iReserved = ETrue;
+        PowerOn();
+        }
+    else
+        {
+        iVideoRecordingObserver->MevroInitComplete( aError );
+        }
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::ReserveComplete");
+    }
+
+
+void CEngineVideoRecording::PowerOnComplete( 
+    TInt aError )
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::PowerOnComplete");
+
+    if ( aError == KErrNone ) 
+        {
+        iPowerOn = ETrue;
+        }
+    
+    iVideoRecordingObserver->MevroInitComplete( aError );
+
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::PowerOnComplete");
+    }
+
+void CEngineVideoRecording::HandleEvent( const TECAMEvent& aEvent)
+    {
+    HTI_LOG_FUNC_IN("CEngineVideoRecording::HandleEvent");
+    if (aEvent.iEventType == KUidECamEventCameraNoLongerReserved)
+        {
+        HTI_LOG_TEXT("CEngineVideoRecording::HandleEvent() KUidECamEventCameraNoLongerReserved");
+        iPowerOn = EFalse;
+        iReserved = EFalse;
+        iVideoPrepared = EFalse;
+        iVideoOpened = EFalse;
+        iVideoRecordingObserver->MevroInitComplete(KErrInUse); // Tell the client that other application has taken the camera
+        }
+    else if (aEvent.iEventType == KUidECamEventPowerOnComplete)
+        {
+        HTI_LOG_TEXT("CEngineVideoRecording::HandleEvent() KUidECamEventPowerOnComplete");
+        PowerOnComplete(aEvent.iErrorCode);
+        }
+    else if (aEvent.iEventType == KUidECamEventReserveComplete)
+        {
+        HTI_LOG_TEXT("CEngineVideoRecording::HandleEvent() KUidECamEventReserveComplete");
+        ReserveComplete(aEvent.iErrorCode);
+        }
+    
+    HTI_LOG_FUNC_OUT("CEngineVideoRecording::HandleEvent");
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/engine/src/VideoRecordingQualityLevels.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Engine video quality level and container.
+*
+*/
+
+
+#include <e32std.h>
+#include <e32base.h> 
+
+
+#include "VideoRecordingQualityLevels.h"
+
+
+// CONSTANTS
+const TInt KQualityLevelArrayGranularity = 3;
+
+CVideoRecordingQualityLevels::CVideoRecordingQualityLevels()
+    {
+    // TODO Auto-generated constructor stub
+
+    }
+
+CVideoRecordingQualityLevels::~CVideoRecordingQualityLevels()
+    {
+    delete iQualityLevels;
+    }
+
+void CVideoRecordingQualityLevels::ConstructL()
+    {
+
+    iQualityLevels = new( ELeave ) CArrayFixFlat<CVideoRecordingQualityLevel>( KQualityLevelArrayGranularity );
+
+    }
+
+CVideoRecordingQualityLevels* CVideoRecordingQualityLevels::NewL()
+    {
+
+    CVideoRecordingQualityLevels* self = new( ELeave ) CVideoRecordingQualityLevels;
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+
+    return self;
+    }
+
+TInt CVideoRecordingQualityLevels::InitDefaultsL()
+    {
+
+    // Delete all elements from the array and 
+    // free the memory allocated to the array buffer.
+    iQualityLevels->Reset();
+
+    // Initialize hardcoded default quality levels.
+
+    TSize size;
+
+    CVideoRecordingQualityLevel* videoQualityLevel = new( ELeave ) CVideoRecordingQualityLevel;
+    CleanupStack::PushL( videoQualityLevel );
+    
+    // Level 0:
+    size.SetSize( KImgWidthQCIF, KImgHeightQCIF );
+    videoQualityLevel->iFrameSize    = size;
+    videoQualityLevel->iFrameRate    = 15.0;  // Frames per second. Basically HW dependent.
+    videoQualityLevel->iBitRate      = 64000; // Bits per second. Basically HW dependent.
+    videoQualityLevel->iAudioEnabled = EFalse;
+    videoQualityLevel->iAudioBitRate = 12200; // Bits per second. Basically HW dependent.
+    videoQualityLevel->iMimeType.Copy( KVideoMimeType );
+    videoQualityLevel->iPreferredSupplier.Copy( KPreferredSupplier );
+    videoQualityLevel->iVideoType.Copy( KVideoType );
+    videoQualityLevel->iAudioType.Copy( KAudioType );
+    videoQualityLevel->iStorageRate = 78000;  // That many bits per second to store. Estimate only
+
+    iQualityLevels->AppendL( *videoQualityLevel );
+
+    // Level 1:
+    size.SetSize( KImgWidthSubQCIF, KImgHeightSubQCIF );
+    videoQualityLevel->iFrameSize    = size;
+    videoQualityLevel->iFrameRate    = 15.0;  // Frames per second. Basically HW dependent.
+    videoQualityLevel->iBitRate      = 60000; // Bits per second. Basically HW dependent.
+    videoQualityLevel->iAudioEnabled = EFalse;
+    videoQualityLevel->iAudioBitRate = 6700;  // Bits per second. Basically HW dependent.
+    videoQualityLevel->iMimeType.Copy( KVideoMimeType );
+    videoQualityLevel->iPreferredSupplier.Copy( KPreferredSupplier );
+    videoQualityLevel->iVideoType.Copy( KVideoType );
+    videoQualityLevel->iAudioType.Copy( KAudioType );
+    videoQualityLevel->iStorageRate = 68000;  // That many bits per second to store. Estimate only
+
+    iQualityLevels->AppendL( *videoQualityLevel );
+
+    // Level 2:
+    size.SetSize( KImgWidthSubQCIF, KImgHeightSubQCIF );
+    videoQualityLevel->iFrameSize    = size;
+    videoQualityLevel->iFrameRate    = 5.0;   // Frames per second. Basically HW dependent.
+    videoQualityLevel->iBitRate      = 40000; // Bits per second. Basically HW dependent.
+    videoQualityLevel->iAudioEnabled = EFalse;
+    videoQualityLevel->iAudioBitRate = 5150;  // Bits per second. Basically HW dependent.
+    videoQualityLevel->iMimeType.Copy( KVideoMimeType );
+    videoQualityLevel->iPreferredSupplier.Copy( KPreferredSupplier );
+    videoQualityLevel->iVideoType.Copy( KVideoType );
+    videoQualityLevel->iAudioType.Copy( KAudioType );
+    videoQualityLevel->iStorageRate = 47000;  // That many bits per second to store. Estimate only
+
+    iQualityLevels->AppendL( *videoQualityLevel );
+
+    CleanupStack::PopAndDestroy( videoQualityLevel );
+
+
+    return iQualityLevels->Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CCaeVideoQualityLevelsCont::Count
+// -----------------------------------------------------------------------------
+//
+TInt CVideoRecordingQualityLevels::Count() const
+    {
+    return iQualityLevels->Count();
+    }
+
+        
+// -----------------------------------------------------------------------------
+// CCaeVideoQualityLevelsCont::At
+// -----------------------------------------------------------------------------
+//
+CVideoRecordingQualityLevel& CVideoRecordingQualityLevels::At( 
+    TInt aIndex ) const
+    {
+    return iQualityLevels->At( aIndex );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/group/HtiCameraServicePlugin.mmp	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  HTI service plugin for controlling audio playback.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET      HtiCameraServicePlugin.dll
+TARGETTYPE  PLUGIN
+
+// ECom Dll recognition UID followed by the unique UID for this dll
+UID 0x10009D8D 0x2002EA9D
+
+VENDORID    0x101FB657
+
+CAPABILITY      ALL -TCB
+
+SOURCEPATH  ../src
+SOURCE      proxy.cpp
+SOURCE      HtiCameraServicePlugin.cpp
+
+SOURCE 		../engine/src/EngineVideoRecording.cpp
+SOURCE 		../engine/src/VideoRecordingQualityLevels.cpp
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../engine/inc
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE  ../data/2002EA9D.rss
+TARGET          HtiCameraServicePlugin.rsc
+END
+
+LIBRARY     ecom.lib
+LIBRARY     efsrv.lib
+LIBRARY     euser.lib
+LIBRARY     flogger.lib
+LIBRARY     mediaclientvideo.lib 
+LIBRARY     MMFControllerFramework.lib
+LIBRARY     ECAM.lib
+SMPSAFE
+
+// End of file
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/group/bld.inf	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for HtiAudioServicePlugin
+*
+*/
+
+
+
+PRJ_PLATFORMS
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+HtiCameraServicePlugin.mmp
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/inc/HtiCameraServicePlugin.h	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Defines the ECom plugin for HTI camera service.
+*
+*/
+
+
+
+#ifndef HTICAMERASERVICEPLUGIN_H
+#define HTICAMERASERVICEPLUGIN_H
+
+//  INCLUDES
+#include <HtiServicePluginInterface.h>
+#include "EngineVideoRecording.h"
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CEngineVideoRecording;
+class MEngineVideoRecordingObserver;
+
+// CLASS DECLARATION
+
+/**
+*  The ECom plugin for HTI camera service.
+*
+*/
+class CHtiCameraServicePlugin : public CHTIServicePluginInterface,
+                                public MEngineVideoRecordingObserver
+    {
+
+    protected:
+        // commands
+        enum TCommands
+            {
+            ECmdInit                    = 0x01,
+            ECmdPrepareVideoRecording   = 0x02,
+            ECmdStartVideoRecording     = 0x05,
+            ECmdPausingVideoRecording   = 0x06,
+            ECmdResumeVideoRecording    = 0x07,
+            ECmdStopVideoRecording      = 0x08,
+            ECmdCloseVideoRecording     = 0x09,
+            ECmdGetZoom                 = 0x0a,
+            ECmdSetZoom                 = 0x0b,
+            
+            
+            EResultOk               = 0xFF // only for response message
+            };
+
+
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        */
+        static CHtiCameraServicePlugin* NewL();
+
+    public: // New functions
+
+    public:
+    // Functions from base classes
+
+    /**
+     * From CHTIServicePluginInterface
+     * Called by the HTI Framework when sending message to this service.
+     * @param aMessage message body destinated to a servive
+     * @param aPriority message priority
+     */
+    void ProcessMessageL(const TDesC8& aMessage,
+            THtiMessagePriority aPriority);
+
+    /**
+     * From CHTIServicePluginInterface
+     * Indicates to HTI Framework whether the plugin is ready to process
+     * a new message or if it's busy processing previous message.
+     */
+    TBool IsBusy();
+
+ 
+    protected:  // New functions
+
+        /**
+        * C++ default constructor.
+        */
+        CHtiCameraServicePlugin();
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+         */
+        virtual ~CHtiCameraServicePlugin();
+    
+    protected:
+        // Functions from base classes
+        
+        /**
+        * From MEngineVideoRecordingObserver
+        * Called asynchronously when CEngineVideoRecording::Init(), CCaeEngine::CEngineVideoRecording(), 
+        * or CEngineVideoRecording::Reserve() completes.
+        * Indicates if Video Recording Engine is ready for operation, 
+        * the camera is reserved and its power is switched on.
+        * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+        * @return void
+        */
+        virtual void MevroInitComplete( TInt aError );
+        
+        /**
+         * From MEngineVideoRecordingObserver
+         * Called asynchronously when preparing of video recording completes 
+         * after PrepareVideoRecordingL() has been called.
+         * May be called second time with an error code after a successful preparation 
+         * if video recording loses its prepared state for some reason (e.g. audio HW 
+         * is reserved for some other application).
+         * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+         * @return void
+         */
+        virtual void MevroVideoPrepareComplete(TInt aError);
+    
+        /**
+         * From MEngineVideoRecordingObserver
+         * Called (possibly asynchronously) when video recording is running 
+         * after CEngineVideoRecording::StartVideoRecording() or 
+         * CEngineVideoRecording::ResumeVideoRecording() has been called.
+         * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+         * @return void
+         */
+        virtual void MevroVideoRecordingOn(TInt aError);
+    
+        /**
+         * From MEngineVideoRecordingObserver
+         * Called (possibly asynchronously) when video recording is paused after 
+         * CEngineVideoRecording::PauseVideoRecording() has been called.
+         * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+         * @return void
+         */
+        virtual void MevroVideoRecordingPaused(TInt aError);
+    
+        /**
+         * From MEngineVideoRecordingObserver
+         * Called (possibly asynchronously) when video recording is completed 
+         * after CEngineVideoRecording::StopVideoRecording() has been called or 
+         * recording has been completed for some other reason.
+         * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code.
+         * if aError == KErrDiskFull, then disk storage is full.
+         * if aError == KErrCompletion, then clip max size was reached.
+         * @return void
+         */
+        virtual void MevroVideoRecordingComplete(TInt aError);
+    
+    private:
+        void HandleInitCmdL(const TDesC8& aData);
+        void HandlePrepareVideoRecordingCmdL(const TDesC8& aData);
+        void HandleStartVideoRecordingCmdL( const TDesC8& aData );
+        void HandlePausingVideoRecordingCmdL( const TDesC8& aData );
+        void HandleResumeVideoRecordingCmdL( const TDesC8& aData );
+        void HandleStopVideoRecordingCmdL( const TDesC8& aData );
+        void HandleCloseVideoRecordingCmdL( const TDesC8& aData );
+        void HandleGetZoomCmdL( const TDesC8& aData );
+        void HandleSetZoomCmdL( const TDesC8& aData );
+        
+        void SendOkMsgL( const TDesC8& aData );
+        void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
+        
+        TInt ParseString( const TDesC8& aRequest,
+                                       TInt aOffset, TDes& aResult );
+
+    public:     // Data
+
+    protected:  // Data
+
+    private:    // Data
+        // Flag telling if the service is busy processing a message
+        TBool                   iIsBusy;
+        
+        TInt                    iError;
+        CEngineVideoRecording*  iVideoRecordingEngine;
+        CActiveSchedulerWait*   iWaiter;
+
+    };
+
+#endif      // HTICAMERASERVICEPLUGIN_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/src/HtiCameraServicePlugin.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,550 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implements the ECom plugin for HTI camera
+*                service.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <HtiDispatcherInterface.h>
+#include <HtiLogging.h>
+
+
+#include "HtiCameraServicePlugin.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+const static TUid KCameraServiceUid = { 0x2002EA9E };
+
+
+
+// NOTE: Max length for error description is defined
+// in HtiDispatcherInterface.h (currently 118).
+
+_LIT8( KErrorNoCommand, "ERROR: No command given" );
+_LIT8( KErrorUnknownCmd, "ERROR: Unknown Camera Service command" );
+_LIT8( KErrorInitFailed, "ERROR: Failed to init");
+_LIT8( KErrInvalidateParameters, "ERROR: Invalidate parameters");
+_LIT8( KErrQualityLevel, "ERROR: Invalidate quality level");
+_LIT8( KErrorPrepareVideoRecordingFailed, "ERROR: Prepare video recording failed");
+_LIT8( KErrorStartVideoRecordingFailed, "ERROR: Start video recording failed");
+_LIT8( KErrorPausingVideoRecordingFailed, "ERROR: Pausing video recording failed");
+_LIT8( KErrorResumeVideoRecordingFailed, "ERROR: Resume video recording failed");
+_LIT8( KErrorStopVideoRecordingFailed, "ERROR: Stop video recording failed");
+_LIT8( KErrorSetZoomModeFailed, "ERROR: Set zoom mode failed");
+_LIT8( KErrorSetZoomValueFailed, "ERROR: Set zoom value failed");
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// ============================= LOCAL FUNCTIONS ===============================
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CHtiCameraServicePlugin::CHtiCameraServicePlugin
+// C++ default constructor can NOT contain any code, that might leave.
+// -----------------------------------------------------------------------------
+//
+CHtiCameraServicePlugin::CHtiCameraServicePlugin():iIsBusy(EFalse), iError(0),
+        iVideoRecordingEngine(NULL), iWaiter(NULL)
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// CHtiCameraServicePlugin::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CHtiCameraServicePlugin::ConstructL()
+    {
+    HTI_LOG_TEXT( "CHtiCameraServicePlugin::ConstructL" );
+    iVideoRecordingEngine = CEngineVideoRecording::NewL(*this, 0);
+    iWaiter = new ( ELeave ) CActiveSchedulerWait;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CHtiCameraServicePlugin::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CHtiCameraServicePlugin* CHtiCameraServicePlugin::NewL()
+    {
+    CHtiCameraServicePlugin* self = new (ELeave) CHtiCameraServicePlugin;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// Destructor
+CHtiCameraServicePlugin::~CHtiCameraServicePlugin()
+    {
+    delete iVideoRecordingEngine;
+    iVideoRecordingEngine = NULL;
+    
+    delete iWaiter;
+    iWaiter = NULL;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CHtiCameraServicePlugin::ProcessMessageL
+// -----------------------------------------------------------------------------
+//
+void CHtiCameraServicePlugin::ProcessMessageL( const TDesC8& aMessage,
+                                        THtiMessagePriority /*aPriority*/ )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::ProcessMessageL" );
+    HTI_LOG_FORMAT( "Message length = %d", aMessage.Length() );
+
+    if ( iIsBusy )
+        {
+        HTI_LOG_TEXT( "Plugin is busy - leaving" );
+        User::Leave( KErrInUse );
+        }
+
+    // Will be set to EFalse in the SendResponseMsg or SendErrorResponseMsg
+    // methods when the response has been successfully sent and the plugin is
+    // ready for next message.
+    iIsBusy = ETrue;
+
+    if ( aMessage.Length() < 1 )
+        {
+        SendErrorMessageL( KErrArgument, KErrorNoCommand );
+        return;
+        }
+    
+    TUint8 command = aMessage.Ptr()[0];
+    TInt err = KErrNone;
+
+    switch (command)
+        {
+        case ECmdInit:
+            TRAP(err, HandleInitCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdPrepareVideoRecording:
+            TRAP(err, HandlePrepareVideoRecordingCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdStartVideoRecording:
+            TRAP(err, HandleStartVideoRecordingCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdPausingVideoRecording:
+            TRAP(err, HandlePausingVideoRecordingCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdResumeVideoRecording:
+            TRAP(err, HandleResumeVideoRecordingCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdStopVideoRecording:
+            TRAP(err, HandleStopVideoRecordingCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdCloseVideoRecording:
+            TRAP(err, HandleCloseVideoRecordingCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdGetZoom:
+            TRAP(err, HandleGetZoomCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        case ECmdSetZoom:
+            TRAP(err, HandleSetZoomCmdL(aMessage.Right( aMessage.Length() - 1 )));
+            break;
+        default:
+            TRAP(err, SendErrorMessageL(KErrArgument, KErrorUnknownCmd));
+            break;
+        }
+    
+    if(err != KErrNone)
+        {
+        iIsBusy = EFalse;
+        User::Leave( err );
+        }
+
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::ProcessMessageL" );
+    }
+
+void CHtiCameraServicePlugin::HandleInitCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleInitCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_TEXT("Initializes Camera Application Engine");
+    iVideoRecordingEngine->InitL();
+    iWaiter->Start();
+    if(iError != KErrNone)
+        {
+        SendErrorMessageL(iError, KErrorInitFailed);
+        }
+    else
+        {
+        HTI_LOG_TEXT("Initializes video recording");
+        iVideoRecordingEngine->InitVideoRecorderL();
+        
+        SendOkMsgL(KNullDesC8);
+        }
+
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleInitCmdL" );
+    }
+
+
+void CHtiCameraServicePlugin::HandlePrepareVideoRecordingCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandlePrepareVideoRecordingCmdL" );
+    if(aData.Length() < 2 || aData[1] != aData.Length() -2)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    TInt qualityLevelIndex = aData[0];
+    if(qualityLevelIndex < 0 || qualityLevelIndex > iVideoRecordingEngine->VideoQualityCount() -1)
+        {
+        SendErrorMessageL(KErrOverflow, KErrQualityLevel);
+        return;
+        }
+    
+    TBuf<255> filePath;
+    TInt nextOffset = ParseString( aData, 1, filePath );
+    if ( filePath.Length() < 1 || nextOffset < 0 )
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_FORMAT("Set video recording file name: %S", &filePath);
+    iVideoRecordingEngine->SetVideoRecordingFileNameL(filePath);
+    
+    HTI_LOG_FORMAT("Prepare video recording with quality level index: %d", qualityLevelIndex);
+    iVideoRecordingEngine->PrepareVideoRecordingL(qualityLevelIndex);
+    
+    iWaiter->Start();
+    if(iError != KErrNone)
+        {
+        SendErrorMessageL(iError, KErrorPrepareVideoRecordingFailed);
+        }
+    else
+        {
+        SendOkMsgL(KNullDesC8);
+        }
+    
+     HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandlePrepareVideoRecordingCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandleStartVideoRecordingCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleStartVideoRecordingCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_TEXT("Start video recording...");
+    iVideoRecordingEngine->StartVideoRecording();
+    
+    if(iError != KErrNone)
+        {
+        SendErrorMessageL(iError, KErrorStartVideoRecordingFailed);
+        }
+    else
+        {
+        SendOkMsgL(KNullDesC8);
+        }
+
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleStartVideoRecordingCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandlePausingVideoRecordingCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandlePausingVideoRecordingCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_TEXT("Pausing video recording");
+    iVideoRecordingEngine->PauseVideoRecording();
+    if(iError != KErrNone)
+        {
+        SendErrorMessageL(iError, KErrorPausingVideoRecordingFailed);
+        }
+    else
+        {
+        SendOkMsgL(KNullDesC8);
+        }
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandlePausingVideoRecordingCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandleResumeVideoRecordingCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleResumeVideoRecordingCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_TEXT("Resume video recording...");
+    iVideoRecordingEngine->ResumeVideoRecording();
+    
+    if(iError != KErrNone)
+        {
+        SendErrorMessageL(iError, KErrorResumeVideoRecordingFailed);
+        }
+    else
+        {
+        SendOkMsgL(KNullDesC8);
+        }
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleResumeVideoRecordingCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandleStopVideoRecordingCmdL( const TDesC8& aData )    
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleStopVideoRecordingCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_TEXT("Stop video recording");
+    iVideoRecordingEngine->StopVideoRecording();
+    if(iError != KErrNone)
+        {
+        SendErrorMessageL(iError, KErrorStopVideoRecordingFailed);
+        }
+    else
+        {
+        SendOkMsgL(KNullDesC8);
+        }
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleStopVideoRecordingCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandleCloseVideoRecordingCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleCloseVideoRecordingCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    HTI_LOG_TEXT("Close video recording");
+    iVideoRecordingEngine->CloseVideoRecording();
+    SendOkMsgL(KNullDesC8);
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleCloseVideoRecordingCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandleGetZoomCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleGetZoomCmdL" );
+    if(aData.Length() != 0)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    TUint8 zoomMode = (TUint8)iVideoRecordingEngine->ZoomMode();
+    HTI_LOG_FORMAT("Current zoom mode: %d", zoomMode);
+    
+    TUint32 zoomValue = iVideoRecordingEngine->ZoomValue();
+    HTI_LOG_FORMAT("Current zoom value: %d", zoomValue);
+    
+    TUint32 zoomMinValue = iVideoRecordingEngine->MinZoomValue();
+    HTI_LOG_FORMAT("Min zoom value: %d", zoomMinValue);
+    
+    TUint32 zoomMaxValue = iVideoRecordingEngine->MaxZoomValue();
+    HTI_LOG_FORMAT("Max zoom value: %d", zoomMaxValue);
+    
+    TBuf8<13> buf;
+    buf.Append(zoomMode);
+    buf.Append((TUint8*)&zoomValue, 4);
+    buf.Append((TUint8*)&zoomMinValue, 4);
+    buf.Append((TUint8*)&zoomMaxValue, 4);
+    SendOkMsgL( buf );
+
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleGetZoomCmdL" );
+    }
+
+void CHtiCameraServicePlugin::HandleSetZoomCmdL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::HandleSetZoomCmdL" );
+    if(aData.Length() != 5)
+        {
+        SendErrorMessageL(KErrArgument, KErrInvalidateParameters);
+        return;
+        }
+    
+    CEngineVideoRecording::TZoomMode zoomMode = (CEngineVideoRecording::TZoomMode)aData[0];
+    HTI_LOG_FORMAT("Set zoom mode: %d", zoomMode);
+    TRAPD(err, iVideoRecordingEngine->SetZoomModeL(zoomMode));
+    if(err != KErrNone)
+        {
+        SendErrorMessageL(err, KErrorSetZoomModeFailed);
+        }
+    else
+        {
+        TInt value = aData[1] + ( aData[2] << 8 )
+                + ( aData[3] << 16 )
+                + ( aData[4] << 24 );
+        HTI_LOG_FORMAT("Set zoom value: %d", value);
+        TRAPD(err, iVideoRecordingEngine->SetZoomValueL(value));
+        if(err != KErrNone)
+            {
+            SendErrorMessageL(err, KErrorSetZoomValueFailed);
+            }
+        else
+            {
+            SendOkMsgL(KNullDesC8);
+            }
+        }
+    
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::HandleSetZoomCmdL" );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CHtiCameraServicePlugin::IsBusy
+// -----------------------------------------------------------------------------
+//
+TBool CHtiCameraServicePlugin::IsBusy()
+    {
+    return iIsBusy;
+    }
+
+
+// ----------------------------------------------------------------------------
+void CHtiCameraServicePlugin::SendOkMsgL( const TDesC8& aData )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::SendOkMsgL: Starting" );
+
+    User::LeaveIfNull( iDispatcher );
+
+    HBufC8* temp = HBufC8::NewL( aData.Length() + 1 );
+    TPtr8 response = temp->Des();
+    response.Append( ( TChar ) EResultOk );
+    response.Append( aData );
+    User::LeaveIfError( iDispatcher->DispatchOutgoingMessage(
+        temp, KCameraServiceUid ) );
+    iIsBusy = EFalse;
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::SendOkMsgL: Done" );
+    }
+
+// ----------------------------------------------------------------------------
+void CHtiCameraServicePlugin::SendErrorMessageL( TInt aError, const TDesC8& aDescription )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::SendErrorMessageL: Starting" );
+    User::LeaveIfNull( iDispatcher );
+    User::LeaveIfError( iDispatcher->DispatchOutgoingErrorMessage(
+        aError, aDescription, KCameraServiceUid ) );
+    iIsBusy = EFalse;
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::SendErrorMessageL: Done" );
+    }
+
+TInt CHtiCameraServicePlugin::ParseString( const TDesC8& aRequest,
+                                          TInt aOffset,
+                                          TDes& aResult )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::ParseString" );
+
+    // If offset outside the string return empty string
+    if ( aOffset >= aRequest.Size() )
+        {
+        return aOffset;
+        }
+
+    TInt length = aRequest[aOffset];
+    HTI_LOG_FORMAT( "String length = %d", length );
+
+    // If length is zero return empty string
+    if ( length < 1 )
+        {
+        return aOffset + 1;
+        }
+
+    if ( length > aResult.MaxLength() )
+        {
+        return KErrBadDescriptor;
+        }
+
+    TInt nextOffset = length + aOffset + 1;
+    HTI_LOG_FORMAT( "Next offset = %d", nextOffset );
+    HTI_LOG_FORMAT( "Request size = %d", aRequest.Size() );
+
+    if ( nextOffset > aRequest.Size() )
+        {
+        return KErrArgument;
+        }
+
+    aResult.Copy( aRequest.Mid( aOffset + 1, length ) );
+
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::ParseString" );
+    return nextOffset;
+    }
+
+void CHtiCameraServicePlugin::MevroInitComplete( TInt aError )
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroInitComplete" );
+    HTI_LOG_FORMAT("aError = %d", aError);
+    iWaiter->AsyncStop();
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroInitComplete" );
+    }
+
+void CHtiCameraServicePlugin::MevroVideoPrepareComplete(TInt aError)
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoPrepareComplete" );
+    HTI_LOG_FORMAT("aError = %d", aError);
+    iWaiter->AsyncStop();
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoPrepareComplete" );
+    }
+
+void CHtiCameraServicePlugin::MevroVideoRecordingOn(TInt aError)
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoRecordingOn" );
+    HTI_LOG_FORMAT("aError = %d", aError);
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoRecordingOn" );
+    }
+
+void CHtiCameraServicePlugin::MevroVideoRecordingPaused(TInt aError)
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoRecordingPaused" );
+    HTI_LOG_FORMAT("aError = %d", aError);
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoRecordingPaused" );
+    }
+
+void CHtiCameraServicePlugin::MevroVideoRecordingComplete(TInt aError)
+    {
+    HTI_LOG_FUNC_IN( "CHtiCameraServicePlugin::MevroVideoRecordingComplete" );
+    HTI_LOG_FORMAT("aError = %d", aError);
+    HTI_LOG_FUNC_OUT( "CHtiCameraServicePlugin::MevroVideoRecordingComplete" );
+    }
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiCameraServicePlugin/src/proxy.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation proxy for the ECom plugin.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+#include "HtiCameraServicePlugin.h"
+
+const TImplementationProxy ImplementationTable[] =
+    {
+        IMPLEMENTATION_PROXY_ENTRY( 0x2002EA9E, CHtiCameraServicePlugin::NewL )
+    };
+
+// Function used to return an instance of the proxy table.
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
--- a/htiui/group/bld.inf	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/group/bld.inf	Fri Jun 11 13:39:09 2010 +0300
@@ -30,6 +30,7 @@
 // Service plugins
 #include "../HtiServicePlugins/HtiAppServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiAudioServicePlugin/group/bld.inf"
+#include "../HtiServicePlugins/HtiCameraServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiKeyEventServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiMessagesServicePlugin/group/bld.inf"
 #include "../HtiServicePlugins/HtiPIMServicePlugin/group/bld.inf"
--- a/htiui/rom/htiui.iby	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/rom/htiui.iby	Fri Jun 11 13:39:09 2010 +0300
@@ -29,6 +29,7 @@
 
 // Test service plug-ins
 ECOM_PLUGIN(HtiAudioServicePlugin.dll,HtiAudioServicePlugin.rsc)
+ECOM_PLUGIN(HtiCameraServicePlugin.dll,HtiCameraServicePlugin.rsc)
 ECOM_PLUGIN(HtiKeyEventServicePlugin.dll,HtiKeyEventServicePlugin.rsc)
 ECOM_PLUGIN(HtiMessagesServicePlugin.dll,HtiMessagesServicePlugin.rsc)
 ECOM_PLUGIN(HtiPIMServicePlugin.dll,HtiPIMServicePlugin.rsc)
--- a/htiui/rom/htiui_10_1.iby	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/rom/htiui_10_1.iby	Fri Jun 11 13:39:09 2010 +0300
@@ -27,6 +27,7 @@
 
 // Test service plug-ins
 ECOM_PLUGIN(HtiAudioServicePlugin.dll,HtiAudioServicePlugin.rsc)
+ECOM_PLUGIN(HtiCameraServicePlugin.dll,HtiCameraServicePlugin.rsc)
 ECOM_PLUGIN(HtiKeyEventServicePlugin.dll,HtiKeyEventServicePlugin.rsc)
 ECOM_PLUGIN(HtiMessagesServicePlugin.dll,HtiMessagesServicePlugin.rsc)
 ECOM_PLUGIN(HtiPIMServicePlugin.dll,HtiPIMServicePlugin.rsc)
--- a/htiui/sis/HTI_S60-10_1.pkg	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/sis/HTI_S60-10_1.pkg	Fri Jun 11 13:39:09 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,22,0
+#{"HTI"},(0x1020DEB6),2,23,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
@@ -84,6 +84,8 @@
 "\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc"        - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
 "\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll"         - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
 "\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc"    - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiCameraServicePlugin.dll"          - "!:\sys\bin\HtiCameraServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiCameraServicePlugin.rsc"     - "!:\Resource\Plugins\HtiCameraServicePlugin.rsc"
 
 ; File helper with capability ALL - for file operations to TCB folders
 "\epoc32\release\armv5\urel\HtiFileHlp.exe"                      - "!:\sys\bin\HtiFileHlp.exe"
@@ -108,4 +110,4 @@
 "\epoc32\release\armv5\urel\HtiStartupWait.dll"                  - "!:\sys\bin\HtiStartupWait.dll"
 
 ; Startup list resource file for starting HTIFramework.exe in device boot
-"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
+;"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_S60-52.pkg	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/sis/HTI_S60-52.pkg	Fri Jun 11 13:39:09 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,22,0
+#{"HTI"},(0x1020DEB6),2,23,0
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
@@ -84,6 +84,8 @@
 "\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc"        - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
 "\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll"         - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
 "\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc"    - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiCameraServicePlugin.dll"          - "!:\sys\bin\HtiCameraServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiCameraServicePlugin.rsc"     - "!:\Resource\Plugins\HtiCameraServicePlugin.rsc"
 
 ; Helper to add notepad memos
 "\epoc32\release\armv5\urel\HtiNpdHlp.exe"                       - "!:\sys\bin\HtiNpdHlp.exe"
@@ -111,4 +113,4 @@
 "\epoc32\release\armv5\urel\HtiStartupWait.dll"                  - "!:\sys\bin\HtiStartupWait.dll"
 
 ; Startup list resource file for starting HTIFramework.exe in device boot
-"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
+;"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-10_1.pkg	Fri Jun 11 13:39:09 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,22,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,23,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
@@ -84,6 +84,8 @@
 "\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc"        - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
 "\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll"         - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
 "\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc"    - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiCameraServicePlugin.dll"          - "!:\sys\bin\HtiCameraServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiCameraServicePlugin.rsc"     - "!:\Resource\Plugins\HtiCameraServicePlugin.rsc"
 
 ; File helper with capability ALL - for file operations to TCB folders
 "\epoc32\release\armv5\urel\HtiFileHlp.exe"                      - "!:\sys\bin\HtiFileHlp.exe"
@@ -108,4 +110,4 @@
 "\epoc32\release\armv5\urel\HtiStartupWait.dll"                  - "!:\sys\bin\HtiStartupWait.dll"
 
 ; Startup list resource file for starting HTIFramework.exe in device boot
-"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
+;"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_S60_Upgrade-52.pkg	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/sis/HTI_S60_Upgrade-52.pkg	Fri Jun 11 13:39:09 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,22,0,TYPE=SA,RU
+#{"HTI"},(0x1020DEB6),2,23,0,TYPE=SA,RU
 
 ; Series60 product id for S60 5.2
 [0x20022E6D], 0, 0, 0, {"Series60ProductID"}
@@ -84,6 +84,8 @@
 "\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc"        - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
 "\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll"         - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
 "\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc"    - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiCameraServicePlugin.dll"          - "!:\sys\bin\HtiCameraServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiCameraServicePlugin.rsc"     - "!:\Resource\Plugins\HtiCameraServicePlugin.rsc"
 
 ; Helper to add notepad memos
 "\epoc32\release\armv5\urel\HtiNpdHlp.exe"                       - "!:\sys\bin\HtiNpdHlp.exe"
@@ -111,4 +113,4 @@
 "\epoc32\release\armv5\urel\HtiStartupWait.dll"                  - "!:\sys\bin\HtiStartupWait.dll"
 
 ; Startup list resource file for starting HTIFramework.exe in device boot
-"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
+;"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc"            - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_stub.pkg	Thu May 27 12:52:19 2010 +0300
+++ b/htiui/sis/HTI_stub.pkg	Fri Jun 11 13:39:09 2010 +0300
@@ -18,7 +18,7 @@
 &EN
 
 ; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,22,0
+#{"HTI"},(0x1020DEB6),2,23,0
 
 ; Localised Vendor name
 %{"Nokia"}
@@ -81,6 +81,8 @@
 ""- "z:\Resource\Plugins\HtiPIMServicePlugin.rsc"
 ""- "z:\sys\bin\HtiIpProxyServicePlugin.dll"
 ""- "z:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+""- "z:\sys\bin\HtiCameraServicePlugin.dll"
+""- "z:\Resource\Plugins\HtiCameraServicePlugin.rsc"
 
 ; Helper to add notepad memos
 ""- "z:\sys\bin\HtiNpdHlp.exe"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/ReleaseNotes_Launcher.txt	Fri Jun 11 13:39:09 2010 +0300
@@ -0,0 +1,135 @@
+===============================================================================
+
+RELEASE NOTES - LAUNCHER v4.0.1
+RELEASED 21st May 2010 
+
+SUPPORTS S60 3.0+
+
+===============================================================================
+
+Product Description:
+====================
+Launcher is a testing utility application aimed to help test the launching of
+applications installed in the system, both on user side disk drives and on
+ROM. Launcher tests if an application can be launched and then, if the launch
+has failed, reports the possible reason for the failure. It is a very useful
+application when checking the build as the user can instantly see if the
+applications work. Launcher can also be used when testing binary
+compatibility issues because it can reveal any DLL files missing from the
+device.
+
+Main Features:
+==============
+- Show a list of installed applications in all drives
+- Launch selected applications and read their statuses from threads
+- In case of a failure, report thread's exit type, reason and category
+- Show missing DLL files required by the binary to be launched
+- Show problems on the UI and print all cases to a log file
+- Generate a list of DLLs in the device to a file
+- Analyse binary compatibility of system DLLs comparing them to a user
+  given reference data. Report any binary compatibility issues or missing
+  DLL files.
+
+===============================================================================
+
+What's New in v4.0.1
+====================
+- Feature: Orbit UI improvements
+- Fix: Launching DLL analysis not starting
+
+===============================================================================
+
+Installation Notes:
+===================
+Launcher is typically preinstalled on ROM. If not, it can be added to the
+ROM with the .iby file. Alternatively, a .sis file can be found under the sis-
+directory, but the user needs to sign it with their own developer certificate.
+In Nokia R&D environment, you can use directly the R&D-signed .sis file under the
+internal\sis directory.
+
+When signing with own developer certificate, the following capabilities are
+needed:
+  PowerMgmt
+  ReadDeviceData
+  WriteDeviceData
+  AllFiles
+  ReadUserData
+  WriteUserData
+
+When building Launcher against S60 3.0 or 3.1, you may need to patch your SDK
+environment first with some fixes. For more information, please refer to the
+instructions under the "envpatcher" directory.
+  
+===============================================================================
+
+System Requirements:
+====================
+Basic Requirements:
+- Any S60 3.x device or emulator environment
+
+===============================================================================
+
+Compatibility Issues:
+=====================
+N/A
+
+===============================================================================
+
+Known Issues:
+=============
+
+Fails in a test despite the application is working correctly
+------------------------------------------------------------
+- Some application may exit immediately after a launch. This can be
+  normal behavior and should be checked manually. Such application is, for example, 
+  irapp.exe.
+  
+Binary compatibility check support
+----------------------------------
+- Currently, only uncompressed and deflate compressed ELF binaries are
+  supported. This means that for example WINSCW is not supported.
+
+===============================================================================
+
+Version History:
+================
+3.7.0 - 29th May 2009
+- Feature: Binary compatiblity check for DLLs, which checks UID1, UID2, UID3, SID
+and capability values of system DLLs against an XML-formatted input file.
+- Fix: Launcher panics when comparing a large DLL list against system DLLs.
+- Fix: Launcher panics when application launching is cancelled.
+
+Version 3.6.3 - 14th March 2008
+-------------------------------
+- Change: Removed unnecessary capabilities
+
+Version 3.6.2 - 6th November 2007
+--------------------------------
+- Fix: Applications can be selected/unselected on a touch UI
+- Fix: Scroll bar in the output view can be scrolled on a touch UI
+
+Version 3.6.1 - 9th October 2007
+--------------------------------
+- Fix: Layout in out tab in mirrored mode
+- Fix: Codescanner high warnings
+
+Version 3.6.0 - 25th January 2007
+---------------------------------
+- Fix: Re-fix problems when reading import section from binaries
+- Fix: Output screen for larger resolutions
+- Fix: Stopping of launching
+
+Version 3.5.0 - 4th December 2006
+---------------------------------
+- Fix: Problems when reading import section from binaries
+- Change: Marquee used for items in the application list view
+
+===============================================================================
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+This component and the accompanying materials are made available
+under the terms of "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
--- a/launcher/engine/src/launcherengine.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/launcher/engine/src/launcherengine.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -1033,7 +1033,7 @@
     if (iBCLogFile.Open(iEnv->FsSession(), iBCLogFilePath, EFileWrite) != KErrNone)
         {
         iEnv->FsSession().MkDirAll(iLogFilePath);
-        iBCLogFile.Replace(iEnv->FsSession(), iBCLogFilePath, EFileWrite);
+        User::LeaveIfError( iBCLogFile.Replace(iEnv->FsSession(), iBCLogFilePath, EFileWrite) );
         }
     else
         {
@@ -1099,9 +1099,14 @@
 void CLauncherEngine::CancelBCAnalysis()
     {
     LOGSTRING("Launcher: CLauncherEngine::CancelBCAnalysis");
-    iXMLParser->Cancel();
+    if( iXMLParser )
+        {
+        iXMLParser->Cancel();
+        }
     iLauncherUI->PrintText(_L("\nAnalysis cancelled.\n\n"));
-
+    WriteInitialStuffToTheLogL(_L("Analysis cancelled by user"), iBCLogFile);
+    iLogWriteBuf->Des().Zero();
+    iBCLogFile.Close();
     }
 
 // ---------------------------------------------------------------------------
--- a/launcher/launcher.pro	Thu May 27 12:52:19 2010 +0300
+++ b/launcher/launcher.pro	Fri Jun 11 13:39:09 2010 +0300
@@ -1,19 +1,3 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
 TEMPLATE = app
 TARGET = Launcher
 load(hb.prf)
--- a/launcher/src/enginewrapper.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/launcher/src/enginewrapper.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -21,6 +21,7 @@
 #include <shareuidialog.h>
 #include <eikenv.h>
 #include <hbprogressdialog.h>
+#include <hbaction.h>
 #include <QDebug>
 
 #include "launchermainwindow.h"
@@ -207,7 +208,7 @@
 void EngineWrapper::doCompareDlls(HbAction* action)
     {
     HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if(action == dlg->primaryAction())
+    if( action && !action->text().compare("ok", Qt::CaseInsensitive) )
         {
         TFileName fileName( dlg->value().toString().utf16() );
         TRAPD(error,  mEngine->AnalyseDLLsL( fileName ) );
--- a/launcher/src/notifications.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/launcher/src/notifications.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -45,7 +45,7 @@
 {
     Notifications::showMessageBox( 
         HbMessageBox::MessageTypeInformation, 
-        "Version 4.0.0 - 3rd March 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.", 
+        "Version 4.0.1 - 21st May 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.", 
         "About Launcher"
         );
 }
--- a/layers.sysdef.xml	Thu May 27 12:52:19 2010 +0300
+++ b/layers.sysdef.xml	Fri Jun 11 13:39:09 2010 +0300
@@ -34,7 +34,7 @@
 				<unit unitID="tools.piprofilerui" mrp="" bldFile="&layer_real_source_path;/piprofilerui" name="piprofilerui" proFile="piprofilerui.pro" />
 			</module>
 			<module name="stifui">
-				<unit unitID="tools.stifuiqt" mrp="" bldFile="&layer_real_source_path;/stifui/qt" name="stifui" proFile="stifqtui.pro" />
+				<unit unitID="tools.stifui" mrp="" bldFile="&layer_real_source_path;/stifui/avkon/group" name="stifui"/>
 			</module>
     </layer>
   </systemModel>
--- a/loadgen/group/group.pro	Thu May 27 12:52:19 2010 +0300
+++ b/loadgen/group/group.pro	Fri Jun 11 13:39:09 2010 +0300
@@ -1,18 +1,3 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
 
 
 TEMPLATE = subdirs
--- a/perfmon/group/ReleaseNotes_PerfMon.txt	Thu May 27 12:52:19 2010 +0300
+++ b/perfmon/group/ReleaseNotes_PerfMon.txt	Fri Jun 11 13:39:09 2010 +0300
@@ -1,9 +1,9 @@
 ===============================================================================
 
-RELEASE NOTES - PERFORMANCE MONITOR v1.0.0
-RELEASED 6th March 2008 
+RELEASE NOTES - PERFORMANCE MONITOR v1.1.1
+RELEASED 21st May 2010 
 
-SUPPORTS S60 3.0+
+SUPPORTS S60 5.2+
 
 ===============================================================================
 
@@ -26,9 +26,10 @@
 
 ===============================================================================
 
-What's New in v1.0.0
+What's New in v1.1.1
 ====================
-- Initial version
+- Improved Orbit UI
+- Error corrections
 
 ===============================================================================
 
--- a/perfmon/ui/hb/app/src/mainview.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/perfmon/ui/hb/app/src/mainview.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -128,7 +128,7 @@
 void MainView::showAbout()
 {
     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-    messageBox->setText("Version 1.1.0 - 15th March 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
+    messageBox->setText("Version 1.1.1 - 21st May 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.");
     HbLabel *header = new HbLabel("About PerfMon", messageBox);
     messageBox->setHeadingWidget(header);
     messageBox->setAttribute(Qt::WA_DeleteOnClose);
--- a/perfmon/ui/hb/app/src/valuedatacontainer.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/perfmon/ui/hb/app/src/valuedatacontainer.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -42,7 +42,10 @@
     // set proper font and prepare font metrics for text height calculation
     painter->setFont(mFont);
 
-    painter->setPen(HbColorScheme::color("foreground"));
+    QColor col = HbColorScheme::color("qtc_textedit_normal");
+    if(col.isValid())
+        painter->setPen(col);
+    
     QFontMetricsF metrics(mFont);
 
     QList<SampleEntry> entries = engine().sampleEntries();
--- a/piprofilerui/ui/avkon/group/piprofilerui.mmp	Thu May 27 12:52:19 2010 +0300
+++ b/piprofilerui/ui/avkon/group/piprofilerui.mmp	Fri Jun 11 13:39:09 2010 +0300
@@ -61,7 +61,7 @@
 
 LIBRARY           euser.lib
 LIBRARY			  eiksrv.lib
-LIBRARY           commonengine.lib
+LIBRARY           CommonEngine.lib
 LIBRARY           apparc.lib
 LIBRARY           cone.lib 
 LIBRARY           eikcore.lib
--- a/stifui/avkon/group/ReleaseNote.txt	Thu May 27 12:52:19 2010 +0300
+++ b/stifui/avkon/group/ReleaseNote.txt	Fri Jun 11 13:39:09 2010 +0300
@@ -1,5 +1,5 @@
 ========================================================================
-RELEASE NOTE FOR STIF UI - STIF_201018 (7.3.32)
+RELEASE NOTE FOR STIF UI - STIF_201020 (7.3.33)
 SUPPORTING SERIES 60 3.0 ->
 ========================================================================
 
Binary file stifui/avkon/sis/Stifui_31.sis has changed
--- a/stifui/avkon/stifui/inc/version.h	Thu May 27 12:52:19 2010 +0300
+++ b/stifui/avkon/stifui/inc/version.h	Fri Jun 11 13:39:09 2010 +0300
@@ -20,9 +20,9 @@
 
 #define STIFUI_MAJOR_VERSION 7
 #define STIFUI_MINOR_VERSION 3
-#define STIFUI_BUILD_VERSION 32
+#define STIFUI_BUILD_VERSION 33
 
-#define STIFUI_REL_DATE "5th May 2010"
+#define STIFUI_REL_DATE "18th May 2010"
 
 #define TO_UNICODE(text) _L(text) 
 
--- a/stifui/qt/ReleaseNote.txt	Thu May 27 12:52:19 2010 +0300
+++ b/stifui/qt/ReleaseNote.txt	Fri Jun 11 13:39:09 2010 +0300
@@ -1,5 +1,5 @@
 ========================================================================
-RELEASE NOTE FOR STFUI_201018 (7.3.32)
+RELEASE NOTE FOR STFUI_201020 (7.3.33)
 ========================================================================
 
 Product Description: