email/mail/ViewerSrc/MsgMailViewerAttachmentsDlg.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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 "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:  This dialog is used for Attachment handling.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MSGMAILVIEWERATTACHMENTS_H
       
    20 #define MSGMAILVIEWERATTACHMENTS_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <MsgViewAttachmentsDialog.h>
       
    24 #include <msvapi.h> // MMsvSessionObserver
       
    25 #include "MMsgMailAttachmentDialogObserver.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CMsgMailViewerDocument;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  Dialog for attachments.
       
    34 *  Mail attachments are handled from this dialog.
       
    35 */
       
    36 class CMsgMailViewerAttachmentsDlg :public CMsgViewAttachmentsDialog, 
       
    37     public MMsvSessionObserver
       
    38     {
       
    39     public:  // Constructors and destructor
       
    40         /**
       
    41         * NewL
       
    42         * @param aTitle Dialog title text
       
    43         * @param aAttachmentModel a reference to attachment model
       
    44         * @param aDocument a reference to app document.
       
    45         */
       
    46         static CMsgMailViewerAttachmentsDlg* NewL(
       
    47         	TDesC& aTitle,
       
    48             CMsgAttachmentModel& aAttachmentModel, 
       
    49             CMsgMailViewerDocument& aDocument,
       
    50             MMsgMailAttachmentDialogObserver& aDlgObserver
       
    51             );
       
    52 
       
    53         /**
       
    54         * Destructor
       
    55         */
       
    56         ~CMsgMailViewerAttachmentsDlg();
       
    57         
       
    58         /**
       
    59         * NotifySizeChanged, calls SizeChanged() method of
       
    60         * dialog's listbox
       
    61         * 
       
    62         */
       
    63         void NotifySizeChanged();
       
    64         
       
    65         /**
       
    66         * Updates all attachments fetched flags
       
    67         * in attachment model.
       
    68         * 
       
    69         */
       
    70         void UpdateAttachmentsFetchFlags();
       
    71         
       
    72         /**
       
    73         * From MEikListBoxObserverClass
       
    74         */
       
    75         void HandleListBoxEventL( 
       
    76             CEikListBox* aListBox, TListBoxEvent aEventType );
       
    77         
       
    78         /**
       
    79         * Updates list of attatchments if attatchment 
       
    80         * dialog is opened before all attatchments 
       
    81         * are loaded.
       
    82         */
       
    83         void UpdateAttatchmentListL();
       
    84 
       
    85     private: // Implementation
       
    86         void UpdateChangedAttachmentsL(
       
    87             const CMsvEntrySelection& aChangedEntries );
       
    88 		void FetchRemoteAttachmentL( TInt aIndex );
       
    89         void UpdateModelInfoL( TInt aIndex );
       
    90         void OpenAttachmentL();
       
    91         void DoFetchOrOpenL( TInt aIndex );
       
    92         void DoProcessCommandL( TInt aCommandId );
       
    93         void DoSendViaL();
       
    94         void PurgeAttachmentL( TInt aIndex );
       
    95         TBool CanRemoveAttachment( CMsgAttachmentInfo& aInfo );
       
    96         void SetMiddleSoftKeyLabelL( 
       
    97             TInt aResourceId, 
       
    98             TInt aCommandId );
       
    99         void UpdateMiddleSoftKeyL( TInt aIndex );   
       
   100         
       
   101          
       
   102     private: // Constructor
       
   103         CMsgMailViewerAttachmentsDlg(
       
   104             TDesC& aTitle,
       
   105             CMsgAttachmentModel& aAttachmentModel, 
       
   106             CMsgMailViewerDocument& aDocument,
       
   107             MMsgMailAttachmentDialogObserver& aDlgObserver );
       
   108         /**
       
   109         * 2nd phase constructor
       
   110         */
       
   111         void ConstructL();
       
   112 
       
   113     private: // Functions from base classes
       
   114         /// from CAknDialog
       
   115         void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane);
       
   116         /// From CCoeControl
       
   117         TKeyResponse OfferKeyEventL(
       
   118             const TKeyEvent& aKeyEvent,TEventCode aType);
       
   119         /// from CAknDialog
       
   120         void ProcessCommandL(TInt aCommandId);
       
   121         /// From CCoeControl
       
   122 		void GetHelpContext( TCoeHelpContext& aContext) const;
       
   123         /// From MMsvSessionObserver
       
   124         void HandleSessionEventL(TMsvSessionEvent aEvent, 
       
   125             TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
   126         //From CEikDialog
       
   127         TBool OkToExitL(TInt aButtonId);
       
   128 
       
   129     private:    // Data
       
   130         /**
       
   131         * A reference to the application Document.
       
   132         */
       
   133         CMsgMailViewerDocument& iDocument;
       
   134        
       
   135         /// Internal status flags
       
   136         TInt iFlags;
       
   137 
       
   138         /**
       
   139         * Ref: application UI object.
       
   140         */
       
   141         MMsgMailAttachmentDialogObserver& iDlgObserver;
       
   142     };
       
   143 
       
   144 #endif      // MSGMAILVIEWATTACHMENTS_H
       
   145 
       
   146 // End of File