memspyui/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp
changeset 35 98924d2efce9
parent 19 4b22a598b890
equal deleted inserted replaced
34:e0ec97ec3cc4 35:98924d2efce9
    23 #include <memspy/engine/memspyengineobjectthread.h>
    23 #include <memspy/engine/memspyengineobjectthread.h>
    24 #include <memspy/engine/memspyengineobjectcontainer.h>
    24 #include <memspy/engine/memspyengineobjectcontainer.h>
    25 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
    25 #include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
    26 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
    26 #include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
    27 #include <memspy/engine/memspyenginehelperactiveobject.h>
    27 #include <memspy/engine/memspyenginehelperactiveobject.h>
       
    28 #include <memspysession.h>
    28 
    29 
    29 // User includes
    30 // User includes
    30 #include "MemSpyContainerObserver.h"
    31 #include "MemSpyContainerObserver.h"
    31 
    32 
    32 
    33 
    33 
    34 CMemSpyViewThreadInfoItemActiveObjectBase::CMemSpyViewThreadInfoItemActiveObjectBase(RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
    34 CMemSpyViewThreadInfoItemActiveObjectBase::CMemSpyViewThreadInfoItemActiveObjectBase( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
    35 :   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeActiveObject )
    35 :   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeActiveObject )
       
    36     {
    36     {
    37     }
    37     }
    38 
    38 
    39 
    39 
    40 TBool CMemSpyViewThreadInfoItemActiveObjectBase::HandleCommandL( TInt aCommand )
    40 TBool CMemSpyViewThreadInfoItemActiveObjectBase::HandleCommandL( TInt aCommand )
    41     {
    41     {
    42     TBool handled = ETrue;
    42     TBool handled = ETrue;
       
    43     /*
    43     //
    44     //
    44     switch ( aCommand )
    45     switch ( aCommand )
    45         {
    46         {
    46     case EMemSpyCmdActiveObjectListing:
    47     case EMemSpyCmdActiveObjectListing:
    47         OnCmdWriteAOListingL();
    48         OnCmdWriteAOListingL();
    49     default:
    50     default:
    50         handled = CMemSpyViewBase::HandleCommandL( aCommand );
    51         handled = CMemSpyViewBase::HandleCommandL( aCommand );
    51         break;
    52         break;
    52         }
    53         }
    53     //
    54     //
       
    55      * */
    54     return handled;
    56     return handled;
    55     }
    57     }
    56 
    58 
    57 
    59 
    58 void CMemSpyViewThreadInfoItemActiveObjectBase::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
    60 void CMemSpyViewThreadInfoItemActiveObjectBase::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
    59     {
    61     {
    60     if  ( aResourceId == R_MEMSPY_MENUPANE )
    62     if  ( aResourceId == R_MEMSPY_MENUPANE )
    61         {
    63         {
    62         aMenuPane->SetItemDimmed( EMemSpyCmdActiveObject, Thread().IsDead() );
    64      //   aMenuPane->SetItemDimmed( EMemSpyCmdActiveObject, Thread().IsDead() );
    63         }
    65         }
    64     }
    66     }
    65 
    67 
    66 
    68 
    67 CMemSpyEngineActiveObjectArray& CMemSpyViewThreadInfoItemActiveObjectBase::ActiveObjectArray() const
    69 CMemSpyEngineActiveObjectArray& CMemSpyViewThreadInfoItemActiveObjectBase::ActiveObjectArray() const
    68     {
    70     {
    69     CMemSpyThreadInfoActiveObjects* activeObjectArray = static_cast< CMemSpyThreadInfoActiveObjects* >( iInfoItem );
    71  //   CMemSpyThreadInfoActiveObjects* activeObjectArray = static_cast< CMemSpyThreadInfoActiveObjects* >( iInfoItem );
    70     return activeObjectArray->Array();
    72  //   return activeObjectArray->Array();
    71     }
    73     }
    72     
    74     
    73     
    75     
    74 void CMemSpyViewThreadInfoItemActiveObjectBase::OnCmdWriteAOListingL()
    76 void CMemSpyViewThreadInfoItemActiveObjectBase::OnCmdWriteAOListingL()
    75     {
    77     {
       
    78 	iMemSpySession.OutputAOListL( ThreadId(), EMemSpyThreadInfoItemTypeActiveObject );
       
    79 	
       
    80 	/*
    76     CMemSpyEngineActiveObjectArray& objects = ActiveObjectArray();
    81     CMemSpyEngineActiveObjectArray& objects = ActiveObjectArray();
    77 
    82 
    78     // Begin a new data stream
    83     // Begin a new data stream
    79     _LIT( KMemSpyContext, "Active Object List - " );
    84     _LIT( KMemSpyContext, "Active Object List - " );
    80     _LIT( KMemSpyFolder, "Active Objects" );
    85     _LIT( KMemSpyFolder, "Active Objects" );
    98     // Tidy up
   103     // Tidy up
    99     CleanupStack::PopAndDestroy(); // prefix
   104     CleanupStack::PopAndDestroy(); // prefix
   100 
   105 
   101     // End data stream
   106     // End data stream
   102     iEngine.Sink().DataStreamEndL();
   107     iEngine.Sink().DataStreamEndL();
   103     }
   108     */
   104 
   109     }
   105 
   110 
   106 
   111 
   107 
   112 
   108 
   113 
   109 
   114 
   110 
   115 
   111 
   116 
   112 
   117 
   113 
   118 
   114 
   119 
   115 CMemSpyViewThreadInfoItemActiveObject::CMemSpyViewThreadInfoItemActiveObject( RMemSpySession& aSession, MMemSpyViewObserver& aObserver,  TThreadId aId, TMemSpyThreadInfoItemType aType )
   120 
   116 :   CMemSpyViewThreadInfoItemActiveObjectBase( aSession, aObserver, aId, aType )
   121 CMemSpyViewThreadInfoItemActiveObject::CMemSpyViewThreadInfoItemActiveObject( RMemSpySession& aSession, MMemSpyViewObserver& aObserver,  TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
       
   122 :   CMemSpyViewThreadInfoItemActiveObjectBase( aSession, aObserver, aProcId, aId, aType )
   117     {
   123     {
   118     }
   124     }
   119 
   125 
   120 
   126 
   121 void CMemSpyViewThreadInfoItemActiveObject::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
   127 void CMemSpyViewThreadInfoItemActiveObject::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
   125 
   131 
   126     _LIT( KTitle, "Active Objects" );
   132     _LIT( KTitle, "Active Objects" );
   127     SetTitleL( KTitle );
   133     SetTitleL( KTitle );
   128 
   134 
   129     // Try to select the correct server
   135     // Try to select the correct server
       
   136     /* TODO: to consider this
   130     CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
   137     CMemSpyThreadInfoHandleObjectBase* infoItem = static_cast< CMemSpyThreadInfoHandleObjectBase* >( iInfoItem );
   131     TInt selectedIndex = 0;
   138     TInt selectedIndex = 0;
   132     if  ( aSelectionRune )
   139     if  ( aSelectionRune )
   133         {
   140         {
   134         CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
   141         CMemSpyEngineActiveObjectArray& activeObjectArray = ActiveObjectArray();
   140         }
   147         }
   141 
   148 
   142     // Select item
   149     // Select item
   143     if  ( infoItem->DetailsCount() > 0 )
   150     if  ( infoItem->DetailsCount() > 0 )
   144         {
   151         {
   145         iListBox->SetCurrentItemIndex( selectedIndex );
   152         */
   146         HandleListBoxItemSelectedL( selectedIndex );
   153         iListBox->SetCurrentItemIndex( 0 ); //selectedIndex
   147         }
   154         HandleListBoxItemSelectedL( 0 ); //selectedIndex
       
   155         /*
       
   156         }
       
   157         */
   148     }
   158     }
   149 
   159 
   150 
   160 
   151 TMemSpyViewType CMemSpyViewThreadInfoItemActiveObject::ViewType() const
   161 TMemSpyViewType CMemSpyViewThreadInfoItemActiveObject::ViewType() const
   152     {
   162     {
   155 
   165 
   156 
   166 
   157 CMemSpyViewBase* CMemSpyViewThreadInfoItemActiveObject::PrepareChildViewL()
   167 CMemSpyViewBase* CMemSpyViewThreadInfoItemActiveObject::PrepareChildViewL()
   158     {
   168     {
   159     CMemSpyViewBase* child = NULL;
   169     CMemSpyViewBase* child = NULL;
   160 
   170     /*
   161     // Get current entry address
   171     // Get current entry address
   162     TInt index = iListBox->CurrentItemIndex();
   172     TInt index = iListBox->CurrentItemIndex();
   163     if  ( index > 0 )
   173     if  ( index > 0 )
   164         {
   174         {
   165         --index;
   175         --index;
   175             child->ConstructL( Rect(), *Parent(), NULL );
   185             child->ConstructL( Rect(), *Parent(), NULL );
   176             CleanupStack::Pop( child );
   186             CleanupStack::Pop( child );
   177             }
   187             }
   178         }
   188         }
   179     //
   189     //
       
   190      * 
       
   191      */
   180     return child;
   192     return child;
   181     }
   193     }
   182 
   194 
   183 
   195 
   184 
   196 
   187 
   199 
   188 
   200 
   189 
   201 
   190 
   202 
   191 
   203 
   192 
   204 /*
   193 CMemSpyViewThreadInfoItemActiveObjectDetails::CMemSpyViewThreadInfoItemActiveObjectDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, TAny* aObjectAddress )
   205 CMemSpyViewThreadInfoItemActiveObjectDetails::CMemSpyViewThreadInfoItemActiveObjectDetails( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer, TAny* aObjectAddress )
   194 :   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer ), iObjectAddress( aObjectAddress )
   206 :   CMemSpyViewThreadInfoItemActiveObjectBase( aEngine, aObserver, aContainer ), iObjectAddress( aObjectAddress )
   195     {
   207     {
   196     }
   208     }
   197 
   209 
   231     //
   243     //
   232     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
   244     CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
   233     listbox->Model()->SetItemTextArray( &object );
   245     listbox->Model()->SetItemTextArray( &object );
   234     listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
   246     listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
   235     }
   247     }
   236 
   248 */
   237 
       
   238 
       
   239 
       
   240 
       
   241