profilesservices/MediaFileList/Inc/mediafilewaitnote.h
branchRCL_3
changeset 25 7e0eff37aedb
parent 0 8c5d936e5675
equal deleted inserted replaced
24:8ee96d21d9bf 25:7e0eff37aedb
       
     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:   Waiting note for query
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MEDIAFILEWAITNOTE_H
       
    21 #define MEDIAFILEWAITNOTE_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include "mediafiledialogutils.h"
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <AknWaitDialog.h>
       
    29 #include <AknProgressDialog.h>
       
    30 #include <AknsItemID.h>
       
    31 
       
    32 
       
    33 // CLASS DECLARATIONS
       
    34 
       
    35 
       
    36 /**
       
    37 * MMediaFileWaitNoteObserver
       
    38 * 
       
    39 * Observer interface function for observing wait note.
       
    40 */
       
    41 NONSHARABLE_CLASS (MMediaFileWaitNoteObserver)
       
    42     {
       
    43     public:
       
    44         /**
       
    45         * Callback method
       
    46         * Get's called when a dialog is dismissed.
       
    47         */
       
    48         virtual void HandleWaitNoteL( TInt aButtonId ) = 0;
       
    49     };
       
    50 
       
    51 
       
    52 
       
    53 
       
    54 /**
       
    55 * MMediaFileWaitNote
       
    56 *  
       
    57 * MMediaFileWaitNote shows progress dialog.
       
    58 */
       
    59 NONSHARABLE_CLASS (CMediaFileWaitNote) : public CBase,
       
    60                                          public MProgressDialogCallback
       
    61     {
       
    62 
       
    63     public:// Constructors and destructor
       
    64 
       
    65         /**
       
    66         * Two-phased constructor.
       
    67         */
       
    68         static CMediaFileWaitNote* NewL( MMediaFileWaitNoteObserver* aObserver );
       
    69         
       
    70         /**
       
    71         * Destructor.
       
    72         */
       
    73         virtual ~CMediaFileWaitNote();
       
    74     
       
    75     private:
       
    76 
       
    77         /**
       
    78         * C++ default constructor.
       
    79         */
       
    80         CMediaFileWaitNote( MMediaFileWaitNoteObserver* aObserver );
       
    81 	
       
    82         /**
       
    83         * By default Symbian OS constructor is private.
       
    84         */
       
    85         void ConstructL();
       
    86         
       
    87 		/**
       
    88 		* From MProgressDialogCallback.
       
    89         * Called by the framework when dialog is dismissed.
       
    90         * @param aButtonId
       
    91         * @return None
       
    92         */
       
    93         void DialogDismissedL( TInt aButtonId );
       
    94 
       
    95     public:        
       
    96         
       
    97         /**
       
    98         * Launches progress dialog.
       
    99         * @return None.
       
   100         */
       
   101         void LaunchL( const TDesC& aLabel );
       
   102 
       
   103         
       
   104         /**
       
   105         * Closes progress dialog.
       
   106         * @param None
       
   107         * @return None
       
   108         */
       
   109         void CancelProgressDialogL();
       
   110         
       
   111         /**
       
   112         * Set dialog label text.
       
   113         * @param aText.
       
   114         * @return None.
       
   115         */
       
   116         void SetTextL( const TDesC& aText );
       
   117         
       
   118         /**
       
   119         * Set image data.
       
   120         * @param aId.
       
   121         * @param aFileName.
       
   122         * @param aFileBitmapId.
       
   123         * @param aFileMaskId.
       
   124         * @return None.
       
   125         */
       
   126         void SetImageL( TAknsItemID aId, const TDesC& aImageFile,
       
   127                         TInt aBitmapId, TInt aBitmapMaskId );
       
   128 
       
   129         /**
       
   130         * Set progress bar state.
       
   131         * @param aValue.
       
   132         * @return None
       
   133         */
       
   134         void SetProgress( TInt aValue );
       
   135 
       
   136         /**
       
   137         * Set progress bar state.
       
   138         * @param aFinalValue.
       
   139         * @return None
       
   140         */
       
   141         void SetFinalProgress( TInt aFinalValue );
       
   142 
       
   143         /**
       
   144         * Gets CAknNoteControl from CAknProgressDialog.
       
   145         * @param None
       
   146         * @return CAknNoteControl.
       
   147         */
       
   148 		CAknNoteControl* NoteControl();
       
   149 
       
   150        /**
       
   151         * Cancels animation.
       
   152         * @param None.
       
   153         * @return None.
       
   154         */
       
   155 		void CancelAnimation();
       
   156         
       
   157 		/**
       
   158         * Starts animation.
       
   159         * @param None
       
   160         * @return None.
       
   161         */
       
   162 		void StartAnimationL();
       
   163 		
       
   164 		/**
       
   165         * Hides cancel button.
       
   166         * @param None
       
   167         * @return None.
       
   168         */
       
   169 		void HideButtonL();
       
   170 
       
   171 
       
   172     private:
       
   173     
       
   174         // progress dialog
       
   175         CAknProgressDialog* iProgressDialog;
       
   176 
       
   177         // progress dialog info
       
   178         CEikProgressInfo* iProgressInfo;
       
   179 
       
   180 		// last label text
       
   181 		TBuf<KBufSize128> iLastText;
       
   182 
       
   183 		// animation state
       
   184 		TBool iAnimation;
       
   185 
       
   186 		// dialog observer
       
   187 		MMediaFileWaitNoteObserver*	iObserver;
       
   188 			    
       
   189 		TFileName iImageFile;
       
   190 		TAknsItemID iImageId;
       
   191 	    TInt iBitmapId;
       
   192 	    TInt iBitmapMaskId;
       
   193 	    
       
   194 	    // is observer call needed
       
   195 	    TBool iObserverCallNeeded;
       
   196         
       
   197 	    // has dialog's DialogDismissedL called (ie has it been closed)
       
   198 	    TBool iDialogDismissed;
       
   199     };
       
   200 
       
   201 
       
   202 
       
   203 
       
   204 #endif      // MEDIAFILEWAITNOTE_H
       
   205             
       
   206 // End of File