author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:15:33 +0300 | |
branch | RCL_3 |
changeset 85 | 38bb213f60ba |
parent 63 | f4a778e096c2 |
permissions | -rw-r--r-- |
63 | 1 |
/* |
2 |
* Copyright (c) 2002-2007 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: An API for sim contacts |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
// INCLUDE FILES |
|
21 |
#include "CVPbkSimContactBase.h" |
|
22 |
||
23 |
#include "MVPbkSimCntStore.h" |
|
24 |
#include "CVPbkSimCntField.h" |
|
25 |
#include <RVPbkStreamedIntArray.h> |
|
26 |
||
27 |
// ============================ MEMBER FUNCTIONS =============================== |
|
28 |
||
29 |
// ----------------------------------------------------------------------------- |
|
30 |
// CVPbkSimContactBase::CVPbkSimContactBase |
|
31 |
// C++ default constructor can NOT contain any code, that |
|
32 |
// might leave. |
|
33 |
// ----------------------------------------------------------------------------- |
|
34 |
// |
|
35 |
CVPbkSimContactBase::CVPbkSimContactBase( MVPbkSimCntStore& aStore ) |
|
36 |
: iStore( aStore ) |
|
37 |
{ |
|
38 |
} |
|
39 |
||
40 |
// ----------------------------------------------------------------------------- |
|
41 |
// CVPbkSimContactBase::ParentStore |
|
42 |
// ----------------------------------------------------------------------------- |
|
43 |
// |
|
44 |
MVPbkSimCntStore& CVPbkSimContactBase::ParentStore() const |
|
45 |
{ |
|
46 |
return iStore; |
|
47 |
} |
|
48 |
||
49 |
// ----------------------------------------------------------------------------- |
|
50 |
// CVPbkSimContactBase::DeleteL |
|
51 |
// ----------------------------------------------------------------------------- |
|
52 |
// |
|
53 |
MVPbkSimStoreOperation* CVPbkSimContactBase::DeleteL( |
|
54 |
MVPbkSimContactObserver& aObserver ) |
|
55 |
{ |
|
56 |
RVPbkStreamedIntArray indexArray; |
|
57 |
CleanupClosePushL( indexArray ); |
|
58 |
indexArray.AppendIntL( SimIndex() ); |
|
59 |
MVPbkSimStoreOperation* op = iStore.DeleteL( indexArray, aObserver ); |
|
60 |
CleanupStack::PopAndDestroy(); // indexArray |
|
61 |
return op; |
|
62 |
} |
|
63 |
||
64 |
// ----------------------------------------------------------------------------- |
|
65 |
// CVPbkSimContactBase::FindField |
|
66 |
// ----------------------------------------------------------------------------- |
|
67 |
// |
|
68 |
MVPbkSimContact::TFieldLookup CVPbkSimContactBase::FindField( |
|
69 |
TVPbkSimCntFieldType aType ) const |
|
70 |
{ |
|
71 |
MVPbkSimContact::TFieldLookup lookup; |
|
72 |
lookup.SetType( aType ); |
|
73 |
const TInt firstPosition = 0; |
|
74 |
lookup.SetPos( firstPosition ); |
|
75 |
FindNextField( lookup ); |
|
76 |
return lookup; |
|
77 |
} |
|
78 |
||
79 |
// ----------------------------------------------------------------------------- |
|
80 |
// CVPbkSimContactBase::FindNextField |
|
81 |
// ----------------------------------------------------------------------------- |
|
82 |
// |
|
83 |
void CVPbkSimContactBase::FindNextField( |
|
84 |
MVPbkSimContact::TFieldLookup& aLookup ) const |
|
85 |
{ |
|
86 |
const TInt count = FieldCount(); |
|
87 |
TInt i = aLookup.Pos(); |
|
88 |
aLookup.SetPos( KErrNotFound ); |
|
89 |
for ( ; i < count; ++i ) |
|
90 |
{ |
|
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
91 |
if ( ConstFieldAt( i ).Type() == aLookup.Type() ) |
63 | 92 |
{ |
85
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
93 |
aLookup.SetIndex( i ); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
94 |
aLookup.SetPos( i + 1 ); |
38bb213f60ba
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
63
diff
changeset
|
95 |
break; |
63 | 96 |
} |
97 |
} |
|
98 |
} |
|
99 |
// End of File |