internetradio2.0/uisrc/mirlistboxarray.cpp
changeset 3 ee64f059b8e1
parent 2 2e1adbfc62af
child 4 3f2d53f144fe
child 5 0930554dc389
equal deleted inserted replaced
2:2e1adbfc62af 3:ee64f059b8e1
     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 #include <stringloader.h> 
       
    19 #include "irdebug.h"
       
    20 #include "mirlistboxarray.h"
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // void MIRListBoxArray::ConstructL()
       
    27 // EPOC default constructor can leave.
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 void MIRListBoxArray::ConstructL()
       
    31     {
       
    32 	IRLOG_DEBUG( "MIRListBoxArray::ConstructL - Entering" );
       
    33 	iFlag = EFalse;
       
    34 	IRLOG_DEBUG( "MIRListBoxArray::ConstructL - Exiting" );
       
    35    	}
       
    36 // -----------------------------------------------------------------------------
       
    37 // MIRListBoxArray::NewL()
       
    38 // Two-phased constructor.
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 MIRListBoxArray* MIRListBoxArray::NewL()
       
    42     {
       
    43  	IRLOG_DEBUG( "MIRListBoxArray::NewL" );
       
    44     MIRListBoxArray* self = MIRListBoxArray::NewLC();
       
    45     CleanupStack::Pop( self );
       
    46     IRLOG_DEBUG( "MIRListBoxArray::NewL - Exiting" );
       
    47     return self;
       
    48     }
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // MIRListBoxArray* MIRListBoxArray::NewLC()
       
    52 // Two-phased constructor.
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 MIRListBoxArray* MIRListBoxArray::NewLC()
       
    56     {
       
    57     IRLOG_DEBUG( "MIRListBoxArray::NewLC - Entering" );
       
    58     MIRListBoxArray* self = new( ELeave ) MIRListBoxArray;
       
    59     CleanupStack::PushL( self );
       
    60     self->ConstructL();
       
    61     IRLOG_DEBUG( "MIRListBoxArray::NewL - Exiting." );
       
    62     return self;
       
    63     }
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // MIRListBoxArray::MIRListBoxArray()
       
    68 // Destructor
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 /*MIRListBoxArray::~MIRListBoxArray()
       
    72 	{
       
    73 	}
       
    74 */
       
    75 // ---------------------------------------------------------------------------
       
    76 // MIRListBoxArray::MIRListBoxArray()
       
    77 // Destructor
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 MIRListBoxArray::MIRListBoxArray()
       
    81 	{
       
    82 	}
       
    83     
       
    84 // ----------------------------------------------------------
       
    85 // TInt  MIRListBoxArray::MdcaCount() 
       
    86 // returns the number of items the list box has. 
       
    87 // ----------------------------------------------------------	
       
    88  TInt MIRListBoxArray::MdcaCount() const
       
    89     {
       
    90     IRLOG_DEBUG( "MIRListBoxArray::MdcaCount - Entering." );
       
    91 	TInt count = iListArray->Count() ;
       
    92     IRLOG_DEBUG( "MIRListBoxArray::MdcaCount - Exiting." );
       
    93 	return count;
       
    94     }  
       
    95 // ----------------------------------------------------------
       
    96 // TPtrC MIRListBoxArray::MdcaPoint(TInt aIndex) const
       
    97 // Returns the text of the specified item. 
       
    98 // ----------------------------------------------------------	
       
    99 TPtrC MIRListBoxArray::MdcaPoint(TInt aIndex) const 
       
   100     {
       
   101     IRLOG_DEBUG( "MIRListBoxArray::MdcaPoint - Entering." );
       
   102     IRLOG_DEBUG( "MIRListBoxArray::MdcaPoint - Exiting." );
       
   103 	return iListArray->MdcaPoint (aIndex);
       
   104     }
       
   105  // ----------------------------------------------------------
       
   106 // void MIRListBoxArray::SetListArray() 
       
   107 // sets the Listarray 
       
   108 // ----------------------------------------------------------	
       
   109 void MIRListBoxArray::SetListArray(CDesCArray* aListArray)
       
   110 	{
       
   111     IRLOG_DEBUG( "MIRListBoxArray::SetListArray - Entering." );
       
   112     iListArray = aListArray;
       
   113     IRLOG_DEBUG( "MIRListBoxArray::SetListArray - Exiting." );
       
   114 	}
       
   115 
       
   116 // ----------------------------------------------------------
       
   117 // void MIRListBoxArray::SetItemAtZero() 
       
   118 // sets the item at the zeroth index. 
       
   119 // ----------------------------------------------------------	
       
   120 void MIRListBoxArray::SetItemAtZero(TBool aAdFlag,HBufC& aString,TBool aMainView)
       
   121 	{
       
   122     IRLOG_DEBUG( "MIRListBoxArray::SetItemAtZero - Entering." );
       
   123 	iLastPlayedString = &aString;
       
   124 	iLastPlayed = aAdFlag;
       
   125 	if(iLastPlayed && !aMainView)
       
   126 	TRAP_IGNORE(iListArray->InsertL(0,*iLastPlayedString));
       
   127     IRLOG_DEBUG( "MIRListBoxArray::SetItemAtZero - Exiting." );
       
   128 	}
       
   129 // ----------------------------------------------------------
       
   130 // TInt MIRListBoxArray::SetFlag() 
       
   131 // Returns the flag when the count in the filtered model is incremented. 
       
   132 // ----------------------------------------------------------	
       
   133 void MIRListBoxArray::SetFlag(TBool aFlag)  
       
   134     {
       
   135     IRLOG_DEBUG( "MIRListBoxArray::SetFlag - Entering." );
       
   136 	iFlag = aFlag;
       
   137     IRLOG_DEBUG( "MIRListBoxArray::SetFlag - Exiting." );
       
   138     }
       
   139   
       
   140 // ----------------------------------------------------------
       
   141 // void MIRListBoxArray::SetIndexFlag() 
       
   142 // Returns the index flag. 
       
   143 // ----------------------------------------------------------	
       
   144 void MIRListBoxArray::SetIndexFlag(TBool aFlag)  
       
   145     {
       
   146     IRLOG_DEBUG( "MIRListBoxArray::SetFlag - Entering." );
       
   147 	iIndexFlag = aFlag;
       
   148     IRLOG_DEBUG( "MIRListBoxArray::SetFlag - Exiting." );
       
   149     }
       
   150 
       
   151 // ----------------------------------------------------------
       
   152 // TBool MIRListBoxArray::GetIndexFlag() 
       
   153 // Returns the index flag 
       
   154 // ----------------------------------------------------------	
       
   155 TBool MIRListBoxArray::GetIndexFlag()  
       
   156     {
       
   157     IRLOG_DEBUG( "MIRListBoxArray::SetFlag - Entering." );
       
   158     IRLOG_DEBUG( "MIRListBoxArray::SetFlag - Exiting." );
       
   159 	return iIndexFlag ;
       
   160     }
       
   161 
       
   162  /*// ----------------------------------------------------------
       
   163 // void MIRListBoxArray::SetListArray() 
       
   164 // sets the item at the zeroth index. 
       
   165 // ----------------------------------------------------------	
       
   166 MDesCArray* MIRListBoxArray::GetListArray()
       
   167 	{
       
   168     IRLOG_DEBUG( "MIRListBoxArray::GetListArray - Entering." );
       
   169     IRLOG_DEBUG( "MIRListBoxArray::GetListArray - Exiting." );
       
   170     return iListArray;
       
   171 	}
       
   172 // ----------------------------------------------------------
       
   173 // TInt MIRListBoxArray::GetActualCount() 
       
   174 // Returns the text of the specified item. 
       
   175 // ----------------------------------------------------------	
       
   176 TInt MIRListBoxArray::GetActualCount()  
       
   177     {
       
   178     IRLOG_DEBUG( "MIRListBoxArray::GetActualCount - Entering." );
       
   179     IRLOG_DEBUG( "MIRListBoxArray::GetActualCount - Exiting." );
       
   180  	return iListArray->Count();
       
   181    }
       
   182 // ----------------------------------------------------------
       
   183 // TInt MIRListBoxArray::GetActualCount() 
       
   184 // Returns the text of the specified item. 
       
   185 // ----------------------------------------------------------	
       
   186 void MIRListBoxArray::SetActualCount(TInt aCount)  
       
   187     {
       
   188     IRLOG_DEBUG( "MIRListBoxArray::SetActualCount - Entering." );
       
   189 	iCount = aCount;
       
   190     IRLOG_DEBUG( "MIRListBoxArray::SetActualCount - Exiting." );
       
   191     }*/