|
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: Remote Contact Lookup Extension setting control |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "emailtrace.h" |
|
21 #include <coecntrl.h> |
|
22 #include <aknsettingitemlist.h> |
|
23 #include <pbk2remotecontactlookupfactory.h> |
|
24 #include <pbk2rclsettingres.rsg> |
|
25 #include "cfscrclsettingcontrol.h" |
|
26 |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CFscRclSettingControl::CFscRclSettingControl |
|
29 // C++ default constructor can NOT contain any code, that might leave. |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CFscRclSettingControl::CFscRclSettingControl() |
|
33 { |
|
34 FUNC_LOG; |
|
35 // No implementation required |
|
36 } |
|
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // CFscRclSettingControl::ConstructL |
|
40 // Actual constructor. |
|
41 // ---------------------------------------------------------------------------- |
|
42 // |
|
43 void CFscRclSettingControl::ConstructL() |
|
44 { |
|
45 FUNC_LOG; |
|
46 ConstructFromResourceL( R_RCL_SETTING_LIST ); |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CFscRclSettingControl::NewLC |
|
51 // CFscRclSettingControl two-phased constructor. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 CFscRclSettingControl* CFscRclSettingControl::NewLC() |
|
55 { |
|
56 FUNC_LOG; |
|
57 CFscRclSettingControl* self = new (ELeave)CFscRclSettingControl(); |
|
58 CleanupStack::PushL(self); |
|
59 self->ConstructL(); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CFscRclSettingControl::NewL |
|
65 // CFscRclSettingControl two-phased constructor. |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CFscRclSettingControl* CFscRclSettingControl::NewL() |
|
69 { |
|
70 FUNC_LOG; |
|
71 CFscRclSettingControl* self = CFscRclSettingControl::NewLC(); |
|
72 CleanupStack::Pop(self); |
|
73 return self; |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CFscRclSettingControl::~CFscRclSettingControl |
|
78 // CFscRclSettingControl Destructor |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 CFscRclSettingControl::~CFscRclSettingControl() |
|
82 { |
|
83 FUNC_LOG; |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // MPbk2SettingsControlExtension implementation |
|
88 // ----------------------------------------------------------------------------- |
|
89 // CFscRclSettingControl::ModifySettingItemListL |
|
90 // Adds RCL settings top item into the Phonebook2 settings list |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 void CFscRclSettingControl::ModifySettingItemListL( |
|
94 CAknSettingItemList& aSettingItemList ) |
|
95 { |
|
96 FUNC_LOG; |
|
97 // Get Phonebook2 settings list |
|
98 CAknSettingItemArray *pbk2settings = aSettingItemList.SettingItemArray(); |
|
99 |
|
100 // try to add Remote Contact Lookup setting item |
|
101 // if adding fails, continue without rcl setting item |
|
102 TRAP_IGNORE( |
|
103 { |
|
104 iRclSettingItem = Pbk2RemoteContactLookupFactory::NewDefaultProtocolAccountSelectorSettingItemL(); |
|
105 |
|
106 pbk2settings->AppendL( iRclSettingItem ); |
|
107 pbk2settings->RecalculateVisibleIndicesL(); |
|
108 iRclSettingItem->SetHidden( EFalse ); |
|
109 }); |
|
110 } |
|
111 |
|
112 // ----------------------------------------------------------------------------- |
|
113 // CFscRclSettingControl::CreateSettingItemL |
|
114 // Creates settings item |
|
115 // ----------------------------------------------------------------------------- |
|
116 // |
|
117 CAknSettingItem* CFscRclSettingControl::CreateSettingItemL(TInt /*aSettingId*/) |
|
118 { |
|
119 FUNC_LOG; |
|
120 return iRclSettingItem; |
|
121 } |
|
122 |
|
123 // ----------------------------------------------------------------------------- |
|
124 // MPbk2UiReleasable implementation |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CFscRclSettingControl::DoRelease |
|
127 // Release this |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 void CFscRclSettingControl::DoRelease() |
|
131 { |
|
132 FUNC_LOG; |
|
133 delete this; |
|
134 } |
|
135 |
|
136 // End of File |
|
137 |