|
1 /* |
|
2 * Copyright (c) 2005-2009 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 CSecModUIViewCode class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "secmodui.hrh" |
|
21 #include "SecModUIViewCode.h" |
|
22 #include "SecModUIContainerCode.h" |
|
23 #include "SecModUIModel.h" |
|
24 #include "SecModUILogger.h" |
|
25 #include "SecModUISyncWrapper.h" |
|
26 #include <aknViewAppUi.h> |
|
27 #include <avkon.hrh> |
|
28 #include <aknlists.h> |
|
29 #include <SecModUI.rsg> |
|
30 |
|
31 // ================= MEMBER FUNCTIONS ======================= |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CSecModUIViewCode::CSecModUIViewCode |
|
35 // C++ default constructor can NOT contain any code, that |
|
36 // might leave. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 CSecModUIViewCode::CSecModUIViewCode(CSecModUIModel& aModel):CSecModUIViewBase(aModel) |
|
40 { |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // CSecModUIViewCode::ConstructL(const TRect& aRect) |
|
45 // EPOC two-phased constructor |
|
46 // --------------------------------------------------------- |
|
47 // |
|
48 void CSecModUIViewCode::ConstructL() |
|
49 { |
|
50 LOG_ENTERFN("CSecModUIViewCode::ConstructL()"); |
|
51 BaseConstructL( R_SECMODUI_VIEW_CODE ); |
|
52 LOG_LEAVEFN("CSecModUIViewCode::ConstructL()"); |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------- |
|
56 // CSecModUIViewCode::~CSecModUIViewCode() |
|
57 // destructor |
|
58 // --------------------------------------------------------- |
|
59 // |
|
60 CSecModUIViewCode::~CSecModUIViewCode() |
|
61 { |
|
62 LOG_ENTERFN("CSecModUIViewCode::~CSecModUIViewCode()"); |
|
63 LOG_LEAVEFN("CSecModUIViewCode::~CSecModUIViewCode()"); |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CSecModUIViewCode::NewLC |
|
68 // Two-phased constructor. |
|
69 // ----------------------------------------------------------------------------- |
|
70 // |
|
71 CSecModUIViewCode* CSecModUIViewCode::NewLC(CSecModUIModel& aModel) |
|
72 { |
|
73 LOG_ENTERFN("CSecModUIViewCode::NewLC()"); |
|
74 CSecModUIViewCode* self = new (ELeave) CSecModUIViewCode(aModel); |
|
75 CleanupStack::PushL(self); |
|
76 self->ConstructL(); |
|
77 LOG_LEAVEFN("CSecModUIViewCode::NewLC()"); |
|
78 return self; |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------- |
|
82 // TUid CSecModUIViewCode::Id() |
|
83 // |
|
84 // --------------------------------------------------------- |
|
85 // |
|
86 TUid CSecModUIViewCode::Id() const |
|
87 { |
|
88 return KSecModUIViewCodeId; |
|
89 } |
|
90 |
|
91 // --------------------------------------------------------- |
|
92 // TUid CSecModUIViewCode::CreateContainerL() |
|
93 // Creates container |
|
94 // --------------------------------------------------------- |
|
95 // |
|
96 void CSecModUIViewCode::CreateContainerL() |
|
97 { |
|
98 LOG_ENTERFN("CSecModUIViewCode::CreateContainerL()"); |
|
99 iContainer = new (ELeave) CSecModUIContainerCode(iModel); |
|
100 LOG_LEAVEFN("CSecModUIViewCode::CreateContainerL()"); |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------- |
|
104 // CSecModUIViewCode::HandleCommandL(TInt aCommand) |
|
105 // takes care of view command handling |
|
106 // --------------------------------------------------------- |
|
107 // |
|
108 void CSecModUIViewCode::HandleCommandL(TInt aCommand) |
|
109 { |
|
110 LOG_ENTERFN("CSecModUIViewCode::HandleCommandL()"); |
|
111 if (iModel.Wrapper().IsActive()) |
|
112 { |
|
113 return; |
|
114 } |
|
115 switch ( aCommand ) |
|
116 { |
|
117 case ESecModUICmdOpen: |
|
118 { |
|
119 iModel.OpenAuthObjViewL(iContainer->ListBox().CurrentItemIndex()); |
|
120 break; |
|
121 } |
|
122 case ESecModUICmdModuleInfo: |
|
123 { |
|
124 iModel.ViewOpenedSecModDetailsL(); |
|
125 break; |
|
126 } |
|
127 case EAknSoftkeyOpen: |
|
128 { |
|
129 iModel.OpenAuthObjViewL(iContainer->ListBox().CurrentItemIndex()); |
|
130 break; |
|
131 } |
|
132 default: |
|
133 { |
|
134 CSecModUIViewBase::HandleCommandL(aCommand); |
|
135 break; |
|
136 } |
|
137 } |
|
138 LOG_LEAVEFN("CSecModUIViewCode::HandleCommandL()"); |
|
139 } |
|
140 |
|
141 |
|
142 |
|
143 // --------------------------------------------------------- |
|
144 // CSecModUIViewBase::DoActivateL(...) |
|
145 // |
|
146 // --------------------------------------------------------- |
|
147 // |
|
148 /*void CSecModUIViewCode::DoActivateL( |
|
149 const TVwsViewId& aPrevViewId,TUid aCustomMessageId, |
|
150 const TDesC8& aCustomMessage) |
|
151 { |
|
152 LOG_ENTERFN("CSecModUIViewCode::DoActivateL()"); |
|
153 if (KNullUid == iPrevViewId.iViewUid) |
|
154 { |
|
155 iPrevViewId = aPrevViewId; |
|
156 } |
|
157 SetTitlePaneL(); |
|
158 AddNaviPaneLabelL(); |
|
159 |
|
160 if (aPrevViewId.iViewUid == KSecModUIViewMainId) |
|
161 { |
|
162 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
163 delete iContainer; |
|
164 iContainer = NULL; |
|
165 } |
|
166 |
|
167 if (!iContainer) |
|
168 { |
|
169 CreateContainerL(); |
|
170 iContainer->SetMopParent(this); |
|
171 iContainer->ConstructL(ClientRect()); |
|
172 iContainer->ListBox().SetListBoxObserver(this); |
|
173 } |
|
174 AppUi()->AddToStackL(*this, iContainer); |
|
175 iContainer->MakeVisible(ETrue); |
|
176 iContainer->SetRect(ClientRect()); |
|
177 iContainer->ActivateL(); |
|
178 |
|
179 LOG_LEAVEFN("CSecModUIViewCode::DoActivateL()"); |
|
180 }*/ |
|
181 |
|
182 // --------------------------------------------------------- |
|
183 // CSecModUIViewBase::DoDeactivate() |
|
184 // |
|
185 // --------------------------------------------------------- |
|
186 // |
|
187 /*void CSecModUIViewCode::DoDeactivate() |
|
188 { |
|
189 LOG_ENTERFN("CSecModUIViewCode::DoDeactivate()"); |
|
190 if ( iContainer ) |
|
191 { |
|
192 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
193 } |
|
194 |
|
195 LOG_LEAVEFN("CSecModUIViewCode::DoDeactivate()"); |
|
196 }*/ |
|
197 |
|
198 // --------------------------------------------------------- |
|
199 // CSecModUIViewCode::HandleListBoxEventL( |
|
200 // CEikListBox* aListBox, TListBoxEvent aEventType) |
|
201 // --------------------------------------------------------- |
|
202 // |
|
203 void CSecModUIViewCode::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) |
|
204 { |
|
205 LOG_ENTERFN("CSecModUIViewCode::HandleListBoxEventL()"); |
|
206 if(iModel.Wrapper().IsActive()) |
|
207 { |
|
208 return; |
|
209 } |
|
210 |
|
211 switch( aEventType ) |
|
212 { |
|
213 case EEventEnterKeyPressed: |
|
214 case EEventItemDoubleClicked: |
|
215 case EEventItemSingleClicked: |
|
216 { |
|
217 iModel.OpenAuthObjViewL(aListBox->CurrentItemIndex()); |
|
218 break; |
|
219 } |
|
220 default: |
|
221 { |
|
222 break; |
|
223 } |
|
224 } |
|
225 LOG_LEAVEFN("CSecModUIViewCode::HandleListBoxEventL()"); |
|
226 } |
|
227 |
|
228 // End of File |