|
1 /* |
|
2 * Copyright (c) 2008-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: Implementation of class CESMRContactLinkIterator. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "emailtrace.h" |
|
20 #include "cesmrcontactlinkiterator.h" |
|
21 #include <mvpbkcontactlinkarray.h> |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // CESMRContactLinkIterator::NewL( ) |
|
27 // --------------------------------------------------------------------------- |
|
28 // |
|
29 CESMRContactLinkIterator* CESMRContactLinkIterator::NewL( ) |
|
30 { |
|
31 FUNC_LOG; |
|
32 CESMRContactLinkIterator* self = new (ELeave) CESMRContactLinkIterator(); |
|
33 return self; |
|
34 } |
|
35 |
|
36 // --------------------------------------------------------------------------- |
|
37 // CESMRContactLinkIterator::~CESMRContactLinkIterator( ) |
|
38 // --------------------------------------------------------------------------- |
|
39 // |
|
40 CESMRContactLinkIterator::~CESMRContactLinkIterator( ) |
|
41 { |
|
42 FUNC_LOG; |
|
43 delete iContactLinkArray; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // CESMRContactLinkIterator::SetContactLinkArray |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 void CESMRContactLinkIterator::SetContactLinkArray( |
|
51 MVPbkContactLinkArray* aContactLinkArray ) |
|
52 { |
|
53 FUNC_LOG; |
|
54 delete iContactLinkArray; |
|
55 iContactLinkArray = aContactLinkArray; |
|
56 iContactLinkArrayIndex = 0; |
|
57 } |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // CESMRContactLinkIterator::ContactCount |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 TInt CESMRContactLinkIterator::ContactCount() const |
|
64 { |
|
65 FUNC_LOG; |
|
66 TInt count( KErrNotFound ); |
|
67 if ( iContactLinkArray ) |
|
68 { |
|
69 count = iContactLinkArray->Count(); |
|
70 } |
|
71 return count; |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------------------------- |
|
75 // CESMRContactLinkIterator::HasNextContact |
|
76 // --------------------------------------------------------------------------- |
|
77 // |
|
78 TBool CESMRContactLinkIterator::HasNextContact() const |
|
79 { |
|
80 FUNC_LOG; |
|
81 return iContactLinkArrayIndex < ContactCount(); |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------------------------- |
|
85 // CESMRContactLinkIterator::NextContactL |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 MVPbkContactLink* CESMRContactLinkIterator::NextContactL() |
|
89 { |
|
90 FUNC_LOG; |
|
91 MVPbkContactLink* link = NULL; |
|
92 if ( iContactLinkArray ) |
|
93 { |
|
94 link = (MVPbkContactLink*) |
|
95 &(iContactLinkArray->At( iContactLinkArrayIndex++ )); |
|
96 } |
|
97 |
|
98 return link; |
|
99 } |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // CESMRContactLinkIterator::SetToFirstContact( ) |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 void CESMRContactLinkIterator::SetToFirstContact( ) |
|
106 { |
|
107 FUNC_LOG; |
|
108 iContactLinkArrayIndex = 0; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CESMRContactLinkIterator::GroupCount( ) |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 TInt CESMRContactLinkIterator::GroupCount( ) const |
|
116 { |
|
117 FUNC_LOG; |
|
118 return 0; |
|
119 } |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // CESMRContactLinkIterator::HasNextGroup( ) |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 TBool CESMRContactLinkIterator::HasNextGroup( ) const |
|
126 { |
|
127 FUNC_LOG; |
|
128 return EFalse; |
|
129 } |
|
130 |
|
131 // --------------------------------------------------------------------------- |
|
132 // CESMRContactLinkIterator::NextGroupL( ) |
|
133 // --------------------------------------------------------------------------- |
|
134 // |
|
135 MVPbkContactLink* CESMRContactLinkIterator::NextGroupL( ) |
|
136 { |
|
137 FUNC_LOG; |
|
138 return NULL; |
|
139 } |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // CESMRContactLinkIterator::SetToFirstGroup( ) |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 void CESMRContactLinkIterator::SetToFirstGroup( ) |
|
146 { |
|
147 FUNC_LOG; |
|
148 //Do nothing |
|
149 } |
|
150 |
|
151 // --------------------------------------------------------------------------- |
|
152 // CESMRContactLinkIterator::CESMRContactLinkIterator( ) |
|
153 // --------------------------------------------------------------------------- |
|
154 // |
|
155 CESMRContactLinkIterator::CESMRContactLinkIterator( ) |
|
156 { |
|
157 FUNC_LOG; |
|
158 //Do nothing |
|
159 } |
|
160 |
|
161 // End of file |
|
162 |