emailuis/uicomponents/inc/fstreerichitemdata.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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 rich text.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_FSTREERICHITEMDATA_H
       
    21 #define C_FSTREERICHITEMDATA_H
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 //<cmail> removed __FS_ALFRED_SUPPORT flag
       
    26 //#include <fsconfig.h>
       
    27 //</cmail> removed __FS_ALFRED_SUPPORT flag
       
    28 
       
    29 #include "fstreeitemdata.h"
       
    30 
       
    31 const TFsTreeItemDataType KFsTreeRichItemDataType = 4;
       
    32 
       
    33 class CAlfTexture;
       
    34 class CFsRichText;
       
    35 
       
    36 /**
       
    37  *  ?one_line_short_description
       
    38  *  ?more_complete_description
       
    39  *
       
    40  *  @code
       
    41  *   ?good_class_usage_example(s)
       
    42  *  @endcode
       
    43  *
       
    44  *  @lib ?library
       
    45  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    46  */
       
    47 NONSHARABLE_CLASS( CFsTreeRichItemData )
       
    48     : public CBase, public MFsTreeItemData
       
    49     {
       
    50 
       
    51 public:
       
    52 
       
    53     /**
       
    54      * Two-phased constructor
       
    55      *
       
    56      * @param aText Reference to the descriptor that the data will be copied
       
    57      *              from.
       
    58      */
       
    59     IMPORT_C static CFsTreeRichItemData* NewL( CFsRichText* aText );
       
    60 
       
    61     /**
       
    62     * Destructor.
       
    63     */
       
    64     virtual ~CFsTreeRichItemData();
       
    65 
       
    66     /**
       
    67      * Set the FsRichText object. Ownership of this object is gained.
       
    68      *
       
    69      * @param aText Object containing the text.
       
    70      */
       
    71     virtual void SetText( CFsRichText* aText );
       
    72 
       
    73     /**
       
    74      * Return the text.
       
    75      *
       
    76      * @return Refence to the text.
       
    77      */
       
    78     IMPORT_C const CFsRichText& Text() const;
       
    79 
       
    80     /**
       
    81      * Determines if the icon has been set.
       
    82      *
       
    83      * @return Logical value to inform if the icon is set or not.
       
    84      */
       
    85     virtual TBool IsIconSet() const;
       
    86 
       
    87     /**
       
    88      * Icon in use.
       
    89      *
       
    90      * @return Refence to the icon in use.
       
    91      */
       
    92     virtual const CAlfTexture& Icon() const;
       
    93 
       
    94     /**
       
    95      * Set an icon to use.
       
    96      *
       
    97      * @param aIcon Icon to use.
       
    98      */
       
    99     virtual void SetIcon( CAlfTexture& aIcon );
       
   100 
       
   101 // from base class MFsTreeItemData
       
   102 
       
   103     /**
       
   104      * From MFsTreeItemData.
       
   105      * Type of the data item.
       
   106      */
       
   107     virtual TFsTreeItemDataType Type() const;
       
   108 
       
   109 protected:
       
   110 
       
   111     CFsTreeRichItemData( CFsRichText* aText );
       
   112 
       
   113     void ConstructL();
       
   114 
       
   115 protected: //Data
       
   116 
       
   117     /**
       
   118      * Text data holder.
       
   119      * Own.
       
   120      */
       
   121     CFsRichText* iFsRichText;
       
   122 
       
   123     /**
       
   124      * Has the set icon.
       
   125      * Not own.
       
   126      */
       
   127     CAlfTexture* iIcon;
       
   128 
       
   129     };
       
   130 
       
   131 
       
   132 #endif  // C_FSTREERICHITEMDATA_H