gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp
branchRCL_3
changeset 20 3b67655da2cc
parent 17 3b47783fdf16
equal deleted inserted replaced
18:854ebc17f64b 20:3b67655da2cc
    33 #include    <aknViewAppUi.h>
    33 #include    <aknViewAppUi.h>
    34 #include    <barsread.h> // For TResourceReader
    34 #include    <barsread.h> // For TResourceReader
    35 #include    <bldvariant.hrh>
    35 #include    <bldvariant.hrh>
    36 #include    <calslbs.h>
    36 #include    <calslbs.h>
    37 #include    <eikclbd.h>
    37 #include    <eikclbd.h>
       
    38 #include    "GsContainerExt.h" //For CGsContainerExt
    38 
    39 
    39 //CONSTANTS
    40 //CONSTANTS
    40 const TInt KGSPluginArrayInitSize = 10;
    41 const TInt KGSPluginArrayInitSize = 10;
    41 const TInt KGSCaptionBufSize = 256;
    42 const TInt KGSCaptionBufSize = 256;
    42 
    43 
    60     iPluginArray = aPluginArray;
    61     iPluginArray = aPluginArray;
    61     iListBoxType = aListBoxType;
    62     iListBoxType = aListBoxType;
    62     iParentPlugin = aParentPlugin;
    63     iParentPlugin = aParentPlugin;
    63 
    64 
    64     CGSBaseDocument* doc = static_cast< CGSBaseDocument* >( iAppUi->Document() );
    65     CGSBaseDocument* doc = static_cast< CGSBaseDocument* >( iAppUi->Document() );
    65     iGSWatchDog = doc->WatchDog();
    66     iExt = CGsContainerExt::NewL();
       
    67     iExt->iGSWatchDog = doc->WatchDog();
    66 
    68 
    67     // Initialize the array containing pointers to plugins that are actually
    69     // Initialize the array containing pointers to plugins that are actually
    68     // displayed in lbx.
    70     // displayed in lbx.
    69     iVisiblePlugins = new (ELeave) CArrayPtrFlat<CGSPluginInterface>( KGSPluginArrayInitSize );
    71     iVisiblePlugins = new (ELeave) CArrayPtrFlat<CGSPluginInterface>( KGSPluginArrayInitSize );
    70 
    72 
   104     delete iVisiblePlugins;
   106     delete iVisiblePlugins;
   105     if ( iListBox )
   107     if ( iListBox )
   106         {
   108         {
   107         delete iListBox;
   109         delete iListBox;
   108         }
   110         }
       
   111     delete iExt;
   109     __GSLOGSTRING( "[CGSParentContainer] ~CGSParentContainer()-|" );
   112     __GSLOGSTRING( "[CGSParentContainer] ~CGSParentContainer()-|" );
   110   }
   113   }
   111 
   114 
   112 
   115 
   113 // ---------------------------------------------------------------------------
   116 // ---------------------------------------------------------------------------
   155 
   158 
   156         // Adding plugin data to lbx has a lot of CGSPluginInterface API calls.
   159         // Adding plugin data to lbx has a lot of CGSPluginInterface API calls.
   157         // -> A good place to use quarantine to catch panicking plugins in
   160         // -> A good place to use quarantine to catch panicking plugins in
   158         // any of these calls.
   161         // any of these calls.
   159         #ifdef GS_ENABLE_WATCH_DOG
   162         #ifdef GS_ENABLE_WATCH_DOG
   160             iGSWatchDog->QuarantineL( plugin->Id() );
   163             iExt->iGSWatchDog->QuarantineL( plugin->Id() );
   161         #endif
   164         #endif
   162             
   165             
   163         if( plugin->Visible() )
   166         if( plugin->Visible() )
   164             {
   167             {
   165             AddPluginDataToLbxL( plugin,
   168             AddPluginDataToLbxL( plugin,
   166                                  iItemTextArray,
   169                                  iItemTextArray,
   167                                  icons,
   170                                  icons,
   168                                  iconCounter );
   171                                  iconCounter );
   169             }
   172             }
   170         #ifdef GS_ENABLE_WATCH_DOG
   173         #ifdef GS_ENABLE_WATCH_DOG
   171             iGSWatchDog->RemoveFromQuarantineL( plugin->Id() );
   174             iExt->iGSWatchDog->RemoveFromQuarantineL( plugin->Id() );
   172         #endif
   175         #endif
   173         }
   176         }
   174 
   177 
   175     // 2) Replace old icon array if needed.
   178     // 2) Replace old icon array if needed.
   176     switch( iListBoxType )
   179     switch( iListBoxType )
   537                 {
   540                 {
   538                 // Negative listbox value -> no item selected? 
   541                 // Negative listbox value -> no item selected? 
   539                 break;
   542                 break;
   540                 }
   543                 }
   541             
   544             
       
   545            if(iExt->iDblClickPreventer->IsActive())
       
   546                {
       
   547                break;
       
   548                }
       
   549            iExt->iDblClickPreventer->Start();
   542             CGSPluginInterface* selectedPlugin = iVisiblePlugins->operator[](
   550             CGSPluginInterface* selectedPlugin = iVisiblePlugins->operator[](
   543                 aListBox->CurrentItemIndex() );
   551                 aListBox->CurrentItemIndex() );
   544 
   552 
   545             // Different command is used depending on the plugin type.
   553             // Different command is used depending on the plugin type.
   546             switch( selectedPlugin->ItemType() )
   554             switch( selectedPlugin->ItemType() )