photosgallery/viewframework/uiutilities/inc/glxprogressindicator.h
branchRCL_3
changeset 26 5b3385a43d68
equal deleted inserted replaced
25:8e5f6eea9c9f 26:5b3385a43d68
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Progressdialog
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef GLXPROGRESSINDICATOR_H_
       
    19 #define GLXPROGRESSINDICATOR_H_
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <AknWaitDialog.h>
       
    23 
       
    24 class CAknProgressDialog;
       
    25 class CEikProgressInfo;
       
    26 class CGlxUiUtility;
       
    27 
       
    28 class MDialogDismisedObserver
       
    29     {
       
    30 public:
       
    31     virtual void HandleDialogDismissedL() = 0;
       
    32     };
       
    33 
       
    34 class CGlxProgressIndicator : public CBase, public MProgressDialogCallback
       
    35     {
       
    36 public:
       
    37     IMPORT_C static CGlxProgressIndicator* NewL(
       
    38             MDialogDismisedObserver& aGlxGridViewNotifyObserver);
       
    39     
       
    40     ~CGlxProgressIndicator();
       
    41 
       
    42     /**
       
    43      * dismiss progress dialog when it is needed
       
    44      */
       
    45     IMPORT_C void DismissProgressDialog();
       
    46 
       
    47     /**
       
    48      * Show progressbar dialog
       
    49      */
       
    50     IMPORT_C void ShowProgressbarL();
       
    51     
       
    52     /**
       
    53      * Start or stop the TN daemon
       
    54      * @param aStatus The foreground status
       
    55      */
       
    56     IMPORT_C void ControlTNDaemon(TBool aStatus);
       
    57     
       
    58 public:
       
    59     // Callback for periodic timer, static, 
       
    60     static TInt PeriodicCallbackL(TAny* aPtr);
       
    61     
       
    62     //nonstatic func called from periodic timer
       
    63     void DisplayProgressBarL();
       
    64     
       
    65 protected:
       
    66     //MProgressDialogCallback
       
    67     void DialogDismissedL(TInt aButtonId);
       
    68 
       
    69 private:
       
    70     static CGlxProgressIndicator* NewLC(
       
    71             MDialogDismisedObserver& aGlxGridViewNotifyObserver);
       
    72     
       
    73     CGlxProgressIndicator(
       
    74                     MDialogDismisedObserver& aGlxGridViewNotifyObserver);
       
    75     
       
    76     void ConstructL();
       
    77     
       
    78     /**
       
    79      * show the progress bar
       
    80      * @param aFinalValue Sets the final value of the bar
       
    81      * @param aShow hide/display the progress bar 
       
    82      */
       
    83     void StartProgressNoteL(TInt aFinalValue, TBool aShow);
       
    84     
       
    85     /**
       
    86      * displays the increment of progress bar
       
    87      */
       
    88     void UpdateProgressBar();
       
    89 
       
    90     /**
       
    91      * calculates how much increment to be done in progress bar
       
    92      * @return increment value
       
    93      */
       
    94     TInt CalculateDisplayBarIncrement();
       
    95         
       
    96 private:
       
    97     //Progress bar updation ticker
       
    98     CPeriodic* iProgressbarTicker;
       
    99 
       
   100     //Progress bar
       
   101     CAknProgressDialog* iProgressDialog;
       
   102     
       
   103     //Progress info
       
   104     CEikProgressInfo* iProgressInfo;
       
   105     
       
   106     //final count to set in progress bar
       
   107     TInt iFinalCount;
       
   108 
       
   109     MDialogDismisedObserver& iGlxGridViewNotifyObserver;
       
   110     
       
   111     CGlxUiUtility* iUiUtility;
       
   112     };
       
   113 
       
   114 #endif /* GLXPROGRESSINDICATOR_H_ */