classicui_plat/ganes_api/inc/ganes/HgItem.h
changeset 47 2f0c06423c72
parent 46 0e1e0022bd03
child 53 3c67ea82fafc
equal deleted inserted replaced
46:0e1e0022bd03 47:2f0c06423c72
     1 /*
       
     2 * Copyright (c) 2009 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HGITEM_H_
       
    20 #define HGITEM_H_
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 // Forward declarations
       
    25 class CGulIcon;
       
    26 
       
    27 class CHgItem : public CBase
       
    28     {
       
    29 public:
       
    30     
       
    31     /**
       
    32      * Creates new CHgItem.
       
    33      * 
       
    34      * @param aFlags Item flags. Default is EHgItemFlagsNone
       
    35      * @param aIcon Item Icon. Ownership transferred.
       
    36      * @param aTitle Title text.
       
    37      * @param aText Additional Text.
       
    38      * 
       
    39      * @return CHgItem-object
       
    40      */
       
    41     IMPORT_C static CHgItem* NewL(TInt aFlags = EHgItemFlagsNone,
       
    42             CGulIcon* aIcon = 0, 
       
    43             const TDesC& aTitle = KNullDesC,
       
    44             const TDesC& aText = KNullDesC );
       
    45     
       
    46     /**
       
    47      * @copydoc CHgItem::NewL
       
    48      */
       
    49     IMPORT_C static CHgItem* NewLC(TInt aFlags = EHgItemFlagsNone,
       
    50             CGulIcon* aIcon = 0,
       
    51             const TDesC& aTitle = KNullDesC,
       
    52             const TDesC& aText = KNullDesC);
       
    53 
       
    54     /**
       
    55      * Destructor.
       
    56      */
       
    57     IMPORT_C virtual ~CHgItem();
       
    58 
       
    59 public:
       
    60     /**
       
    61      * Gets the Icon.
       
    62      * 
       
    63      * @return pointer to Icon.
       
    64      */
       
    65     IMPORT_C CGulIcon* Icon() const;
       
    66 
       
    67     /**
       
    68      * Gets the title text.
       
    69      * 
       
    70      * @return The title text.
       
    71      */
       
    72     IMPORT_C const TDesC& Title() const;
       
    73     
       
    74     /**
       
    75      * Gets the additional text.
       
    76      * 
       
    77      * @return The additional text.
       
    78      */
       
    79     IMPORT_C const TDesC& Text() const;
       
    80     
       
    81     /**
       
    82      * Gets time of the item.
       
    83      * 
       
    84      * @return Time.
       
    85      */
       
    86     IMPORT_C TTime Time() const;
       
    87     
       
    88     /**
       
    89      * Sets icon.
       
    90      * 
       
    91      * @param aIcon New icon. Ownership transferred.
       
    92      */
       
    93     IMPORT_C virtual void SetIcon( CGulIcon* aIcon, TInt aFlags = EHgItemFlagsNone );
       
    94     
       
    95     /**
       
    96      * Sets title text.
       
    97      * 
       
    98      * @param aTitle New title text.
       
    99      */
       
   100     IMPORT_C void SetTitleL( const TDesC& aTitle );
       
   101     
       
   102     /**
       
   103      * Sets additional text.
       
   104      * 
       
   105      * @param aTitle New additional text.
       
   106      */
       
   107     IMPORT_C void SetTextL( const TDesC& aText );
       
   108 
       
   109     /**
       
   110      * Sets item time.
       
   111      * 
       
   112      * @param aTime Time.
       
   113      */
       
   114     IMPORT_C void SetTime( TTime aTime );
       
   115 
       
   116     /**
       
   117      * Gets flags associated with item.
       
   118      * @see THgItemFlags
       
   119      */
       
   120     IMPORT_C TInt Flags();
       
   121 
       
   122     
       
   123 public:
       
   124 
       
   125     /**
       
   126      * Item flags.
       
   127      */
       
   128     enum THgItemFlags
       
   129         {
       
   130         EHgItemFlagsNone = 0,
       
   131         EHgItemFlagMarked = 0x0001,
       
   132         EHgItemFlagsDrmRightsValid = 0x0002,
       
   133         EHgItemFlagsDrmRightsExpired = 0x0004,
       
   134         EHgItemFlagsVideo = 0x0008,
       
   135         EHgItemFlagsMmc = 0x0010,
       
   136         EHgItemFlagsPlaybackIndicator = 0x0020,        
       
   137         EHgItemFlagsPauseIndicator = 0x0040,        
       
   138         EHgItemFlagsBrokenPlaylistIndicator = 0x0080,        
       
   139         EHgItemFlagsBrokenTrackIndicator = 0x0100,        
       
   140         EHgItemFlagsCorruptedTrackIndicator = 0x0200,
       
   141         EHgItemFlagsNewVideoIndicator = 0x0400,
       
   142         EHgItemFlagsMassStorageIndicator = 0x0800,
       
   143         EHgItemFlagsPhoneStorageIndicator = 0x1000,
       
   144         EHgItemFlagsNewPodcastIndicator = 0x2000,
       
   145         EHgItemFlagsPlayedPodcastIndicator = 0x4000,
       
   146         EHgItemFlagsCompletelyPlayedPodcastIndicator = 0x8000,
       
   147         EHgItemFlagsMoveUpIndicator = 0x10000,
       
   148         EHgItemFlagsMoveDownIndicator = 0x20000,
       
   149         EHgItemFlagsMoveUpDownIndicator = 0x40000,
       
   150         EHgItemFlagsIconOverlayIndicator = 0x80000000
       
   151         };
       
   152 
       
   153     /**
       
   154      * Sets item flags.
       
   155      * 
       
   156      * @param aFlags Flags to be set.
       
   157      */
       
   158     IMPORT_C void SetFlags( TInt aFlags );
       
   159         
       
   160     /**
       
   161      * Clears item flags.
       
   162      * 
       
   163      * @param aFlags Flags to be cleared.
       
   164      */
       
   165     IMPORT_C void ClearFlags( TInt aFlags );
       
   166     
       
   167 protected:
       
   168     
       
   169     CHgItem( TInt aFlags, CGulIcon* aIcon );
       
   170     virtual void ConstructL( const TDesC& aTitle, const TDesC& aText );
       
   171     
       
   172 protected:
       
   173     
       
   174     CGulIcon* iIcon; // Item icon. Own
       
   175     HBufC* iTitle; // Item title. Own
       
   176     HBufC* iText; // Item text. Own
       
   177     TTime iTime; // Item time
       
   178     
       
   179     TInt iFlags; // Item flags 
       
   180     
       
   181     };
       
   182 
       
   183 #endif /*HGITEM_H_*/