pimappservices/calendar/client/src/caliterator.cpp
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <caliterator.h>
       
    17 #include "caliteratorimpl.h"
       
    18 #include <calsession.h>
       
    19 
       
    20 CCalIter::CCalIter()
       
    21 	{
       
    22 	}
       
    23 
       
    24 void CCalIter::ConstructL(CCalSession& aSession)
       
    25 	{
       
    26 	iCalIteratorImpl = new (ELeave) CCalIteratorImpl(aSession.Impl());
       
    27 	}
       
    28 
       
    29 /** The destructor frees all resources owned by the iterator, prior to its destruction. 
       
    30 @publishedAll
       
    31 @released
       
    32 @capability None
       
    33 */
       
    34 EXPORT_C CCalIter::~CCalIter()
       
    35 	{
       
    36 	delete iCalIteratorImpl;
       
    37 	}
       
    38 
       
    39 /** Allocates and constructs an iterator for iterating though all the entries in the file.
       
    40 @publishedAll
       
    41 @released
       
    42 @capability None
       
    43 @return CCalIter pointer
       
    44 @param aSession The session to the calendar file.
       
    45 */
       
    46 EXPORT_C CCalIter* CCalIter::NewL(CCalSession& aSession)
       
    47 	{
       
    48 	CCalIter* self = new (ELeave) CCalIter();
       
    49 	CleanupStack::PushL(self);
       
    50 	self->ConstructL(aSession);
       
    51 	CleanupStack::Pop(self);
       
    52 	return self;
       
    53 	}
       
    54 
       
    55 /** Sets the iterator to the first entry which is a parent (parent and its children 
       
    56 have the same Uid) and retrieves its Uid. 
       
    57 @leave KErrNotReady If the calendar file is on a drive where the media has been removed.
       
    58 @publishedAll
       
    59 @released
       
    60 @capability None
       
    61 @return a descriptor which contains the Uid of the first entry. 
       
    62 The return value can be KNullDesC8 if there is no entry in the file. 
       
    63 */
       
    64 EXPORT_C const TDesC8& CCalIter::FirstL()
       
    65 	{
       
    66 	return iCalIteratorImpl->FirstL();
       
    67 	}
       
    68 
       
    69 /** Moves the entry iterator to the next entry which is a parent (parent and its 
       
    70 children have the same Uid) and retrieves its Uid.
       
    71 @leave KErrNotReady If the calendar file is on a drive where the media has been removed.
       
    72 @publishedAll
       
    73 @released
       
    74 @capability None
       
    75 @return a descriptor which contains the Uid of the first entry. 
       
    76 The return value can be KNullDesC8 if there is no entry in the file.
       
    77 */
       
    78 EXPORT_C const TDesC8& CCalIter::NextL()
       
    79 	{
       
    80 	return iCalIteratorImpl->NextL();
       
    81 	}
       
    82