mobilemessaging/mmsui/viewerinc/MmsViewerHeader.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005-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:  
       
    15 *       MMS viewer header.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __MMSVIEWERHEADER_H
       
    22 #define __MMSVIEWERHEADER_H
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <mmsclient.h>
       
    27 #include <MsgEditorView.h>
       
    28 #include <unibaseheader.h>  
       
    29 #include <muiumsvuiserviceutilitiesinternal.h> // TMuiuAddressType
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // DATA TYPES
       
    36 
       
    37 // FUNCTION PROTOTYPES
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 
       
    41 class CMsgAddressControl;
       
    42 class CMsgExpandableControl;
       
    43 class CUniObjectList;
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 // ==========================================================
       
    48 
       
    49 /**
       
    50 * 
       
    51 */
       
    52 class CMmsViewerHeader : public CUniBaseHeader
       
    53     {
       
    54     public:  // Constructor and destructor
       
    55 
       
    56         /**
       
    57         * Two-phased constructor.
       
    58         * @param aParent parent control
       
    59         * @param aFlags display flags - by default editor state
       
    60         * @return new object
       
    61         */
       
    62         static CMmsViewerHeader* NewL(
       
    63             CMmsClientMtm& aMtm,
       
    64             CUniObjectList& aAttachmentList,
       
    65             CMsgEditorView& aView,
       
    66             RFs& aFs );
       
    67 
       
    68         /**
       
    69         * Destructor.
       
    70         */
       
    71         ~CMmsViewerHeader();
       
    72 
       
    73         inline TMuiuAddressType SenderType();
       
    74 
       
    75         inline HBufC* Alias();
       
    76 
       
    77         /**
       
    78         * Due to infamous Japanese pictographs in subject field showing 
       
    79         * transparently even on slides 2,3...etc, function is used to remove
       
    80         * subject text when subject is visible and to the slide N is moved from slide 1
       
    81         */
       
    82         void RemoveSubjectContentL( );
       
    83 
       
    84         /**
       
    85         * Due to infamous Japanese pictographs in subject field showing 
       
    86         * transparently even on slides 2,3...etc, function is used to restore
       
    87         * subject when slide 1 is entered from slide N.
       
    88         */
       
    89         void RestoreSubjectContentL( );
       
    90 
       
    91         /**
       
    92         * Removes attachment field. When attachments view is removed separately, unnecessary
       
    93         * focus movements to attachment filed can be avoided e.g. in connection of forwarding
       
    94         * message. 
       
    95         */
       
    96         void RemoveAttachmentL( );
       
    97 
       
    98         /**
       
    99         * @return ETrue, if sender has alias in its address AND the alias is remote alias.
       
   100         */
       
   101         inline TBool IsRemoteAlias();
       
   102 
       
   103     private: // Constructors
       
   104 
       
   105         /**
       
   106         * Hidden C++ default constructor.
       
   107         */
       
   108         CMmsViewerHeader(
       
   109             CMmsClientMtm& aMtm,
       
   110             CUniObjectList& aAttachmentList,
       
   111             CMsgEditorView& aView,
       
   112             RFs& aFs );
       
   113 
       
   114         /**
       
   115         * By default Symbian constructor is private.
       
   116         */
       
   117         void ConstructL( );
       
   118         
       
   119         /**
       
   120         * Create UI control for from field. Base implementation is empty
       
   121         * @param aReadContent determines whether recipient data is read from
       
   122         *        MTM
       
   123         */
       
   124         void InsertFromL( TBool aReadContent );
       
   125 
       
   126         /**
       
   127         * Creates UI control for subject
       
   128         * @param aReadContent determines whether content is read to the
       
   129         *        UI control from MTM.
       
   130         *        Reading is not needed, if control is added by user selection
       
   131         */
       
   132         void InsertSubjectL(TBool aReadContent );
       
   133 
       
   134         /**
       
   135         * Create UI control for recipient.
       
   136         * @param aData data area for this recipient type
       
   137         * @param aResource resource to read basic recipient data from
       
   138         * @param aReadContent determines whether recipient data is read from
       
   139         *        MTM
       
   140         */
       
   141         void InsertRecipientL(  TAddressData&  aData,
       
   142                                 THeaderFields  aRecipientType,
       
   143                                 TBool          aReadContent);
       
   144 
       
   145         /**
       
   146         * Create UI control for recipient.
       
   147         * @param aData data area for this recipient type
       
   148         * @param aResource resource to read basic recipient data from
       
   149         * @param aReadContent determines whether recipient data is read from
       
   150         *        MTM
       
   151         * @param aAddHeadersRecipientType recipient type to be added as EUniFeature*      
       
   152         */
       
   153         void DoInsertRecipientL(    TAddressData&   aData,
       
   154                                     TInt            aResource,
       
   155                                     TBool           aReadContent,
       
   156                                     TInt            aAddHeadersRecipientType );
       
   157 
       
   158         /**
       
   159         * Creates UI control for attachment field
       
   160         * @param aReadContent Determines whether content is read to the UI control.
       
   161         */
       
   162         void InsertAttachmentL( TBool /*aReadContent*/);
       
   163 
       
   164     private: //Data
       
   165         TMuiuAddressType iSenderType;
       
   166         HBufC*          iAlias;
       
   167         // Indicates to which field Cc recipients are added, if it is variated Off
       
   168         // In practise only value is EUniFeatureTo 
       
   169         TInt            iAddIntoOtherCc;
       
   170         // Indicates to which field Bcc recipients are added, if it is variated Off
       
   171         // Value is either EUniFeatureTo or EUniFeatureCc
       
   172         TInt            iAddIntoOtherBcc;
       
   173         CUniObjectList& iAttachmentList;
       
   174         TBool           iRemoteAlias;
       
   175     };
       
   176 
       
   177 inline TMuiuAddressType CMmsViewerHeader::SenderType()
       
   178     {
       
   179     return iSenderType;
       
   180     }
       
   181 
       
   182 inline HBufC* CMmsViewerHeader::Alias()
       
   183     {
       
   184     return iAlias;
       
   185     }
       
   186 
       
   187 inline TBool CMmsViewerHeader::IsRemoteAlias()
       
   188     {
       
   189     return iRemoteAlias;
       
   190     }
       
   191 
       
   192 #endif // __MMSVIEWERHEADER_H