emailuis/uicomponents/inc/fstreeplaintwolineitemdata.h
branchRCL_3
changeset 25 3533d4323edc
parent 0 8466d47a6819
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Tree item data derived class able to store plain text.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_FSTREEPLAINTWOLINEITEMDATA_H
       
    20 #define C_FSTREEPLAINTWOLINEITEMDATA_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "fstreeplainonelineitemdata.h"
       
    25  
       
    26 const TFsTreeItemDataType KFsTreePlainTwoLineItemDataType = 3;
       
    27 
       
    28 class CAlfTexture;
       
    29 
       
    30 NONSHARABLE_CLASS( CFsTreePlainTwoLineItemData ): 
       
    31     public CFsTreePlainOneLineItemData 
       
    32     {
       
    33 public:
       
    34 
       
    35     /**
       
    36      * Two-phased constructor
       
    37      *
       
    38      * @param aText Reference to the descriptor that the data will be copied
       
    39      *              from.
       
    40      */
       
    41     IMPORT_C static CFsTreePlainTwoLineItemData* NewL( );
       
    42     
       
    43     /**
       
    44     * C++ destructor
       
    45     */
       
    46     virtual ~CFsTreePlainTwoLineItemData();
       
    47     
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Returns secondary text.
       
    52      * 
       
    53      */
       
    54     virtual TDesC& SecondaryData( ) const;
       
    55     
       
    56     /**
       
    57      * Copies data from the descriptor given as a parameter.
       
    58      * 
       
    59      * @param aData Reference to the descriptor that the data will be copied
       
    60      *              from.
       
    61      */
       
    62     virtual void SetSecondaryDataL( const TDesC& aData );
       
    63     
       
    64     /**
       
    65      * Returns length (not size) of the secondary data descriptor.
       
    66      * 
       
    67      * @return The length of the descriptor holding data.
       
    68      */
       
    69     virtual TUint SecondaryDataLength() const;
       
    70     
       
    71     /**
       
    72      * Returns preview pane text.
       
    73      * 
       
    74      */
       
    75     virtual TDesC& PreviewPaneData( ) const;
       
    76     
       
    77     /**
       
    78      * Sets preview pane text.
       
    79      * 
       
    80      * @param aData Reference to the descriptor that the data will be copied
       
    81      *              from.
       
    82      */
       
    83     virtual void SetPreviewPaneDataL( const TDesC& aData );
       
    84     
       
    85     /**
       
    86      * Returns length (not size) of the preview pane data descriptor.
       
    87      * 
       
    88      * @return The length of the descriptor holding data.
       
    89      */
       
    90     virtual TUint PreviewPaneDataLength() const;
       
    91     
       
    92     /**
       
    93      * Sets texture for a flag icon.
       
    94      * 
       
    95      * @param aIcon Flag icon texture.
       
    96      */
       
    97     virtual void SetFlagIcon ( CAlfTexture& aIcon );
       
    98     
       
    99     /**
       
   100      * Returns flag icon texture.
       
   101      */
       
   102     virtual const CAlfTexture& FlagIcon ( ) const;        
       
   103 
       
   104     /**
       
   105      * Returns information wether icon for a flag is set.
       
   106      * 
       
   107      * @return ETrue if the flag icon has been set.
       
   108      */
       
   109     virtual TBool IsFlagIconSet ( ) const;
       
   110     
       
   111     /**
       
   112      * Functions sets text for a time and date visual.
       
   113      * 
       
   114      * @param aData Reference to the descriptor that the data will be copied
       
   115      *              from.
       
   116      */
       
   117     virtual void SetDateTimeDataL ( const TDesC& aData );
       
   118     
       
   119     /**
       
   120      *  Returns date and time text.
       
   121      * 
       
   122      * @return Date and Time text.
       
   123      */
       
   124     virtual TDesC& DateTimeData ( ) const;
       
   125     
       
   126     /**
       
   127      * Returns length of the date and time text.
       
   128      * 
       
   129      * @return The length of the descriptor holding date and time data.
       
   130      */
       
   131     virtual TUint DateTimeDataLength ( ) const;
       
   132     
       
   133     /**
       
   134      * Sets texture for a priority icon.
       
   135      * 
       
   136      * @param aIcon Priority icon texture.
       
   137      */
       
   138     virtual void SetPriorityIcon ( CAlfTexture& aIcon );
       
   139     
       
   140     /**
       
   141      * Returns priority texture.
       
   142      */
       
   143     virtual const CAlfTexture& PriorityIcon ( ) const;        
       
   144 
       
   145     /**
       
   146      * Returns information wether texture for a priority icon is set.
       
   147      * 
       
   148      * @return ETrue if the priority texture has been set.
       
   149      */
       
   150     virtual TBool IsPriorityIconSet ( ) const;
       
   151     
       
   152 // from base class MFsTreeItemData
       
   153     
       
   154     /**
       
   155      * Type of the data item.
       
   156      */    
       
   157     virtual TFsTreeItemDataType Type() const;
       
   158     
       
   159 protected:
       
   160 
       
   161     /**
       
   162      * C++ constructor
       
   163      */
       
   164     CFsTreePlainTwoLineItemData( );
       
   165     
       
   166     /**
       
   167      * Second phase constructor
       
   168      *
       
   169      * @param aText Reference to the descriptor that the data will be copied
       
   170      *              from.
       
   171      */
       
   172     void ConstructL( );
       
   173     
       
   174 protected: //Data
       
   175     
       
   176     /**
       
   177      * Descriptor holding secondaty text.
       
   178      * Own.
       
   179      */
       
   180     HBufC* iSecondaryData;
       
   181     
       
   182     /**
       
   183      * Descriptor holding preview pane text (3rd line of text).
       
   184      * Own.
       
   185      */
       
   186     HBufC* iPreviewPaneData;
       
   187     
       
   188     /**
       
   189      * Flag icon
       
   190      */
       
   191     CAlfTexture* iFlagIcon;
       
   192     
       
   193     /**
       
   194      * Date string.
       
   195      */
       
   196     HBufC* iDateTimeData;
       
   197 
       
   198     /**
       
   199      * Priority icon.
       
   200      */
       
   201     CAlfTexture* iPriorityIcon;
       
   202     
       
   203     };
       
   204     
       
   205 
       
   206 #endif  // C_FSTREEPLAINTWOLINEITEMDATA_H