applicationmanagement/server/src/AppMgmtProgDialog.cpp
changeset 18 7d11f9a6646f
parent 4 75a71fdb4c92
child 21 c707676bf59f
equal deleted inserted replaced
4:75a71fdb4c92 18:7d11f9a6646f
     1 /*
       
     2 * Copyright (c) 2009 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:  Implementation of applicationmanagement components
       
    15  *
       
    16 */
       
    17 #include "AppMgmtProgDialog.h"
       
    18 #include <avkon.rsg>
       
    19 #include <applicationmanagement.rsg>
       
    20 #include <eikenv.h>
       
    21 #include <aknnotewrappers.h>
       
    22 #include <avkon.hrh>
       
    23 
       
    24 CAppMgmtProgDialog::CAppMgmtProgDialog(MDLProgressDlgObserver *iCallback) :
       
    25     iDlgObserver(iCallback)
       
    26     {
       
    27 
       
    28     }
       
    29 
       
    30 CAppMgmtProgDialog::~CAppMgmtProgDialog()
       
    31     {
       
    32     if (iProgressDialog)
       
    33         {
       
    34         delete iProgressDialog;
       
    35         }
       
    36 
       
    37     }
       
    38 
       
    39 void CAppMgmtProgDialog::StartProgressNoteL()
       
    40     {
       
    41     iProgressDialog = new (ELeave) CAknProgressDialog(
       
    42             (REINTERPRET_CAST(CEikDialog**, &iProgressDialog)),
       
    43             ETrue);
       
    44     iProgressDialog->PrepareLC(R_PROGRESS_NOTE);
       
    45     iProgressInfo = iProgressDialog->GetProgressInfoL();
       
    46     iProgressDialog->SetCallback(this);
       
    47     iProgressDialog->RunLD();
       
    48     iProgressInfo->SetFinalValue(500);
       
    49 
       
    50     }
       
    51 
       
    52 void CAppMgmtProgDialog::UpdateProcessL(TInt aProgress)
       
    53     {
       
    54     if (iProgressInfo)
       
    55         {
       
    56         iProgressInfo->SetAndDraw(aProgress);
       
    57         }
       
    58     }
       
    59 
       
    60 void CAppMgmtProgDialog::ProgressCompletedL()
       
    61     {
       
    62     if (iProgressDialog)
       
    63         {
       
    64         iProgressDialog->ProcessFinishedL();
       
    65         }
       
    66 
       
    67     }
       
    68 
       
    69 void CAppMgmtProgDialog::SetFinalValueL(TInt32 aFinalValue)
       
    70     {
       
    71     iProgressInfo = iProgressDialog->GetProgressInfoL();
       
    72     iProgressInfo-> SetFinalValue(aFinalValue);
       
    73     }
       
    74 
       
    75 void CAppMgmtProgDialog::DialogDismissedL(TInt aButtonId)
       
    76     {
       
    77 
       
    78     //|| aButtonId == EAknSoftkeyEmpty
       
    79     if (aButtonId == EAknSoftkeyCancel)
       
    80         {
       
    81 
       
    82         iDlgObserver->HandleDLProgressDialogExitL(aButtonId);
       
    83 
       
    84         }
       
    85     }
       
    86