1 /* |
|
2 * Copyright (c) 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: Implementation of the class CPbkxRclSearchEngine. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "emailtrace.h" |
|
20 #include "cpbkxrclsearchengine.h" |
|
21 #include "cpbkxrclprotocolenvimpl.h" |
|
22 #include "cpbkxremotecontactlookupprotocoladapter.h" |
|
23 #include "cpbkxrclserviceuicontextimpl.h" |
|
24 #include "pbkxrclutils.h" |
|
25 |
|
26 // ======== MEMBER FUNCTIONS ======== |
|
27 |
|
28 // --------------------------------------------------------------------------- |
|
29 // CPbkxRclSearchEngine::CPbkxRclSearchEngine |
|
30 // --------------------------------------------------------------------------- |
|
31 // |
|
32 CPbkxRclSearchEngine::CPbkxRclSearchEngine() |
|
33 { |
|
34 FUNC_LOG; |
|
35 } |
|
36 |
|
37 // --------------------------------------------------------------------------- |
|
38 // CPbkxRclSearchEngine::ConstructL |
|
39 // --------------------------------------------------------------------------- |
|
40 // |
|
41 void CPbkxRclSearchEngine::ConstructL() |
|
42 { |
|
43 FUNC_LOG; |
|
44 iEnvironment = CPbkxRclProtocolEnvImpl::NewL(); |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CPbkxRclSearchEngine::NewL |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 EXPORT_C CPbkxRclSearchEngine* CPbkxRclSearchEngine::NewL() |
|
52 { |
|
53 FUNC_LOG; |
|
54 CPbkxRclSearchEngine* self = CPbkxRclSearchEngine::NewLC(); |
|
55 CleanupStack::Pop( self ); |
|
56 return self; |
|
57 } |
|
58 |
|
59 // --------------------------------------------------------------------------- |
|
60 // CPbkxRclSearchEngine::NewLC |
|
61 // --------------------------------------------------------------------------- |
|
62 // |
|
63 EXPORT_C CPbkxRclSearchEngine* CPbkxRclSearchEngine::NewLC() |
|
64 { |
|
65 FUNC_LOG; |
|
66 CPbkxRclSearchEngine* self = new( ELeave ) CPbkxRclSearchEngine; |
|
67 CleanupStack::PushL( self ); |
|
68 self->ConstructL(); |
|
69 return self; |
|
70 } |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // CPbkxRclSearchEngine::~CPbkxRclSearchEngine |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 CPbkxRclSearchEngine::~CPbkxRclSearchEngine() |
|
77 { |
|
78 FUNC_LOG; |
|
79 delete iEnvironment; |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // CPbkxRclSearchEngine::DefaultAccountIdL |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 TPbkxRemoteContactLookupProtocolAccountId CPbkxRclSearchEngine::DefaultAccountIdL() const |
|
87 { |
|
88 FUNC_LOG; |
|
89 return PbkxRclUtils::DefaultProtocolAccountIdL(); |
|
90 } |
|
91 |
|
92 // --------------------------------------------------------------------------- |
|
93 // CPbkxRclSearchEngine::NewAccountL |
|
94 // --------------------------------------------------------------------------- |
|
95 // |
|
96 CPbkxRemoteContactLookupProtocolAccount* CPbkxRclSearchEngine::NewAccountL( |
|
97 const TPbkxRemoteContactLookupProtocolAccountId& aId ) const |
|
98 { |
|
99 FUNC_LOG; |
|
100 CPbkxRemoteContactLookupProtocolAdapter* adapter = CreateAdapterLC( aId ); |
|
101 CPbkxRemoteContactLookupProtocolAccount* account = adapter->NewProtocolAccountL( aId ); |
|
102 CleanupStack::PopAndDestroy( adapter ); |
|
103 return account; |
|
104 } |
|
105 |
|
106 // --------------------------------------------------------------------------- |
|
107 // CPbkxRclSearchEngine::NewContextL |
|
108 // --------------------------------------------------------------------------- |
|
109 // |
|
110 CPbkxRemoteContactLookupServiceUiContext* CPbkxRclSearchEngine::NewContextL( |
|
111 TContextParams& aParams ) const |
|
112 { |
|
113 FUNC_LOG; |
|
114 CPbkxRclServiceUiContextImpl* context = CPbkxRclServiceUiContextImpl::NewL( |
|
115 aParams.iProtocolAccountId, |
|
116 aParams.iMode ); |
|
117 return context; |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // CPbkxRclSearchEngine::CreateAdapterLC |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 CPbkxRemoteContactLookupProtocolAdapter* CPbkxRclSearchEngine::CreateAdapterLC( |
|
125 const TPbkxRemoteContactLookupProtocolAccountId& aId ) const |
|
126 { |
|
127 FUNC_LOG; |
|
128 CPbkxRemoteContactLookupProtocolAdapter* adapter = |
|
129 CPbkxRemoteContactLookupProtocolAdapter::NewL( |
|
130 aId.iProtocolUid, |
|
131 *iEnvironment ); |
|
132 CleanupStack::PushL( adapter ); |
|
133 return adapter; |
|
134 } |
|
135 |
|