memspyui/ui/avkon/inc/MemSpyViewProcesses.h
changeset 17 4f2773374eff
equal deleted inserted replaced
15:e11368ed4880 17:4f2773374eff
       
     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 #ifndef MEMSPYVIEWPROCESSES_H
       
    19 #define MEMSPYVIEWPROCESSES_H
       
    20 
       
    21 // System includes
       
    22 #include <coecntrl.h>
       
    23 #include <aknlists.h>
       
    24 
       
    25 // User includes
       
    26 #include "MemSpyViewBase.h"
       
    27 
       
    28 #include <memspy/api/memspyapiprocess.h>
       
    29 
       
    30 // Classes referenced
       
    31 class CMemSpyProcess;
       
    32 class CAknSearchField;
       
    33 class RMemSpySession;
       
    34 
       
    35 class CMemSpyViewProcesses : public CMemSpyViewBase
       
    36     {
       
    37 public:
       
    38     //CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver );
       
    39     //CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
       
    40 	CMemSpyViewProcesses( RMemSpySession& aSession, MMemSpyViewObserver& aObserver );
       
    41 //	CMemSpyViewProcesses( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyProcess& aProcess );
       
    42 	CMemSpyViewProcesses( RMemSpySession& aEngine, MMemSpyViewObserver& aObserver, TProcessId aId );
       
    43     ~CMemSpyViewProcesses();
       
    44     //void ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune = NULL );    
       
    45     void ConstructL( const TRect& aRect, CCoeControl& aContainer, TProcessId aSelectionRune = NULL );
       
    46 
       
    47 public: // API
       
    48     CMemSpyProcess& CurrentProcess() const;
       
    49 
       
    50 public: // From CMemSpyViewBase
       
    51     void RefreshL();
       
    52     TMemSpyViewType ViewType() const;
       
    53     CMemSpyViewBase* PrepareParentViewL();
       
    54     CMemSpyViewBase* PrepareChildViewL();
       
    55     TBool HandleCommandL( TInt aCommand );
       
    56 
       
    57 public: // Menu framework
       
    58     TUint MenuCascadeResourceId() const { return R_MEMSPY_MENUPANE_PROCESS; }
       
    59     TInt MenuCascadeCommandId() const { return EMemSpyCmdProcess; }
       
    60     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    61 
       
    62 private: // Command handlers
       
    63 
       
    64     // Sorting
       
    65     void OnCmdSortByIdL();
       
    66     void OnCmdSortByNameL();
       
    67     void OnCmdSortByThreadCountL();
       
    68     void OnCmdSortByCodeSegsL();
       
    69     void OnCmdSortByHeapUsageL();
       
    70     void OnCmdSortByStackUsageL();
       
    71 
       
    72     // Info
       
    73     void OnCmdInfoSummaryL();
       
    74     void OnCmdInfoHandlesL();
       
    75 
       
    76     // Ending
       
    77     void OnCmdEndTerminateL();
       
    78     void OnCmdEndPanicL();
       
    79     void OnCmdEndKillL();
       
    80 
       
    81 private: // From CMemSpyViewBase
       
    82     void SetListBoxModelL();
       
    83     void HandleListBoxItemActionedL( TInt aIndex );
       
    84     void HandleListBoxItemSelectedL( TInt aIndex );
       
    85     
       
    86 private: // From CCoeControl
       
    87     void SizeChanged();
       
    88     TInt CountComponentControls() const;
       
    89     CCoeControl* ComponentControl( TInt aIndex ) const;
       
    90 	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    91     void FocusChanged( TDrawNow /*aDrawNow*/ );
       
    92 
       
    93 private: // From MCoeControlObserver
       
    94     void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
       
    95 
       
    96 private: // Internal methods
       
    97     void SelectListBoxItemByFindTextL();
       
    98     
       
    99     CDesCArrayFlat* FormatModel( RArray<CMemSpyApiProcess*> aProcesses );
       
   100     void AppendPriority( TDes& aDes, TProcessPriority aPriority );
       
   101     void AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  );
       
   102     void AppendExitType( TDes& aDes, TExitType aType );
       
   103 
       
   104 private: // Data members
       
   105     CMemSpyProcess* iCurrentProcess;
       
   106     TProcessId iCurrentProcessId;
       
   107     CAknSearchField* iSearchField;
       
   108     HBufC* iMatcherBuffer;
       
   109     RArray<CMemSpyApiProcess*> iProcesses;  //cigasto
       
   110     CDesCArrayFlat* iModel;
       
   111     CDesCArrayFlat* model;
       
   112     };
       
   113 
       
   114 
       
   115 #endif