memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp
changeset 35 98924d2efce9
parent 19 4b22a598b890
equal deleted inserted replaced
34:e0ec97ec3cc4 35:98924d2efce9
    52     }
    52     }
    53 
    53 
    54 
    54 
    55 CMemSpyViewThreadInfoItemList::~CMemSpyViewThreadInfoItemList()
    55 CMemSpyViewThreadInfoItemList::~CMemSpyViewThreadInfoItemList()
    56     {
    56     {
    57 	/* TODO: to consider what to do with this
    57 	/* TODO:
    58     delete iIdleResetListboxTimer;
       
    59 
       
    60     TRAP_IGNORE( 
    58     TRAP_IGNORE( 
    61         CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
    59         CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
    62         container.ObserverRemove( *this );
    60         container.ObserverRemove( *this );
    63     );
    61     );
    64 
    62 	*/
    65     if  ( iCurrentInfoItem )
    63     }
    66         {
    64 
    67         iCurrentInfoItem->Close();
    65 
    68         }
    66 
    69     */
    67 void CMemSpyViewThreadInfoItemList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TMemSpyThreadInfoItemType aType )
    70     }
       
    71 
       
    72 
       
    73 
       
    74 void CMemSpyViewThreadInfoItemList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
       
    75     {
    68     {
    76     _LIT( KTitle, "Thread Objects" );
    69     _LIT( KTitle, "Thread Objects" );
    77     SetTitleL( KTitle );
    70     SetTitleL( KTitle );
    78     //
    71     //
    79     iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityIdle );
    72     //iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityIdle );    
    80     //
    73     /* TODO: to solve observer
    81     /*
       
    82     CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
    74     CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
    83     container.ObserverAddL( *this );
    75     container.ObserverAddL( *this );
    84     */
    76     */    
       
    77     CMemSpyViewBase::ConstructL( aRect, aContainer );
    85     //
    78     //
    86     CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
    79     if( aType > EMemSpyThreadInfoItemTypeFirst || aType < EMemSpyThreadInfoItemTypeLast )
    87     //
    80     	{
       
    81 		TInt index(aType);
       
    82 		if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
       
    83 			{
       
    84 			iListBox->SetCurrentItemIndex( index );
       
    85 			HandleListBoxItemSelectedL( index );
       
    86 			}
       
    87     	}
       
    88     else
       
    89     	{
       
    90 		iListBox->SetCurrentItemIndex( 0 );
       
    91         HandleListBoxItemSelectedL( 0 );
       
    92     	}
    88     /*if  ( aSelectionRune )
    93     /*if  ( aSelectionRune )
    89         {		
    94         {		
    90         CMemSpyThreadInfoItemBase* selectedItem = reinterpret_cast< CMemSpyThreadInfoItemBase* >( aSelectionRune );
    95         CMemSpyThreadInfoItemBase* selectedItem = reinterpret_cast< CMemSpyThreadInfoItemBase* >( aSelectionRune );
    91         const TInt index = container.InfoItemIndexByType( selectedItem->Type() );
    96         const TInt index = container.InfoItemIndexByType( selectedItem->Type() );
    92         if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
    97         if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
    95             HandleListBoxItemSelectedL( index );
   100             HandleListBoxItemSelectedL( index );
    96             }
   101             }
    97         }
   102         }
    98     else if ( container.MdcaCount() > 0 )
   103     else if ( container.MdcaCount() > 0 )
    99         {*/
   104         {*/
   100         iListBox->SetCurrentItemIndex( 0 ); //for now
   105         //iListBox->SetCurrentItemIndex( 0 );
   101         HandleListBoxItemSelectedL( 0 );
   106         //HandleListBoxItemSelectedL( 0 );
   102         //}
   107         //}
   103     }
   108     }
   104 
   109 
   105 const CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemList::CurrentInfoItem() const
   110 const CMemSpyThreadInfoItemBase& CMemSpyViewThreadInfoItemList::CurrentInfoItem() const
   106     {
   111     {
   121     }
   126     }
   122 
   127 
   123 
   128 
   124 CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareParentViewL()
   129 CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareParentViewL()
   125     {
   130     {
   126     CMemSpyViewBase* parent = new(ELeave) CMemSpyViewThreads( iMemSpySession, iObserver, iParentProcessId );
   131     CMemSpyViewBase* parent = new(ELeave) CMemSpyViewThreads( iMemSpySession, iObserver, iParentProcessId, iThreadId );
   127     CleanupStack::PushL( parent );
   132     CleanupStack::PushL( parent );
   128     parent->ConstructL( Rect(), *Parent() );
   133     parent->ConstructL( Rect(), *Parent() );
   129     CleanupStack::Pop( parent );
   134     CleanupStack::Pop( parent );
   130     return parent;
   135     return parent;
   131     }
   136     }
   233     }
   238     }
   234 
   239 
   235 
   240 
   236 void CMemSpyViewThreadInfoItemList::OnCmdInfoHandlesL()
   241 void CMemSpyViewThreadInfoItemList::OnCmdInfoHandlesL()
   237     {
   242     {
   238     //iThread.InfoContainerForceSyncronousConstructionL().PrintL(); //TODO:
   243     iMemSpySession.OutputThreadInfoHandlesL( iThreadId );
   239     }
   244     }
   240 
   245 
   241 
   246 
   242 void CMemSpyViewThreadInfoItemList::HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType )
   247 void CMemSpyViewThreadInfoItemList::HandleMemSpyEngineInfoContainerEventL( TEvent aEvent, TMemSpyThreadInfoItemType aType )
   243     {/*
   248     {/*
   385 
   390 
   386 void CMemSpyViewThreadInfoItemList::HandleListBoxItemSelectedL( TInt aIndex )
   391 void CMemSpyViewThreadInfoItemList::HandleListBoxItemSelectedL( TInt aIndex )
   387     {
   392     {
   388 	iCurrentInfoItemId = aIndex;
   393 	iCurrentInfoItemId = aIndex;
   389 	
   394 	
   390 	/*
       
   391     if  ( iCurrentInfoItem )
       
   392         {
       
   393         CMemSpyThreadInfoItemBase* item = iCurrentInfoItem;
       
   394         iCurrentInfoItem = NULL;
       
   395         item->Close();
       
   396         }
       
   397 
       
   398     // Identify the type of item to display...
       
   399     iCurrentInfoItem = &iThread.InfoContainerL().Item( aIndex );
       
   400     iCurrentInfoItem->Open();
       
   401 */
       
   402     // Notify observer about item selection
   395     // Notify observer about item selection
   403     ReportEventL( MMemSpyViewObserver::EEventItemSelected );
   396     ReportEventL( MMemSpyViewObserver::EEventItemSelected );
   404     }
   397     }
   405 
   398 
   406 
   399