|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "MemSpyAppUi.h" |
|
19 |
|
20 // System includes |
|
21 #include <AknQueryDialog.h> |
|
22 #include <aknmessagequerydialog.h> |
|
23 #include <aknradiobuttonsettingpage.h> |
|
24 #include <eikaufty.h> |
|
25 #include <eikmenub.h> |
|
26 #include <avkon.hrh> |
|
27 #include <barsread.h> |
|
28 #include <f32file.h> |
|
29 #include <apgtask.h> |
|
30 #include <memspyui.rsg> |
|
31 |
|
32 // Engine includes |
|
33 #include <memspy/engine/memspyengine.h> |
|
34 #include <memspy/engine/memspyengineoutputsink.h> |
|
35 #include <memspy/engine/memspyengineobjectcontainer.h> |
|
36 #include <memspy/engine/memspyengineobjectprocess.h> |
|
37 #include <memspy/engine/memspyengineobjectthread.h> |
|
38 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h> |
|
39 #include <memspy/engine/memspyenginehelperchunk.h> |
|
40 #include <memspy/engine/memspyenginehelperthread.h> |
|
41 #include <memspy/engine/memspyenginehelperprocess.h> |
|
42 #include <memspy/engine/memspyenginehelperkernelcontainers.h> |
|
43 #include <memspy/engine/memspyenginehelperfbserv.h> |
|
44 #include <memspyengineclientinterface.h> |
|
45 #include <memspy/driver/memspydriverenumerationsshared.h> |
|
46 #include <memspy/engine/memspyenginehelperkernelcontainers.h> |
|
47 //cigasto |
|
48 #include <memspysession.h> |
|
49 |
|
50 // User includes |
|
51 #include "MemSpyContainer.h" |
|
52 #include "MemSpyDocument.h" |
|
53 #include "MemSpySettings.h" |
|
54 #include "MemSpyDeviceWideOperationDialog.h" |
|
55 #include "MemSpyViewRAMInfo.h" // for aknicon config check |
|
56 #include "MemSpyExportBitmapsToMemoryCardDialog.h" |
|
57 #include "MemSpy.hrh" |
|
58 #include "viewcli.h" |
|
59 |
|
60 // Constants |
|
61 const TInt KMemSpyDefaultAutoCaptureTimerPeriod = 60; |
|
62 const TUint32 KMemSpyEikSrvSID = 0x10003a4a; |
|
63 |
|
64 /* |
|
65 CMemSpyAppUi::CMemSpyAppUi( CMemSpyEngine& aEngine ) |
|
66 : iEngine( aEngine ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo ) |
|
67 { |
|
68 iEngine.SetObserver( this ); |
|
69 } |
|
70 */ |
|
71 CMemSpyAppUi::CMemSpyAppUi( RMemSpySession &aSession ) |
|
72 : iMemSpySession( aSession ), iAutoCaptureTimerPeriod( KMemSpyDefaultAutoCaptureTimerPeriod ), iAutoCaptureOperationType( CMemSpyDeviceWideOperations::EPerEntityHeapInfo ) |
|
73 { |
|
74 //iEngine.SetObserver( this ); |
|
75 } |
|
76 |
|
77 CMemSpyAppUi::~CMemSpyAppUi() |
|
78 { |
|
79 RDebug::Printf( "[MemSpy] MemSpy is now closing." ); |
|
80 // |
|
81 delete iAutoCaptureTimer; |
|
82 // |
|
83 if (iAppContainer) |
|
84 { |
|
85 RemoveFromStack( iAppContainer ); |
|
86 delete iAppContainer; |
|
87 } |
|
88 // |
|
89 //iEngine.SetObserver( NULL ); |
|
90 SetViewServerTimeOutStatus( ETrue ); |
|
91 } |
|
92 |
|
93 |
|
94 void CMemSpyAppUi::ConstructL() |
|
95 { |
|
96 BaseConstructL( EAknEnableSkin ); |
|
97 // |
|
98 //iAppContainer = new (ELeave) CMemSpyContainer( iEngine, *this ); |
|
99 iAppContainer = new (ELeave) CMemSpyContainer( iMemSpySession, *this ); |
|
100 iAppContainer->SetMopParent(this); |
|
101 iAppContainer->ConstructL( ClientRect() ); |
|
102 iAppContainer->SetObserver( this ); |
|
103 iAppContainer->SetFocus( ETrue ); |
|
104 AddToStackL( iAppContainer ); |
|
105 // |
|
106 iAutoCaptureTimer = CPeriodic::NewL( CActive::EPriorityIdle ); |
|
107 // |
|
108 iEikonEnv->SetSystem( ETrue ); |
|
109 // |
|
110 SetViewServerTimeOutStatus( EFalse ); |
|
111 } |
|
112 |
|
113 |
|
114 CMemSpyDocument& CMemSpyAppUi::MemSpyDocument() |
|
115 { |
|
116 CMemSpyDocument* doc = static_cast< CMemSpyDocument* >( Document() ); |
|
117 return *doc; |
|
118 } |
|
119 |
|
120 |
|
121 const CMemSpyDocument& CMemSpyAppUi::MemSpyDocument() const |
|
122 { |
|
123 const CMemSpyDocument* doc = static_cast< const CMemSpyDocument* >( Document() ); |
|
124 return *doc; |
|
125 } |
|
126 |
|
127 |
|
128 void CMemSpyAppUi::HandleStatusPaneSizeChange() |
|
129 { |
|
130 iAppContainer->SetRect( ClientRect() ); |
|
131 } |
|
132 |
|
133 |
|
134 void CMemSpyAppUi::HandleControlEventL( CCoeControl* aControl, TCoeEvent /*aEventType*/ ) |
|
135 { |
|
136 if ( aControl == iAppContainer ) |
|
137 { |
|
138 UpdateCBAL(); |
|
139 } |
|
140 } |
|
141 |
|
142 |
|
143 void CMemSpyAppUi::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
|
144 { |
|
145 CMemSpyViewBase& view = iAppContainer->ActiveView(); |
|
146 const TMemSpyViewType viewType = iAppContainer->ActiveViewType(); |
|
147 // |
|
148 const TBool openableView = MemSpyViewTypeUtils::IsOpenableItem( viewType ); |
|
149 const TBool exitable = MemSpyViewTypeUtils::IsExitableView( viewType ); |
|
150 // |
|
151 #ifdef _DEBUG |
|
152 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - START - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable ); |
|
153 #endif |
|
154 // |
|
155 if ( aResourceId == R_MEMSPY_MENUPANE ) |
|
156 { |
|
157 const TInt count = aMenuPane->NumberOfItemsInPane(); |
|
158 for( TInt i=0; i<count; i++ ) |
|
159 { |
|
160 TBool dimItem = EFalse; |
|
161 CEikMenuPaneItem::SData& menuPaneMetaData = aMenuPane->ItemDataByIndexL( i ); |
|
162 |
|
163 // If the command is inside the view-specific range then we'll hide it |
|
164 // unless the view and command id matches. |
|
165 const TBool isViewSpecific = ( menuPaneMetaData.iCommandId >= KMemSpyMenuCommandViewSpecific ); |
|
166 if ( isViewSpecific ) |
|
167 { |
|
168 // Check whether this view requires this command item. |
|
169 dimItem = ( view.MenuCascadeCommandId() != menuPaneMetaData.iCommandId ); |
|
170 } |
|
171 |
|
172 aMenuPane->SetItemDimmed( menuPaneMetaData.iCommandId, dimItem ); |
|
173 } |
|
174 |
|
175 aMenuPane->SetItemDimmed( EMemSpyCmdOpen, !openableView ); |
|
176 aMenuPane->SetItemDimmed( EAknSoftkeyBack, exitable ); |
|
177 aMenuPane->SetItemDimmed( EAknCmdExit, !exitable ); |
|
178 } |
|
179 else if ( aResourceId == R_MEMSPY_MENUPANE_TOOLS ) |
|
180 { |
|
181 const TBool inOpenFilesView = ( viewType == EMemSpyViewTypeOpenFiles ); |
|
182 aMenuPane->SetItemDimmed( EMemSpyCmdToolsListOpenFiles, !inOpenFilesView ); |
|
183 } |
|
184 else if ( aResourceId == R_MEMSPY_MENUPANE_VIEW ) |
|
185 { |
|
186 // Hide the refresh item when in the thread info container view |
|
187 aMenuPane->SetItemDimmed( EMemSpyCmdViewRefresh, viewType == EMemSpyViewTypeThreadInfoItemList ); |
|
188 aMenuPane->SetItemDimmed( EMemSpyCmdViewOutputToSink, viewType == EMemSpyViewTypeThreadInfoItemList ); |
|
189 } |
|
190 else if ( aResourceId == R_MEMSPY_MENUPANE_OUTPUT ) |
|
191 { |
|
192 /* TODO |
|
193 //const TMemSpySinkType currentSink = iEngine.SinkType(); |
|
194 const TMemSpySinkType currentSink = iMemSpySession.GetSinkType(); |
|
195 aMenuPane->SetItemDimmed( EMemSpyCmdOutputToDebug, currentSink == ESinkTypeDebug ); |
|
196 aMenuPane->SetItemDimmed( EMemSpyCmdOutputToFile, currentSink == ESinkTypeFile ); |
|
197 */ |
|
198 } |
|
199 else if ( aResourceId == R_MEMSPY_MENUPANE_AUTO_CAPTURE ) |
|
200 { |
|
201 // Change the auto-capture toggle caption appropriately... |
|
202 TInt resId = R_MEMSPY_AUTO_CAPTURE_ENABLE; |
|
203 if ( iAutoCaptureTimer->IsActive() ) |
|
204 { |
|
205 resId = R_MEMSPY_AUTO_CAPTURE_DISABLE; |
|
206 } |
|
207 aMenuPane->SetItemTextL( EMemSpyCmdAutoCaptureToggle, resId ); |
|
208 } |
|
209 |
|
210 #ifdef _DEBUG |
|
211 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - sending to view..." ); |
|
212 #endif |
|
213 |
|
214 view.DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
215 |
|
216 #ifdef _DEBUG |
|
217 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DynInitMenuPaneL() - END - aResourceId: 0x%08x (%8d), iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d, viewType: %d, openableView: %d, exitable: %d", aResourceId, aResourceId, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive(), viewType, openableView, exitable ); |
|
218 #endif |
|
219 } |
|
220 |
|
221 |
|
222 TKeyResponse CMemSpyAppUi::HandleKeyEventL( const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ ) |
|
223 { |
|
224 return EKeyWasNotConsumed; |
|
225 } |
|
226 |
|
227 |
|
228 void CMemSpyAppUi::HandleCommandL( TInt aCommand ) |
|
229 { |
|
230 #ifdef _DEBUG |
|
231 RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - START - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() ); |
|
232 #endif |
|
233 |
|
234 switch ( aCommand ) |
|
235 { |
|
236 case EAknSoftkeyBack: |
|
237 OnCmdBackL(); |
|
238 break; |
|
239 |
|
240 case EEikCmdExit: |
|
241 case EAknCmdExit: |
|
242 case EAknSoftkeyExit: |
|
243 OnCmdExitL(); |
|
244 break; |
|
245 |
|
246 case EMemSpyCmdOpen: |
|
247 OnCmdOpenL(); |
|
248 break; |
|
249 |
|
250 case EMemSpyCmdOutputToDebug: |
|
251 OnCmdOutputToDebugL(); |
|
252 break; |
|
253 case EMemSpyCmdOutputToFile: |
|
254 OnCmdOutputToFileL(); |
|
255 break; |
|
256 |
|
257 case EMemSpyCmdToolsAbout: |
|
258 OnCmdAboutL(); |
|
259 break; |
|
260 // |
|
261 case EMemSpyCmdPhoneInfoGeneralSummary: |
|
262 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralSummary ); |
|
263 break; |
|
264 case EMemSpyCmdPhoneInfoGeneralDetailed: |
|
265 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralDetailed ); |
|
266 break; |
|
267 case EMemSpyCmdPhoneInfoGeneralHandles: |
|
268 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralHandles ); |
|
269 break; |
|
270 case EMemSpyCmdPhoneInfoGeneralKernelContainers: |
|
271 OnCmdPhoneInformationOperationKernelContainersL(); |
|
272 break; |
|
273 // |
|
274 case EMemSpyCmdPhoneInfoHeapInfoSummary: |
|
275 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapInfo ); |
|
276 break; |
|
277 case EMemSpyCmdPhoneInfoHeapInfoCompact: |
|
278 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceHeapInfoCompact ); |
|
279 break; |
|
280 case EMemSpyCmdPhoneInfoHeapCellListing: |
|
281 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapCellListing ); |
|
282 break; |
|
283 case EMemSpyCmdPhoneInfoHeapDump: |
|
284 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapData ); |
|
285 break; |
|
286 // |
|
287 case EMemSpyCmdPhoneInfoStackInfo: |
|
288 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackInfo ); |
|
289 break; |
|
290 case EMemSpyCmdPhoneInfoStackInfoCompact: |
|
291 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceStackInfoCompact ); |
|
292 break; |
|
293 case EMemSpyCmdPhoneInfoStackDumpUser: |
|
294 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataUser ); |
|
295 break; |
|
296 case EMemSpyCmdPhoneInfoStackDumpKernel: |
|
297 OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataKernel ); |
|
298 break; |
|
299 |
|
300 case EMemSpyCmdAutoCaptureToggle: |
|
301 OnCmdAutoCaptureToggleL(); |
|
302 break; |
|
303 case EMemSpyCmdAutoCaptureRetryTime: |
|
304 OnCmdAutoCaptureRetryTimeL(); |
|
305 break; |
|
306 case EMemSpyCmdAutoCaptureOperationType: |
|
307 OnCmdAutoCaptureOperationTypeL(); |
|
308 break; |
|
309 |
|
310 default: |
|
311 iAppContainer->HandleCommandL( aCommand ); |
|
312 break; |
|
313 } |
|
314 |
|
315 #ifdef _DEBUG |
|
316 RDebug::Printf( "[MemSpy] CMemSpyAppUi::HandleCommandL() - END - aCommand: %8d, iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", aCommand, iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() ); |
|
317 #endif |
|
318 } |
|
319 |
|
320 |
|
321 void CMemSpyAppUi::HandleForegroundEventL( TBool aForeground) |
|
322 { |
|
323 // Refresh the container when coming to the foreground |
|
324 if ( aForeground ) |
|
325 { |
|
326 iAppContainer->OnCmdViewRefreshL(); |
|
327 } |
|
328 } |
|
329 |
|
330 |
|
331 void CMemSpyAppUi::HandleThreadSelectedL( const CMemSpyThread& /*aThread*/ ) |
|
332 { |
|
333 MEikAppUiFactory* appUiFactory = (iEikonEnv)->AppUiFactory(); |
|
334 appUiFactory->MenuBar()->TryDisplayMenuBarL(); |
|
335 } |
|
336 |
|
337 |
|
338 void CMemSpyAppUi::HandleMemSpyEngineEventL( MMemSpyEngineObserver::TEvent aEvent, TAny* aContext ) |
|
339 { |
|
340 if ( aEvent == MMemSpyEngineObserver::EHandleThreadsOrProcessesChanged ) |
|
341 { |
|
342 // Get the original container |
|
343 const CMemSpyEngineObjectContainer& oldContainer = *reinterpret_cast< CMemSpyEngineObjectContainer* >( aContext ); |
|
344 (void) oldContainer; |
|
345 |
|
346 // Refresh the container |
|
347 iAppContainer->OnCmdViewRefreshL(); |
|
348 } |
|
349 else if ( aEvent == MMemSpyEngineObserver::EHandleClientServerOperationRequest ) |
|
350 { |
|
351 const TInt function = reinterpret_cast<TInt>( aContext ); |
|
352 InitiateMemSpyClientServerOperationL( function ); |
|
353 } |
|
354 } |
|
355 |
|
356 |
|
357 void CMemSpyAppUi::DWOperationStarted() |
|
358 { |
|
359 #ifdef _DEBUG |
|
360 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
361 #endif |
|
362 |
|
363 iRunningDeviceWideOperation = ETrue; |
|
364 |
|
365 #ifdef _DEBUG |
|
366 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationStarted() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
367 #endif |
|
368 } |
|
369 |
|
370 |
|
371 void CMemSpyAppUi::DWOperationCancelled() |
|
372 { |
|
373 #ifdef _DEBUG |
|
374 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
375 #endif |
|
376 |
|
377 iAutoCaptureTimer->Cancel(); |
|
378 |
|
379 #ifdef _DEBUG |
|
380 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCancelled() - END - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
381 #endif |
|
382 } |
|
383 |
|
384 |
|
385 void CMemSpyAppUi::DWOperationCompleted() |
|
386 { |
|
387 #ifdef _DEBUG |
|
388 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - START - iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
389 #endif |
|
390 |
|
391 iRunningDeviceWideOperation = EFalse; |
|
392 |
|
393 #ifdef _DEBUG |
|
394 RDebug::Printf( "[MemSpy] CMemSpyAppUi::DWOperationCompleted() - END - iAutoCaptureTimer is active: %d", iAutoCaptureTimer->IsActive() ); |
|
395 #endif |
|
396 } |
|
397 |
|
398 |
|
399 void CMemSpyAppUi::UpdateCBAL() |
|
400 { |
|
401 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
402 const TMemSpyViewType viewType = iAppContainer->ActiveViewType(); |
|
403 // |
|
404 if ( MemSpyViewTypeUtils::IsExitableView( viewType ) ) |
|
405 { |
|
406 cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_EXIT ); |
|
407 } |
|
408 else |
|
409 { |
|
410 cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK ); |
|
411 } |
|
412 |
|
413 cba->MakeVisible( ETrue ); |
|
414 cba->DrawNow(); |
|
415 } |
|
416 |
|
417 |
|
418 void CMemSpyAppUi::InitiateMemSpyClientServerOperationL( TInt aOpCode ) |
|
419 { |
|
420 #ifdef _DEBUG |
|
421 RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - START - aOpCode: %d", aOpCode ); |
|
422 #endif |
|
423 |
|
424 switch( aOpCode ) |
|
425 { |
|
426 case EMemSpyClientServerOpSummaryInfo: |
|
427 HandleCommandL( EMemSpyCmdPhoneInfoGeneralSummary ); |
|
428 break; |
|
429 case EMemSpyClientServerOpSummaryInfoDetailed: |
|
430 HandleCommandL( EMemSpyCmdPhoneInfoGeneralDetailed ); |
|
431 break; |
|
432 // |
|
433 case EMemSpyClientServerOpHeapInfo: |
|
434 HandleCommandL( EMemSpyCmdPhoneInfoHeapInfoSummary ); |
|
435 break; |
|
436 case EMemSpyClientServerOpHeapCellListing: |
|
437 HandleCommandL( EMemSpyCmdPhoneInfoHeapCellListing ); |
|
438 break; |
|
439 case EMemSpyClientServerOpHeapData: |
|
440 HandleCommandL( EMemSpyCmdPhoneInfoHeapDump ); |
|
441 break; |
|
442 // |
|
443 case EMemSpyClientServerOpStackInfo: |
|
444 HandleCommandL( EMemSpyCmdPhoneInfoStackInfo ); |
|
445 break; |
|
446 case EMemSpyClientServerOpStackDataUser: |
|
447 HandleCommandL( EMemSpyCmdPhoneInfoStackDumpUser ); |
|
448 break; |
|
449 case EMemSpyClientServerOpStackDataKernel: |
|
450 HandleCommandL( EMemSpyCmdPhoneInfoStackDumpKernel ); |
|
451 break; |
|
452 // |
|
453 case EMemSpyClientServerOpBitmapsSave: |
|
454 OnCmdToolsBitmapsSaveToMemoryCardL(); |
|
455 break; |
|
456 case EMemSpyClientServerOpSendToBackground: |
|
457 OnCmdToolsSendToBackgroundL(); |
|
458 break; |
|
459 case EMemSpyClientServerOpBringToForeground: |
|
460 OnCmdToolsBringToForegroundL(); |
|
461 break; |
|
462 case EMemSpyClientServerOpExit: |
|
463 OnCmdExitL(); |
|
464 break; |
|
465 // |
|
466 default: |
|
467 User::Leave( KErrNotSupported ); |
|
468 break; |
|
469 } |
|
470 |
|
471 #ifdef _DEBUG |
|
472 RDebug::Printf( "[MemSpy] CMemSpyAppUi::InitiateMemSpyClientServerOperationL() - END - aOpCode: %d", aOpCode ); |
|
473 #endif |
|
474 } |
|
475 |
|
476 |
|
477 void CMemSpyAppUi::SetViewServerTimeOutStatus( TBool aEnabled ) |
|
478 { |
|
479 /* TODO |
|
480 iMemSpySession.SetServerTimeOutStatus( KMemSpyEikSrvSID, aEnabled ); |
|
481 */ |
|
482 /* |
|
483 TRAP_IGNORE( |
|
484 iEngine.HelperProcess().ImpersonateL( KMemSpyEikSrvSID ); |
|
485 // |
|
486 CVwsSessionWrapper* ses = CVwsSessionWrapper::NewLC(); |
|
487 ses->EnableServerEventTimeOut( aEnabled ); |
|
488 CleanupStack::PopAndDestroy( ses ); |
|
489 // |
|
490 iEngine.HelperProcess().ImpersonateL( 0 ); |
|
491 ); |
|
492 */ |
|
493 } |
|
494 |
|
495 |
|
496 void CMemSpyAppUi::OnCmdBackL() |
|
497 { |
|
498 const TMemSpyViewType viewType = iAppContainer->ActiveViewType(); |
|
499 // |
|
500 if ( !MemSpyViewTypeUtils::IsExitableView( viewType ) ) |
|
501 { |
|
502 // Should go back one view |
|
503 iAppContainer->NavigateToParentViewL(); |
|
504 } |
|
505 } |
|
506 |
|
507 |
|
508 void CMemSpyAppUi::OnCmdExitL() |
|
509 { |
|
510 Exit(); |
|
511 } |
|
512 |
|
513 |
|
514 void CMemSpyAppUi::OnCmdOpenL() |
|
515 { |
|
516 const TMemSpyViewType viewType = iAppContainer->ActiveViewType(); |
|
517 // |
|
518 if ( !MemSpyViewTypeUtils::IsOpenableItem( viewType ) ) |
|
519 { |
|
520 // Should go back one view |
|
521 iAppContainer->NavigateToChildViewL(); |
|
522 } |
|
523 } |
|
524 |
|
525 |
|
526 void CMemSpyAppUi::OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::TOperation aOp ) |
|
527 { /* TODO |
|
528 #ifdef _DEBUG |
|
529 RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - START - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
530 #endif |
|
531 |
|
532 if ( !iRunningDeviceWideOperation ) |
|
533 { |
|
534 //CMemSpyDeviceWideOperationDialog::ExecuteLD( iEngine, *this, aOp ); |
|
535 CMemSpyDeviceWideOperationDialog::ExecuteLD( iMemSpySession, *this, aOp ); |
|
536 } |
|
537 |
|
538 #ifdef _DEBUG |
|
539 RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdPhoneInformationOperationL() - END - aOp: %d, iRunningDeviceWideOperation: %d, iAutoCaptureTimer is active: %d", aOp, iRunningDeviceWideOperation, iAutoCaptureTimer->IsActive() ); |
|
540 #endif*/ |
|
541 } |
|
542 |
|
543 |
|
544 void CMemSpyAppUi::OnCmdPhoneInformationOperationKernelContainersL() |
|
545 { |
|
546 /* TODO |
|
547 iMemSpySession.OutputKernelObjects(); |
|
548 */ |
|
549 /* |
|
550 CMemSpyEngineGenericKernelObjectContainer* list = iEngine.HelperKernelContainers().ObjectsAllL(); |
|
551 CleanupStack::PushL( list ); |
|
552 iEngine.HelperKernelContainers().OutputL( *list ); |
|
553 CleanupStack::PopAndDestroy( list ); |
|
554 */ |
|
555 } |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 void CMemSpyAppUi::OnCmdAutoCaptureToggleL() |
|
579 { |
|
580 #ifdef _DEBUG |
|
581 RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() ); |
|
582 #endif |
|
583 |
|
584 if ( iAutoCaptureTimer->IsActive() ) |
|
585 { |
|
586 iAutoCaptureTimer->Cancel(); |
|
587 } |
|
588 else |
|
589 { |
|
590 iAutoCaptureTimer->Cancel(); |
|
591 // |
|
592 const TTimeIntervalMicroSeconds32 interval( iAutoCaptureTimerPeriod * 1000000 ); |
|
593 iAutoCaptureTimer->Start( 0, interval, TCallBack(AutoCaptureCallBack, this) ); |
|
594 } |
|
595 |
|
596 #ifdef _DEBUG |
|
597 RDebug::Printf( "[MemSpy] CMemSpyAppUi::OnCmdAutoCaptureToggleL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() ); |
|
598 #endif |
|
599 } |
|
600 |
|
601 |
|
602 void CMemSpyAppUi::OnCmdAutoCaptureRetryTimeL() |
|
603 { |
|
604 CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( iAutoCaptureTimerPeriod ); |
|
605 dialog->ExecuteLD( R_MEMSPY_DEVICE_WIDE_SETTINGS ); |
|
606 } |
|
607 |
|
608 |
|
609 void CMemSpyAppUi::OnCmdAutoCaptureOperationTypeL() |
|
610 { |
|
611 CDesCArrayFlat* items = iCoeEnv->ReadDesC16ArrayResourceL( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES ); |
|
612 CleanupStack::PushL(items); |
|
613 // |
|
614 TInt currentItem = iAutoCaptureOperationType; |
|
615 // |
|
616 CAknRadioButtonSettingPage* dialog = new(ELeave) CAknRadioButtonSettingPage( R_MEMSPY_AUTO_CAPTURE_OPERATION_TYPES_SETTINGS_PAGE, currentItem, items ); |
|
617 if ( dialog->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) ) |
|
618 { |
|
619 iAutoCaptureOperationType = static_cast< CMemSpyDeviceWideOperations::TOperation >( currentItem ); |
|
620 } |
|
621 // |
|
622 CleanupStack::PopAndDestroy( items ); |
|
623 } |
|
624 |
|
625 |
|
626 TInt CMemSpyAppUi::AutoCaptureCallBack( TAny* aSelf ) |
|
627 { |
|
628 CMemSpyAppUi* self = reinterpret_cast< CMemSpyAppUi* >( aSelf ); |
|
629 TRAPD( err, self->AutoCaptureCallBackL() ); |
|
630 // |
|
631 const TBool callMeBackAgain = ( err == KErrNone ); |
|
632 return callMeBackAgain; |
|
633 } |
|
634 |
|
635 |
|
636 void CMemSpyAppUi::AutoCaptureCallBackL() |
|
637 { |
|
638 #ifdef _DEBUG |
|
639 RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - START - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() ); |
|
640 #endif |
|
641 |
|
642 OnCmdPhoneInformationOperationL( iAutoCaptureOperationType ); |
|
643 |
|
644 #ifdef _DEBUG |
|
645 RDebug::Printf( "[MemSpy] CMemSpyAppUi::AutoCaptureCallBackL() - END - iAutoCaptureOperationType: %d, iAutoCaptureTimer is active: %d", iAutoCaptureOperationType, iAutoCaptureTimer->IsActive() ); |
|
646 #endif |
|
647 } |
|
648 |
|
649 |
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 void CMemSpyAppUi::OnCmdOutputToDebugL() |
|
670 { |
|
671 /* TODO |
|
672 iMemSpyAPI.OutputToDebug(); |
|
673 */ |
|
674 /* |
|
675 iEngine.InstallSinkL( ESinkTypeDebug ); |
|
676 MemSpyDocument().Settings().StoreSettingsL(); |
|
677 */ |
|
678 } |
|
679 |
|
680 |
|
681 void CMemSpyAppUi::OnCmdOutputToFileL() |
|
682 { |
|
683 /* TODO |
|
684 iMemSpyAPI.OutputToFile(); |
|
685 */ |
|
686 /* |
|
687 iEngine.InstallSinkL( ESinkTypeFile ); |
|
688 MemSpyDocument().Settings().StoreSettingsL(); |
|
689 */ |
|
690 } |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 void CMemSpyAppUi::OnCmdAboutL() |
|
703 { |
|
704 CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog; |
|
705 dialog->ExecuteLD( R_MEMSPYUI_ABOUT_DIALOG ); |
|
706 } |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 void CMemSpyAppUi::OnCmdToolsBitmapsSaveToMemoryCardL() |
|
720 { |
|
721 /* TODO |
|
722 // Get bitmap handles |
|
723 RArray<TInt> handles; |
|
724 CleanupClosePushL( handles ); |
|
725 iEngine.HelperFbServ().GetArrayOfBitmapHandlesL( handles ); |
|
726 |
|
727 // Build bitmap list |
|
728 CMemSpyEngineFbServBitmapArray* array = CMemSpyEngineFbServBitmapArray::NewL( handles ); |
|
729 CleanupStack::PopAndDestroy( &handles ); |
|
730 CleanupStack::PushL( array ); |
|
731 |
|
732 // Export... |
|
733 CMemSpyExportBitmapsToMemoryCardDialog* dialog = CMemSpyExportBitmapsToMemoryCardDialog::NewL( iCoeEnv->FsSession(), *array ); |
|
734 |
|
735 // All done |
|
736 CleanupStack::PopAndDestroy( array ); |
|
737 */ |
|
738 } |
|
739 |
|
740 |
|
741 void CMemSpyAppUi::OnCmdToolsSendToBackgroundL() |
|
742 { |
|
743 TApaTask task( iCoeEnv->WsSession() ); |
|
744 task.SendToBackground(); |
|
745 } |
|
746 |
|
747 |
|
748 void CMemSpyAppUi::OnCmdToolsBringToForegroundL() |
|
749 { |
|
750 iCoeEnv->BringOwnerToFront(); |
|
751 } |
|
752 |
|
753 |
|
754 |
|
755 |