videofeeds/vcnsuiengine/src/vcxnscategory.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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 
       
    20 #include "vcxnscategory.h"
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // Default constructor
       
    24 // -----------------------------------------------------------------------------
       
    25 //
       
    26 CVcxNsCategory::CVcxNsCategory()
       
    27     : iContentIndex( 0 )
       
    28     {
       
    29     }
       
    30 
       
    31 // -----------------------------------------------------------------------------
       
    32 // Destructor
       
    33 // -----------------------------------------------------------------------------
       
    34 //
       
    35 CVcxNsCategory::~CVcxNsCategory( )
       
    36     {
       
    37     delete iName;
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // Constructor
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CVcxNsCategory* CVcxNsCategory::NewL( )
       
    45     {
       
    46     CVcxNsCategory* self = new ( ELeave ) CVcxNsCategory;
       
    47     return self;
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // Get category name
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 EXPORT_C const TDesC& CVcxNsCategory::GetName()
       
    55     {
       
    56     if( iName && iName->Length() > 0 )
       
    57         {
       
    58         return *iName;
       
    59         }
       
    60     else
       
    61         {
       
    62         return KNullDesC;
       
    63         }
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // Get category id
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 EXPORT_C TUint32 CVcxNsCategory::GetCategoryId()
       
    71     {
       
    72     return iCategoryId;
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // Get video count
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 EXPORT_C TInt CVcxNsCategory::GetVideoCount()
       
    80     {
       
    81     return iVideoCount;
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // Set category name
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CVcxNsCategory::SetNameL( const TDesC& aName )
       
    89     {
       
    90     delete iName;
       
    91     iName = NULL;
       
    92     
       
    93     if( aName.Length() > 0 )
       
    94         {
       
    95         iName = aName.AllocL();
       
    96         } 
       
    97     }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // Set category id
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 void CVcxNsCategory::SetCategoryId( const TUint32 aCategoryId )
       
   104     {
       
   105     iCategoryId = aCategoryId;
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // Set video count
       
   110 // -----------------------------------------------------------------------------
       
   111 //
       
   112 void CVcxNsCategory::SetVideoCount( const TInt aVideoCount )
       
   113     {
       
   114     iVideoCount = aVideoCount;
       
   115     }
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // Set content index
       
   119 // -----------------------------------------------------------------------------
       
   120 //
       
   121 void CVcxNsCategory::SetHighlightContentIndex( TInt aIndex )
       
   122     {
       
   123     iContentIndex = aIndex;
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------------------------
       
   127 // CVcxNsCategory::ContentIndex()
       
   128 // -----------------------------------------------------------------------------
       
   129 //
       
   130 TInt CVcxNsCategory::HighlightContentIndex( )
       
   131     {
       
   132     return iContentIndex;
       
   133     }
       
   134