emailuis/emailui/inc/FreestyleAttachmentDownloadProgressBar.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Attachment download progress bar
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CFREESTYLE_ATTACHMENT_DOWNLOAD_PROGRESS_BAR_H__
       
    19 #define __CFREESTYLE_ATTACHMENT_DOWNLOAD_PROGRESS_BAR_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <AknProgressDialog.h>
       
    23 
       
    24 #include "FreestyleEmailUiConstants.h"
       
    25 #include "FreestyleEmailUiAttachmentsListModel.h"
       
    26 
       
    27 class CFreestyleAttachmentDownloadProgressBar : public CBase, 
       
    28                                                 public MProgressDialogCallback
       
    29     {
       
    30 public:
       
    31     IMPORT_C static CFreestyleAttachmentDownloadProgressBar* NewL();
       
    32     ~CFreestyleAttachmentDownloadProgressBar();
       
    33     
       
    34     TBool IsVisible() const;
       
    35     
       
    36     void ShowL();
       
    37     void HideL();
       
    38     void UpdateL( const TAttachmentData& aAttachment );
       
    39     
       
    40     const TAttachmentData* CurrentAttachment() const;
       
    41     
       
    42 private: //MProgressDialogCallback   
       
    43     void DialogDismissedL( TInt aButtonId );
       
    44 
       
    45 private:    
       
    46     CFreestyleAttachmentDownloadProgressBar();
       
    47     
       
    48     void CreateProgressBarL();
       
    49     void RemoveProgressBarL();
       
    50     void RefreshProgressBarL();
       
    51     
       
    52     void SetVisible( TBool aVisible = ETrue );
       
    53 
       
    54     TBool AttachmentChanged( const TAttachmentData& aAttachment ) const;
       
    55     void SetAttachment( const TAttachmentData& aAttachment );
       
    56     
       
    57     void Reset(); 
       
    58     
       
    59     
       
    60 private:
       
    61     CAknProgressDialog* iProgressBar;   
       
    62     const TAttachmentData* iCurrentAttachment; // not owned
       
    63     TBool iVisible;
       
    64     };
       
    65 
       
    66 #endif //__CFREESTYLE_ATTACHMENT_DOWNLOAD_PROGRESS_BAR_H__