|
1 // Copyright (c) 2007-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 #ifndef __CALINSTANCEITERATOR_H__ |
|
17 #define __CALINSTANCEITERATOR_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 |
|
21 class CCalSessionImpl; |
|
22 class CCalInstance; |
|
23 class CAgnEntry; |
|
24 class TAgnInstanceId; |
|
25 class TCalTime; |
|
26 class CCalInstanceViewImpl; |
|
27 |
|
28 /** A calendar instance iterator |
|
29 |
|
30 This class defines an interface for iterating through calendar instances |
|
31 and can be created by calling the appropriate methods on CCalInstanceView. |
|
32 Please see the coments on those APIs for the details of which instances |
|
33 will be iterated though. |
|
34 |
|
35 @publishedPartner |
|
36 @released |
|
37 */ |
|
38 class CCalInstanceIterator : public CBase |
|
39 { |
|
40 public: |
|
41 IMPORT_C ~CCalInstanceIterator(); |
|
42 |
|
43 /** Fetches the next instance in the iterator. |
|
44 |
|
45 @return The next instance in the iterator or NULL if there are no more instances. |
|
46 This API returns ownership of the instance. |
|
47 |
|
48 @leave KErrNotFound If there is a problem creating the instance because the entry cannot be found. |
|
49 |
|
50 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
51 Otherwise any of the system-wide error codes. |
|
52 |
|
53 @publishedPartner |
|
54 @released |
|
55 @capability ReadUserData |
|
56 */ |
|
57 virtual CCalInstance* NextL() = 0; |
|
58 |
|
59 /** Fetches the previous instance in the iterator. |
|
60 |
|
61 @return The previous instance in the iterator or NULL if there are no more instances. |
|
62 This API returns ownership of the instance. |
|
63 |
|
64 @leave KErrNotFound If there is a problem creating the instance because the entry cannot be found. |
|
65 |
|
66 @leave KErrNotReady If the calendar file is on a drive where the media has been removed. |
|
67 Otherwise any of the system-wide error codes. |
|
68 |
|
69 @publishedPartner |
|
70 @released |
|
71 @capability ReadUserData |
|
72 */ |
|
73 virtual CCalInstance* PreviousL() = 0; |
|
74 |
|
75 /** Checks to see if there are any more results in the iterator to be returned by calling NextL. |
|
76 |
|
77 @return ETrue if there are more results, EFalse if not. |
|
78 |
|
79 @publishedPartner |
|
80 @released |
|
81 @capability None |
|
82 */ |
|
83 virtual TBool HasMore() const = 0; |
|
84 |
|
85 /** Returns the total number of instances the iterator will iterate through, including the starting instance if one was provided. |
|
86 |
|
87 Note that it is best to avoid using this API if possible because it will be slow |
|
88 to calculate the count, if the iterator contains a lot of instances. |
|
89 |
|
90 @return The number of instances found or, if there was a problem calculating the count, |
|
91 a system-wide error code. |
|
92 |
|
93 @publishedPartner |
|
94 @released |
|
95 @capability None |
|
96 */ |
|
97 virtual TInt Count() const = 0; |
|
98 |
|
99 protected: |
|
100 CCalInstanceIterator(const CCalInstanceViewImpl& aInstanceViewImpl); |
|
101 |
|
102 protected: |
|
103 const CCalInstanceViewImpl& iInstanceViewImpl; |
|
104 CCalSessionImpl& iSessionImpl; |
|
105 }; |
|
106 |
|
107 #endif // __CALINSTANCEITERATOR_H__ |