emailservices/emailframework/commonlib/src/CFSMailIterator.cpp
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-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 "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:  email list iterator
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include "CFSMailIterator.h"
       
    21 
       
    22 // ================= MEMBER FUNCTIONS ==========================================
       
    23 // -----------------------------------------------------------------------------
       
    24 // CFSMailIterator::NewLC
       
    25 // -----------------------------------------------------------------------------
       
    26 EXPORT_C CFSMailIterator* CFSMailIterator::NewLC( 	MFSMailIterator& aIterator,
       
    27 													CFSMailRequestHandler* aRequestHandler )
       
    28 {
       
    29     FUNC_LOG;
       
    30   CFSMailIterator* api = new (ELeave) CFSMailIterator();
       
    31   CleanupStack:: PushL(api);
       
    32   api->ConstructL( aIterator, aRequestHandler );
       
    33   return api;
       
    34 } 
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CFSMailIterator::NewL
       
    38 // -----------------------------------------------------------------------------
       
    39 EXPORT_C CFSMailIterator* CFSMailIterator::NewL( 	MFSMailIterator& aIterator,
       
    40 													CFSMailRequestHandler* aRequestHandler )
       
    41 {
       
    42     FUNC_LOG;
       
    43   CFSMailIterator* api =  CFSMailIterator::NewLC( aIterator, aRequestHandler );
       
    44   CleanupStack:: Pop(api);
       
    45   return api;
       
    46 }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // CFSMailIterator::CFSMailIterator
       
    50 // -----------------------------------------------------------------------------
       
    51 CFSMailIterator::CFSMailIterator()
       
    52 {
       
    53     FUNC_LOG;
       
    54 	iIterator = NULL;
       
    55 }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CFSMailIterator::ConstructL
       
    59 // -----------------------------------------------------------------------------
       
    60 void CFSMailIterator::ConstructL( 	MFSMailIterator& aIterator,
       
    61 									CFSMailRequestHandler* aRequestHandler )
       
    62 {
       
    63     FUNC_LOG;
       
    64 	iIterator = &aIterator;
       
    65 	iRequestHandler = aRequestHandler;
       
    66  }
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 // CFSMailIterator::~CFSMailIterator
       
    70 // -----------------------------------------------------------------------------
       
    71 EXPORT_C CFSMailIterator::~CFSMailIterator()
       
    72 {
       
    73     FUNC_LOG;
       
    74 	if(iIterator)
       
    75 		{
       
    76 		delete iIterator;
       
    77 		}
       
    78 }
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CFSMailIterator::NextL
       
    82 // -----------------------------------------------------------------------------
       
    83 EXPORT_C TBool CFSMailIterator::NextL(
       
    84         TFSMailMsgId aCurrentMessageId, 
       
    85         TUint aCount, 
       
    86         RPointerArray<CFSMailMessage>& aMessages)
       
    87 	{
       
    88     FUNC_LOG;
       
    89 	// call plugin iterator
       
    90 	TBool ret = iIterator->NextL(aCurrentMessageId,aCount,aMessages);
       
    91 	
       
    92 	return ret;
       
    93 	}
       
    94 	
       
    95 	
       
    96 // -----------------------------------------------------------------------------
       
    97 // CFSMailIterator::NextL
       
    98 // -----------------------------------------------------------------------------
       
    99 EXPORT_C TBool CFSMailIterator::NextL(
       
   100         const TDesC&  aStartWith, 
       
   101         TUint aCount, 
       
   102         RPointerArray<CFSMailMessage>& aMessages)
       
   103 	{
       
   104     FUNC_LOG;
       
   105 
       
   106 	// call plugin iterator
       
   107 	TBool ret = iIterator->NextL(aStartWith,aCount,aMessages);
       
   108 	
       
   109 	return ret;
       
   110 	}
       
   111 	
       
   112 // -----------------------------------------------------------------------------
       
   113 // CFSMailIterator::PreviousL
       
   114 // -----------------------------------------------------------------------------
       
   115 EXPORT_C TBool CFSMailIterator::PreviousL(
       
   116         TFSMailMsgId aCurrentMessageId, 
       
   117         TUint aCount, 
       
   118         RPointerArray<CFSMailMessage>& aMessages)
       
   119 	{
       
   120     FUNC_LOG;
       
   121 		// call plugin iterator
       
   122 	TBool ret = iIterator->PreviousL(aCurrentMessageId,aCount,aMessages);
       
   123 		
       
   124 	return ret;
       
   125 
       
   126 	}
       
   127 	
       
   128 // -----------------------------------------------------------------------------
       
   129 // CFSMailIterator::PreviousL
       
   130 // -----------------------------------------------------------------------------
       
   131 EXPORT_C TBool CFSMailIterator::PreviousL(
       
   132         const TDesC&  aStartWith, 
       
   133         TUint aCount, 
       
   134         RPointerArray<CFSMailMessage>& aMessages)
       
   135 	{
       
   136     FUNC_LOG;
       
   137 
       
   138 	// call plugin iterator
       
   139 	TBool ret = iIterator->PreviousL(aStartWith,aCount,aMessages);
       
   140 	
       
   141 	return ret;
       
   142 
       
   143 	}
       
   144