pushmtm/MtmUiSrc/PushMtmUiOperation.cpp
branchRCL_3
changeset 48 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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:  Implementation of CPushMtmUiOperation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 //  INCLUDES
       
    21 
       
    22 #include "PushMtmUiOperation.h"
       
    23 #include "PushMtmUtil.h"
       
    24 #include <coemain.h>
       
    25 #include <ErrorUI.h>
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 // ---------------------------------------------------------
       
    30 // CPushMtmUiOperation::CPushMtmUiOperation
       
    31 // ---------------------------------------------------------
       
    32 //
       
    33 CPushMtmUiOperation::CPushMtmUiOperation( CMsvSession& aSession, 
       
    34                                           TMsvId aId, 
       
    35                                           TRequestStatus& aObserverStatus )
       
    36 :   CPushMtmOperation( aSession, aId, aObserverStatus ), 
       
    37     iCoeEnv( *CCoeEnv::Static() ), 
       
    38     iResourceLoader( iCoeEnv ), 
       
    39     iResourceOpened( EFalse )
       
    40     {
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------
       
    44 // CPushMtmUiOperation::ConstructL
       
    45 // ---------------------------------------------------------
       
    46 //
       
    47 void CPushMtmUiOperation::ConstructL()
       
    48     {
       
    49     iMtmUtil = CPushMtmUtil::NewL( iMsvSession );
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------
       
    53 // CPushMtmUiOperation::~CPushMtmUiOperation
       
    54 // ---------------------------------------------------------
       
    55 //
       
    56 CPushMtmUiOperation::~CPushMtmUiOperation()
       
    57     {
       
    58     Cancel();
       
    59     delete iMtmUtil;
       
    60     iResourceLoader.Close();
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // CPushMtmUiOperation::AssureResourceL
       
    65 // ---------------------------------------------------------
       
    66 //
       
    67 void CPushMtmUiOperation::AssureResourceL( const TDesC& aResourceFile )
       
    68     {
       
    69     if ( !iResourceOpened )
       
    70         {
       
    71         // Add resource file.
       
    72         TFileName resourceFileName( aResourceFile );
       
    73         iResourceLoader.OpenL( resourceFileName );
       
    74         iResourceOpened = ETrue;
       
    75         }
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------
       
    79 // CPushMtmUiOperation::ShowGlobalErrorNoteL
       
    80 // ---------------------------------------------------------
       
    81 //
       
    82 void CPushMtmUiOperation::ShowGlobalErrorNoteL( TInt aError ) const
       
    83     {
       
    84     CErrorUI* errorUi = CErrorUI::NewLC( iCoeEnv );
       
    85     if ( errorUi->ShowGlobalErrorNoteL( aError ) == EFalse )
       
    86         {
       
    87         User::Leave( KErrGeneral );
       
    88         }
       
    89     CleanupStack::PopAndDestroy( errorUi );
       
    90     }
       
    91 
       
    92 // End of file.
       
    93