|
1 /* |
|
2 * Copyright (c) 2006 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: Dialog for advanced settings for plugin base. |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <avkon.hrh> |
|
19 #include <eikdef.h> |
|
20 #include <eikenv.h> |
|
21 #include <eikedwin.h> |
|
22 #include <cmmanager.rsg> |
|
23 #include <data_caging_path_literals.hrh> |
|
24 #include <aknnavide.h> |
|
25 #include <akntitle.h> |
|
26 #include <eikmenup.h> |
|
27 #include <StringLoader.h> |
|
28 #include <akntextsettingpage.h> |
|
29 #include <cmconnectionmethoddef.h> |
|
30 |
|
31 #include <mcmdexec.h> |
|
32 #include <cmpbasesettingsdlgadv.h> |
|
33 #include "cmpluginmenucommands.hrh" |
|
34 #include "cmmanager.hrh" |
|
35 |
|
36 using namespace CMManager; |
|
37 |
|
38 enum TSMTPSettingIds |
|
39 { |
|
40 EPluginBaseCmCmdSmtp |
|
41 }; |
|
42 |
|
43 // -------------------------------------------------------------------------- |
|
44 // CmPluginBaseSettingsDlgAdv::CmPluginBaseSettingsDlgAdv() |
|
45 // -------------------------------------------------------------------------- |
|
46 // |
|
47 EXPORT_C CmPluginBaseSettingsDlgAdv::CmPluginBaseSettingsDlgAdv( |
|
48 CCmPluginBaseEng& aCmPluginBase ) |
|
49 : CmPluginBaseSettingsDlg( aCmPluginBase ) |
|
50 { |
|
51 } |
|
52 |
|
53 // -------------------------------------------------------------------------- |
|
54 // CmPluginBaseSettingsDlgAdv::~CmPluginBaseSettingsDlgAdv |
|
55 // Destructor |
|
56 // -------------------------------------------------------------------------- |
|
57 // |
|
58 EXPORT_C CmPluginBaseSettingsDlgAdv::~CmPluginBaseSettingsDlgAdv() |
|
59 { |
|
60 } |
|
61 |
|
62 // -------------------------------------------------------------------------- |
|
63 // CmPluginBaseSettingsDlgAdv::DynInitMenuPaneL |
|
64 // -------------------------------------------------------------------------- |
|
65 // |
|
66 EXPORT_C void CmPluginBaseSettingsDlgAdv::DynInitMenuPaneL( |
|
67 TInt aResourceId, |
|
68 CEikMenuPane* aMenuPane ) |
|
69 { |
|
70 CmPluginBaseSettingsDlg::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
71 if ( aResourceId == R_PLUGIN_BASE_MENU ) |
|
72 { |
|
73 aMenuPane->SetItemDimmed( EPluginBaseCmdAdvanced, ETrue ); |
|
74 } |
|
75 } |
|
76 |
|
77 // -------------------------------------------------------------------------- |
|
78 // CmPluginBaseSettingsDlgAdv::UpdateListBoxContentBearerSpecificL |
|
79 // -------------------------------------------------------------------------- |
|
80 // |
|
81 void CmPluginBaseSettingsDlgAdv::UpdateListBoxContentBearerSpecificL( |
|
82 CDesCArray& /*aItemArray*/ ) |
|
83 { |
|
84 // Empty implementation - forced by inheritance |
|
85 } |
|
86 |
|
87 // -------------------------------------------------------------------------- |
|
88 // CmPluginBaseSettingsDlgAdv::RunAdvancedSettingsL |
|
89 // -------------------------------------------------------------------------- |
|
90 // |
|
91 EXPORT_C void CmPluginBaseSettingsDlgAdv::RunAdvancedSettingsL() |
|
92 { |
|
93 // Empty implementation. This function has no meaning here |
|
94 } |
|
95 |
|
96 // -------------------------------------------------------------------------- |
|
97 // CmPluginBaseSettingsDlgAdv::UpdateListBoxContentL |
|
98 // -------------------------------------------------------------------------- |
|
99 // |
|
100 EXPORT_C void CmPluginBaseSettingsDlgAdv::UpdateListBoxContentL() |
|
101 { |
|
102 // Must save listbox indexes because content will be deleted |
|
103 TInt lastListBoxPos = iListbox->CurrentItemIndex(); |
|
104 TInt lastListBoxTopPos = iListbox->TopItemIndex(); |
|
105 |
|
106 // deleting listbox content |
|
107 MDesCArray* itemList = iListbox->Model()->ItemTextArray(); |
|
108 CDesCArray* itemArray = (CDesCArray*)itemList; |
|
109 while ( itemArray->Count() ) |
|
110 { |
|
111 itemArray->Delete( 0 ); |
|
112 } |
|
113 while ( iSettingIndex->Count() ) |
|
114 { |
|
115 iSettingIndex->Delete( 0 ); |
|
116 } |
|
117 |
|
118 UpdateListBoxContentBearerSpecificL( *itemArray ); |
|
119 |
|
120 // Handle content changes |
|
121 iListbox->Reset(); |
|
122 |
|
123 iListbox->HandleItemAdditionL(); |
|
124 |
|
125 // Listbox might not have index |
|
126 if ( lastListBoxPos != -1 ) |
|
127 { |
|
128 iListbox->SetCurrentItemIndex( lastListBoxPos ); |
|
129 iListbox->SetTopItemIndex( lastListBoxTopPos ); |
|
130 } |
|
131 // Draw it |
|
132 iListbox->DrawNow(); |
|
133 } |
|
134 |
|
135 //--------------------------------------------------------------------------- |
|
136 // CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL |
|
137 //--------------------------------------------------------------------------- |
|
138 // |
|
139 EXPORT_C TBool CmPluginBaseSettingsDlgAdv::ShowPopupSettingPageL( |
|
140 TInt aAttribute, TInt aCommandId ) |
|
141 { |
|
142 TBool retval( EFalse ); |
|
143 |
|
144 switch ( aAttribute ) |
|
145 { |
|
146 case EPluginBaseCmCmdSmtp: |
|
147 { |
|
148 // Show the SMTP settings page |
|
149 User::Leave( KErrNotSupported ); |
|
150 break; |
|
151 } |
|
152 default: |
|
153 { |
|
154 CmPluginBaseSettingsDlg::ProcessCommandL( aCommandId ); |
|
155 break; |
|
156 } |
|
157 } |
|
158 return retval; |
|
159 } |