mobilemessaging/mmsui/mtminc/MmsMtmDeliveryPopup.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: MmsMtmDeliveryPopup  declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #if !defined(__MUIU_DELIVERY_POPUP_H__)
       
    21 #define __MUIU_DELIVERY_POPUP_H__
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include <bamdesca.h>               //MDesCArray
       
    26 #include <aknPopup.h>               //CAknPopupList
       
    27 #include <aknlists.h>               //CAknSingleHeadingPopupMenuStyleListBox
       
    28 #include <ConeResLoader.h>
       
    29 #include <Muiumsginfo.h> // TMsgInfoMessageInfoData
       
    30 
       
    31 // DATA TYPES
       
    32 class CMsgDeliveryItem;
       
    33 
       
    34 
       
    35 /**
       
    36 * Class which displays a message info dialog for particular message types
       
    37 */
       
    38 class CMsgInfoDeliveryStatusPopup : public CBase
       
    39     {
       
    40 
       
    41     public:
       
    42 
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */  
       
    46         static CMsgInfoDeliveryStatusPopup* NewL();
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */ 
       
    51         ~CMsgInfoDeliveryStatusPopup();
       
    52 
       
    53         /**
       
    54         * Show the message info dialog.
       
    55         */
       
    56         TInt ExecuteL();
       
    57 
       
    58         /**
       
    59         * Receives the data array from where to read data for the dialog.
       
    60         */
       
    61         void SetDataArray(CArrayPtrFlat< CMsgDeliveryItem >* aArray);
       
    62 
       
    63     private:
       
    64 
       
    65         /**
       
    66         * 
       
    67         */
       
    68         CMsgInfoDeliveryStatusPopup();
       
    69 
       
    70         /**
       
    71         * Symbian OS constructor.
       
    72         */
       
    73         void ConstructL();
       
    74 
       
    75         /**
       
    76         * Reads data from the delivery item, parses it to a suitable form and
       
    77         * adds it into a string given in aDest. Calculates the length of the items 
       
    78         * data presented in one string.
       
    79         * 
       
    80         * @param aItem: Message item to be parsed.
       
    81         * @param aDest: Destination string. Give it as NULL and method only returns the lenght.
       
    82         */
       
    83         TInt ParseStringL(CMsgDeliveryItem* aItem, TPtr* aDest);
       
    84         
       
    85         /**
       
    86         * Reads data from the delivery item, parses it to a suitable form and
       
    87         * adds it into iFailedText string.
       
    88         * 
       
    89         * @param aItem: Message item to be parsed.
       
    90         */
       
    91         void ParseFailedL(CMsgDeliveryItem* aItem);
       
    92 
       
    93         /**
       
    94         * Reads data from the delivery item, parses it to a suitable form and
       
    95         * adds it into iDeliveredText string.
       
    96         * 
       
    97         * @param aItem: Message item to be parsed.
       
    98         */
       
    99         void ParseDeliveredL(CMsgDeliveryItem* aItem);
       
   100 
       
   101         /**
       
   102         * Reads data from the delivery item, parses it to a suitable form and
       
   103         * adds it into iPendingText string.
       
   104         * 
       
   105         * @param aItem: Message item to be parsed.
       
   106         */
       
   107         void ParsePendingL(CMsgDeliveryItem* aItem);	
       
   108 
       
   109         /**
       
   110         * Loops through the delivery items in the data array and
       
   111         * parses their data into the correct strings with a correct style
       
   112         */
       
   113         void ParseTextL();
       
   114         
       
   115         /**
       
   116         * Adds localised "Delivered:", "Failed:" and "Pending" strings as labels into the text
       
   117         * strings
       
   118         */
       
   119         void AddLabelsL(TInt aFailed, 
       
   120                         TInt aPending, 
       
   121                         TInt aDelivered, 
       
   122                         TInt aRead, 
       
   123                         TInt aUnavailable );
       
   124 
       
   125         /**
       
   126         * Calculates the length of the labels and adds the lengths in to the message length attributes
       
   127         */
       
   128         void CalculateLabelSizesL(   TInt aFailed, 
       
   129                                     TInt aPending, 
       
   130                                     TInt aDelivered, 
       
   131                                     TInt aRead, 
       
   132                                     TInt aUnavailable );
       
   133 
       
   134         /**
       
   135         * Checks whether message was sent today. Information used to determine
       
   136         * on how to display the time / date in delivery status dialog
       
   137         */
       
   138         TBool MessageSentToday(const TDateTime& messageTime);
       
   139 
       
   140     private:
       
   141         HBufC* iFailedText;
       
   142         HBufC* iPendingText;
       
   143         HBufC* iDeliveredText;
       
   144         HBufC* iReadText;
       
   145         HBufC* iUnavailableText;
       
   146         HBufC* iText;
       
   147         
       
   148         TInt iMessageSize;
       
   149         TInt iFailedSize;
       
   150         TInt iPendingSize;
       
   151         TInt iDeliveredSize;
       
   152         TInt iReadSize;
       
   153         TInt iUnavailableSize;
       
   154 
       
   155         CArrayPtrFlat< CMsgDeliveryItem >* iDataArray;	
       
   156     };
       
   157 
       
   158 #endif  //__MUIU_MESSAGE_INFO_H__
       
   159 
       
   160 // End of file