|
1 /* |
|
2 * Copyright (c) 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: Implementation of CPEContactExtensionWrapper class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "cpecontactextensionwrapper.h" |
|
20 |
|
21 |
|
22 // ======== MEMBER FUNCTIONS ======== |
|
23 |
|
24 // --------------------------------------------------------------------------- |
|
25 // CPEContactExtensionWrapper::CPEContactExtensionWrapper |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 CPEContactExtensionWrapper::CPEContactExtensionWrapper( |
|
29 TUid aImplementationUid ) |
|
30 : |
|
31 iPluginUid( aImplementationUid ) |
|
32 { |
|
33 |
|
34 } |
|
35 |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // CPEContactExtensionWrapper::ConstructL |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void CPEContactExtensionWrapper::ConstructL() |
|
42 { |
|
43 iPlugin = CreateContactExtensionL(); |
|
44 } |
|
45 |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CPEContactExtensionWrapper::NewL |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CPEContactExtensionWrapper* CPEContactExtensionWrapper::NewL( |
|
52 TUid aImplementationUid ) |
|
53 { |
|
54 CPEContactExtensionWrapper* self = |
|
55 CPEContactExtensionWrapper::NewLC( aImplementationUid ); |
|
56 CleanupStack::Pop( self ); |
|
57 return self; |
|
58 } |
|
59 |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // CPEContactExtensionWrapper::NewLC |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 CPEContactExtensionWrapper* CPEContactExtensionWrapper::NewLC( |
|
66 TUid aImplementationUid ) |
|
67 { |
|
68 CPEContactExtensionWrapper* self = |
|
69 new( ELeave ) CPEContactExtensionWrapper( aImplementationUid ); |
|
70 CleanupStack::PushL( self ); |
|
71 self->ConstructL(); |
|
72 return self; |
|
73 } |
|
74 |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // CPEContactExtensionWrapper::~CPEContactExtensionWrapper |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 CPEContactExtensionWrapper::~CPEContactExtensionWrapper() |
|
81 { |
|
82 delete iPlugin; |
|
83 } |
|
84 |
|
85 |
|
86 // --------------------------------------------------------------------------- |
|
87 // CPEContactExtensionWrapper::MatchByUid |
|
88 // --------------------------------------------------------------------------- |
|
89 // |
|
90 TBool CPEContactExtensionWrapper::MatchByUid( |
|
91 const TUid* aKey, const CPEContactExtensionWrapper& aWrapper ) |
|
92 { |
|
93 if ( aKey ) |
|
94 { |
|
95 return ( aWrapper.Identifier() == *aKey ); |
|
96 } |
|
97 else |
|
98 { |
|
99 return EFalse; |
|
100 } |
|
101 } |
|
102 |
|
103 |
|
104 // --------------------------------------------------------------------------- |
|
105 // From class CTelMatchingExtension. |
|
106 // --------------------------------------------------------------------------- |
|
107 // |
|
108 void CPEContactExtensionWrapper::InitializeL( |
|
109 TUint aServiceId, const TDesC& aOrigAddress ) |
|
110 { |
|
111 iPlugin->InitializeL( aServiceId, aOrigAddress ); |
|
112 } |
|
113 |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // From class CTelMatchingExtension. |
|
117 // --------------------------------------------------------------------------- |
|
118 // |
|
119 TInt CPEContactExtensionWrapper::GetAddressForMatching( |
|
120 RBuf& aParsedAddress, TInt& aMeaningfulDigits ) |
|
121 { |
|
122 return iPlugin->GetAddressForMatching( aParsedAddress, aMeaningfulDigits ); |
|
123 } |
|
124 |
|
125 |
|
126 // --------------------------------------------------------------------------- |
|
127 // From class CTelMatchingExtension. |
|
128 // --------------------------------------------------------------------------- |
|
129 // |
|
130 TInt CPEContactExtensionWrapper::GetContactStoreUris( CDesCArray& aStoreUris ) |
|
131 { |
|
132 return iPlugin->GetContactStoreUris( aStoreUris ); |
|
133 } |
|
134 |
|
135 |
|
136 // --------------------------------------------------------------------------- |
|
137 // From class CTelMatchingExtension. |
|
138 // --------------------------------------------------------------------------- |
|
139 // |
|
140 TInt CPEContactExtensionWrapper::GetRemotePartyName( RBuf& aRemotePartyName ) |
|
141 { |
|
142 return iPlugin->GetRemotePartyName( aRemotePartyName ); |
|
143 } |
|
144 |
|
145 |
|
146 // --------------------------------------------------------------------------- |
|
147 // CPEContactExtensionWrapper::CreateContactExtensionL |
|
148 // Needed for testing with mock technique. |
|
149 // --------------------------------------------------------------------------- |
|
150 // |
|
151 CTelMatchingExtension* |
|
152 CPEContactExtensionWrapper::CreateContactExtensionL() const |
|
153 { |
|
154 return CTelMatchingExtension::NewL( iPluginUid ); |
|
155 } |
|
156 |
|
157 |
|
158 // --------------------------------------------------------------------------- |
|
159 // CPEContactExtensionWrapper::Identifier |
|
160 // --------------------------------------------------------------------------- |
|
161 // |
|
162 TUid CPEContactExtensionWrapper::Identifier() const |
|
163 { |
|
164 return iPluginUid; |
|
165 } |