email/mail/EditorSrc/cmsgmaileditorheader.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Mail editor header content handler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_CMSGMAILEDITORHEADER_H
       
    19 #define C_CMSGMAILEDITORHEADER_H
       
    20 
       
    21 #include <e32base.h> // CBase
       
    22 #include <MsgAttachmentModelObserver.h> // MMsgAttachmentModelObserver
       
    23 
       
    24 class CMsgMailEditorDocument;
       
    25 class CMsgEditorView;
       
    26 class TAdditionalHeaderStatus;
       
    27 
       
    28 /**
       
    29  *  Mail Editor UI header field handler.
       
    30  *
       
    31  *  Manipulates content of mail editor header fields.
       
    32  *
       
    33  *  @lib none
       
    34  *  @since S60 v3.1
       
    35  */
       
    36 class CMsgMailEditorHeader : public CBase, public MMsgAttachmentModelObserver
       
    37     {
       
    38 public:
       
    39 
       
    40     /**
       
    41      * NewL
       
    42      * Creates mail editor header fields
       
    43      * @since S60 v3.1
       
    44      * @param aDocument reference to editor document.
       
    45      * @param aView reference to editor view.
       
    46      * @return self
       
    47      */
       
    48     static CMsgMailEditorHeader* NewL(
       
    49         CMsgMailEditorDocument& aDocument,
       
    50         CMsgEditorView& aView );
       
    51 
       
    52     ~CMsgMailEditorHeader();
       
    53 
       
    54     /**
       
    55      * Update visibility of mail editor address fields.
       
    56      *
       
    57      * @since S60 v3.1
       
    58      */    
       
    59     void UpdateHeaderVisibilityL(
       
    60         RPointerArray<TAdditionalHeaderStatus>& aHeaders );
       
    61     
       
    62     /**
       
    63      * Update visibility of mail editor Reply-to field.
       
    64      *
       
    65      * @since S60 v3.2
       
    66      */        
       
    67     void UpdateReplyToControlL();    
       
    68 
       
    69 // from base class MMsgAttachmentModelObserver
       
    70     void NotifyChanges( 
       
    71         TMsgAttachmentCommand aCommand, 
       
    72         CMsgAttachmentInfo* aAttachmentInfo );
       
    73     RFile GetAttachmentFileL( TMsvAttachmentId aId );
       
    74 
       
    75 private:
       
    76 
       
    77     CMsgMailEditorHeader(
       
    78         CMsgMailEditorDocument& aDocument,
       
    79         CMsgEditorView& aView);
       
    80     void ConstructL();
       
    81 
       
    82 private: // implementation    
       
    83     
       
    84     void AddControlL( TInt aControlType );
       
    85     CMsgAttachmentControl* AttachmentControl() const;
       
    86     void CreateHeadersL();    
       
    87     void DoCreateAttachmentControlL();
       
    88     void DoRemoveAttachmentControlL();
       
    89     void UpdateAttachmentControlL( 
       
    90         TMsgAttachmentCommand aCommand,
       
    91         CMsgAttachmentInfo* aAttachmentInfo );
       
    92 
       
    93 private: // data
       
    94 
       
    95     /**
       
    96      * Reference to mail editor document
       
    97      */
       
    98     CMsgMailEditorDocument& iDocument;
       
    99     
       
   100     /**
       
   101      * Reference to mail editor view
       
   102      */    
       
   103     CMsgEditorView& iView;
       
   104     };
       
   105 
       
   106 #endif // C_CMSGMAILEDITORHEADER_H