|         |      1 /* | 
|         |      2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). | 
|         |      3 * All rights reserved. | 
|         |      4 * This component and the accompanying materials are made available | 
|         |      5 * under the terms of "Eclipse Public License v1.0"" | 
|         |      6 * which accompanies this distribution, and is available | 
|         |      7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". | 
|         |      8 * | 
|         |      9 * Initial Contributors: | 
|         |     10 * Nokia Corporation - initial contribution. | 
|         |     11 * | 
|         |     12 * Contributors: | 
|         |     13 * | 
|         |     14 * Description:  Wraps wait note and real work thread | 
|         |     15 * | 
|         |     16 */ | 
|         |     17  | 
|         |     18  | 
|         |     19 // INCLUDES | 
|         |     20 #include <e32std.h> | 
|         |     21 #include <AknWaitNoteWrapper.h> | 
|         |     22 #include "CFileManagerActiveBase.h" | 
|         |     23 #include "CFileManagerThreadWrapper.h" | 
|         |     24  | 
|         |     25  | 
|         |     26 // ============================ MEMBER FUNCTIONS =============================== | 
|         |     27  | 
|         |     28 // ----------------------------------------------------------------------------- | 
|         |     29 // CFileManagerActiveBase::CFileManagerActiveBase | 
|         |     30 // ----------------------------------------------------------------------------- | 
|         |     31 // | 
|         |     32 CFileManagerActiveBase::CFileManagerActiveBase() : | 
|         |     33         iResult( KErrCancel ) | 
|         |     34     { | 
|         |     35     } | 
|         |     36  | 
|         |     37 // ----------------------------------------------------------------------------- | 
|         |     38 // CFileManagerActiveBase::~CFileManagerActiveBase | 
|         |     39 // ----------------------------------------------------------------------------- | 
|         |     40 // | 
|         |     41 CFileManagerActiveBase::~CFileManagerActiveBase() | 
|         |     42     { | 
|         |     43     iCanceled = ETrue; | 
|         |     44     delete iThreadWrapper; | 
|         |     45     } | 
|         |     46  | 
|         |     47 // ----------------------------------------------------------------------------- | 
|         |     48 // CFileManagerActiveBase::BaseConstructL | 
|         |     49 // ----------------------------------------------------------------------------- | 
|         |     50 // | 
|         |     51 void CFileManagerActiveBase::BaseConstructL() | 
|         |     52     { | 
|         |     53     iThreadWrapper = CFileManagerThreadWrapper::NewL(); | 
|         |     54     User::LeaveIfError( iThreadWrapper->StartThread( | 
|         |     55         *this, | 
|         |     56         MFileManagerThreadFunction::ENotifyFinished, | 
|         |     57         EPriorityNormal ) ); | 
|         |     58     } | 
|         |     59  | 
|         |     60 // ----------------------------------------------------------------------------- | 
|         |     61 // CFileManagerActiveBase::StepL | 
|         |     62 // ----------------------------------------------------------------------------- | 
|         |     63 // | 
|         |     64 void CFileManagerActiveBase::StepL() | 
|         |     65     { | 
|         |     66     // Just do nothing. All processing is done by ThreadFunctionL(). | 
|         |     67     } | 
|         |     68  | 
|         |     69 // ----------------------------------------------------------------------------- | 
|         |     70 // CFileManagerActiveBase::IsProcessDone | 
|         |     71 // ----------------------------------------------------------------------------- | 
|         |     72 // | 
|         |     73 TBool CFileManagerActiveBase::IsProcessDone() const | 
|         |     74     { | 
|         |     75     return iDone; | 
|         |     76     } | 
|         |     77  | 
|         |     78 // ----------------------------------------------------------------------------- | 
|         |     79 // CFileManagerActiveBase::DialogDismissedL | 
|         |     80 // ----------------------------------------------------------------------------- | 
|         |     81 // | 
|         |     82 void CFileManagerActiveBase::DialogDismissedL( TInt aButtonId ) | 
|         |     83     { | 
|         |     84     if ( aButtonId == EAknSoftkeyCancel ) | 
|         |     85         { | 
|         |     86         CancelThreadFunction(); | 
|         |     87         iCanceled = ETrue; | 
|         |     88         } | 
|         |     89     } | 
|         |     90  | 
|         |     91 // ----------------------------------------------------------------------------- | 
|         |     92 // CFileManagerActiveBase::ThreadStepL | 
|         |     93 // ----------------------------------------------------------------------------- | 
|         |     94 // | 
|         |     95 void CFileManagerActiveBase::ThreadStepL() | 
|         |     96     { | 
|         |     97     ThreadFunctionL( iCanceled ); | 
|         |     98     } | 
|         |     99  | 
|         |    100 // ----------------------------------------------------------------------------- | 
|         |    101 // CFileManagerActiveBase::IsThreadDone | 
|         |    102 // ----------------------------------------------------------------------------- | 
|         |    103 // | 
|         |    104 TBool CFileManagerActiveBase::IsThreadDone() | 
|         |    105     { | 
|         |    106     return ETrue; | 
|         |    107     } | 
|         |    108  | 
|         |    109 // ----------------------------------------------------------------------------- | 
|         |    110 // CFileManagerActiveBase::NotifyThreadClientL | 
|         |    111 // ----------------------------------------------------------------------------- | 
|         |    112 // | 
|         |    113 void CFileManagerActiveBase::NotifyThreadClientL( | 
|         |    114         TNotifyType /*aType*/, TInt aValue) | 
|         |    115     { | 
|         |    116     iResult = aValue; | 
|         |    117     iDone = ETrue; | 
|         |    118     } | 
|         |    119  | 
|         |    120 // ----------------------------------------------------------------------------- | 
|         |    121 // CFileManagerActiveBase::Result | 
|         |    122 // ----------------------------------------------------------------------------- | 
|         |    123 // | 
|         |    124 TInt CFileManagerActiveBase::Result() const | 
|         |    125     { | 
|         |    126     return iResult; | 
|         |    127     } | 
|         |    128  | 
|         |    129 // ----------------------------------------------------------------------------- | 
|         |    130 // CFileManagerActiveBase::CancelThreadFunction | 
|         |    131 // ----------------------------------------------------------------------------- | 
|         |    132 // | 
|         |    133 void CFileManagerActiveBase::CancelThreadFunction() | 
|         |    134     { | 
|         |    135     } | 
|         |    136  | 
|         |    137 // End of File |