mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/Stubs/src/ccallinfoiter_stub.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c)  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:  Iterator class for going through ongoing calls.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <callinformation.h>    //Call Information Mediator API
       
    20 #include "ccallinfoiter.h"
       
    21 #include "mcall.h"
       
    22 
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // C++ constructor.
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CCallInfoIter::CCallInfoIter( CCallInfos& aCallInfos ): iCallInfos( aCallInfos )
       
    32     { 
       
    33     First();    
       
    34     }
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // Destructor
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 CCallInfoIter::~CCallInfoIter()
       
    41     {
       
    42     }
       
    43 
       
    44 // ---------------------------------------------------------------------------
       
    45 // Two-phased constructor.
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CCallInfoIter* CCallInfoIter::NewLC( CCallInfos& aCallInfos )
       
    49     {
       
    50     CCallInfoIter* self = new (ELeave)CCallInfoIter( aCallInfos );
       
    51     CleanupStack::PushL(self);
       
    52     self->ConstructL();
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // Two-phased constructor.
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CCallInfoIter* CCallInfoIter::NewL( CCallInfos& aCallInfos )
       
    61     {
       
    62     CCallInfoIter* self = CCallInfoIter::NewLC( aCallInfos );
       
    63     CleanupStack::Pop(self);
       
    64     return self;
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // Symbian second-phase constructor.
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 void CCallInfoIter::ConstructL()
       
    72     {
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // Returns the amount of calls
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 EXPORT_C TInt CCallInfoIter::Count() const
       
    80     {
       
    81     TUint count = 1;
       
    82     return count; 
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // Returns the current call.
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 EXPORT_C const MCall& CCallInfoIter::Current() const
       
    90     {
       
    91     return iCallInfos.CallInfos()[iCurrentIndex];       
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // Intializes the current call to the first call.
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 EXPORT_C void CCallInfoIter::First()
       
    99     {
       
   100     iCurrentIndex = 0; 
       
   101     }
       
   102 
       
   103 
       
   104 // End of File.