# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274779772 -10800 # Node ID 137ebc85284b17a56611f8914f1727ca85f982e5 # Parent 7be2816dbabda49e15619ec9b67b586f81fec4db Revision: 201019 Kit: 2010121 diff -r 7be2816dbabd -r 137ebc85284b homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h --- a/homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h Tue May 11 16:02:39 2010 +0300 +++ b/homescreen_plat/hs_renderingplugin_api/inc/xnextrenderingpluginadapter.h Tue May 25 12:29:32 2010 +0300 @@ -35,9 +35,52 @@ * process. Power save mode must be obeyed in order to maximize * the standby times of the device. * - * * @code - * + * // External rendering plug-in mandatory functions + * T_RenderingPlugin* T_RenderingPlugin::NewL() + * { + * T_RenderingPlugin* self = T_RenderingPlugin::NewLC(); + * CleanupStack::Pop( self ); + * return self; + * } + * // + * T_RenderingPlugin* T_RenderingPlugin::NewLC() + * { + * T_RenderingPlugin* self = new( ELeave ) T_RenderingPlugin(); + * CleanupStack::PushL( self ); + * self->ConstructL(); + * return self; + * } + * // + * T_RenderingPlugin::~T_RenderingPlugin() + * { + * } + * // + * T_RenderingPlugin::T_RenderingPlugin() + * { + * // Do nothing + * } + * // + * void T_RenderingPlugin::ConstructL() + * { + * } + * // + * const TImplementationProxy KImplementationTable[] = + * { + * #ifdef __EABI__ + * IMPLEMENTATION_PROXY_ENTRY( 0x22334455, T_RenderingPlugin::NewL ) + * #else + * { { 0x22334455 }, T_RenderingPlugin::NewL } + * #endif + * }; + * // + * EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + * TInt& aTableCount ) + * { + * aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy ); + * return KImplementationTable; + * } + * * @endcode * * @lib extrenderingplugin.lib diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml --- a/idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/root_2001f482/conf/root2001f482.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.confml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.confml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.confml Tue May 25 12:29:32 2010 +0300 @@ -1,97 +1,56 @@ - - - - + + + Maximum widget amount in Homescreen 1 page. Customizable - + + Not customizable! + + Not customizable! - - Not customizable! - - + Not customizable! - + Path of the Wallpaper resource. Customizable. - + Not customizable! - + Not customizable! - + Widgets in the Homescreen 1 - - Widget name - - \ No newline at end of file diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.gcfml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48b.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,38 @@ + + + + + + + + + True configures ${HomescreenPlugins_1.Plugins} = {% mapBundleIds(@{DFSFeatures.HomescreenWidgets}, @{HomescreenPlugins_1.Plugins}) %} + +import logging +#logger = logging.getLogger('cone.homescreen3') +def mapBundleIds(dfswidgets, plugins): + # create a uid-bundle dictionary + dict = {} + #logger.debug('ws %s' % dfswidgets.value) + for widget in dfswidgets.value: + dict[widget[dfswidgets._order.index('Uid')].lower()] = widget[dfswidgets._order.index('Bundle')] + + #logger.debug('d %s' % dict) + new_plugins = [] + for plugin in plugins.value: + # update bundle only if it's 0 or None + if plugin[plugins._order.index('Uid')] is not None and (plugin[plugins._order.index('BundleIdentifier')] == '0' or plugin[plugins._order.index('BundleIdentifier')] == None): + bundle = dict.get(plugin[plugins._order.index('Uid')].lower()) + if bundle is not None: + #logger.debug('Bundle id updated %s' % bundle) + plugin[plugins._order.index('BundleIdentifier')] = bundle + new_plugins.append(plugin) + + return new_plugins + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.gcfml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bmanifest.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.gcfml --- a/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_2001f48b/conf/view2001f48bxuikon.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + + + + + + + + + + True configures ${HomescreenPlugins_2.Plugins} = {% mapBundleIds(@{DFSFeatures.HomescreenWidgets}, @{HomescreenPlugins_2.Plugins}) %} + +import logging +#logger = logging.getLogger('cone.homescreen3') +def mapBundleIds(dfswidgets, plugins): + # create a uid-bundle dictionary + dict = {} + #logger.debug('ws %s' % dfswidgets.value) + for widget in dfswidgets.value: + dict[widget[dfswidgets._order.index('Uid')].lower()] = widget[dfswidgets._order.index('Bundle')] + + #logger.debug('d %s' % dict) + new_plugins = [] + for plugin in plugins.value: + # update bundle only if it's 0 or None + if plugin[plugins._order.index('Uid')] is not None and (plugin[plugins._order.index('BundleIdentifier')] == '0' or plugin[plugins._order.index('BundleIdentifier')] == None): + bundle = dict.get(plugin[plugins._order.index('Uid')].lower()) + if bundle is not None: + #logger.debug('Bundle id updated %s' % bundle) + plugin[plugins._order.index('BundleIdentifier')] = bundle + new_plugins.append(plugin) + + return new_plugins + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.gcfml --- a/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4manifest.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.gcfml --- a/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_200286e4/conf/view200286e4xuikon.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + + + + + + + + + + True configures ${HomescreenPlugins_3.Plugins} = {% mapBundleIds(@{DFSFeatures.HomescreenWidgets}, @{HomescreenPlugins_3.Plugins}) %} + +import logging +#logger = logging.getLogger('cone.homescreen3') +def mapBundleIds(dfswidgets, plugins): + # create a uid-bundle dictionary + dict = {} + #logger.debug('ws %s' % dfswidgets.value) + for widget in dfswidgets.value: + dict[widget[dfswidgets._order.index('Uid')].lower()] = widget[dfswidgets._order.index('Bundle')] + + #logger.debug('d %s' % dict) + new_plugins = [] + for plugin in plugins.value: + # update bundle only if it's 0 or None + if plugin[plugins._order.index('Uid')] is not None and (plugin[plugins._order.index('BundleIdentifier')] == '0' or plugin[plugins._order.index('BundleIdentifier')] == None): + bundle = dict.get(plugin[plugins._order.index('Uid')].lower()) + if bundle is not None: + #logger.debug('Bundle id updated %s' % bundle) + plugin[plugins._order.index('BundleIdentifier')] = bundle + new_plugins.append(plugin) + + return new_plugins + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.gcfml --- a/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5manifest.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.gcfml --- a/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.gcfml Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/data/qhd_tch/view_200286e5/conf/view200286e5xuikon.gcfml Tue May 25 12:29:32 2010 +0300 @@ -1,5 +1,10 @@ + + + + + InParamListL(); CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); // Compose Liw message TLiwGenericParam restoreTypeParam; - restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KAll ) ); + restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KRestoreViews ) ); + restoreTypeParam.PushL(); + inParamList.AppendL( restoreTypeParam ); + CleanupStack::Pop( &restoreTypeParam ); + restoreTypeParam.Reset(); + + iHspsInterface->ExecuteCmdL( KHSPSCommandRestoreConfigurations, + inParamList, + outParamList ); + + inParamList.Reset(); + + // check success + const TLiwGenericParam* outParam = NULL; + TInt pos(0); + outParam = outParamList.FindFirst( pos, KOutKeyStatus ); + TInt status(KErrGeneral); + + if ( outParam ) + { + status = outParam->Value().AsTInt32(); + } + outParamList.Reset(); + return status; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CHspsWrapper::RestoreRomConfL() + { + CLiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL(); + + // Compose Liw message + TLiwGenericParam restoreTypeParam; + restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KRestoreRom ) ); restoreTypeParam.PushL(); inParamList.AppendL( restoreTypeParam ); CleanupStack::Pop( &restoreTypeParam ); @@ -828,7 +865,7 @@ // Compose Liw message TLiwGenericParam restoreTypeParam; - restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KActive ) ); + restoreTypeParam.SetNameAndValueL( KRestore, TLiwVariant( KRestoreDefault ) ); restoreTypeParam.PushL(); inParamList.AppendL( restoreTypeParam ); CleanupStack::Pop( &restoreTypeParam ); diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/widgetmanager/src/wmmaincontainer.cpp --- a/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp Tue May 25 12:29:32 2010 +0300 @@ -1224,8 +1224,17 @@ if ( iFindbox && !iFindPaneIsVisible && iWidgetsList->Model()->NumberOfItems() > KMinWidgets ) { - // reset focus - ResetFocus(); + // set focus + if ( iWidgetsList->ItemDrawer()->Flags() + & CListItemDrawer::ESingleClickDisabledHighlight ) + { + ResetFocus(); + } + else + { + iWidgetsList->SetFocus( ETrue, EDrawNow ); + } + // set column filter flag TBitFlags32 bitFlag; @@ -1296,7 +1305,16 @@ m->RemoveFilter(); } - ResetFocus(); + //set focus + if ( iWidgetsList->ItemDrawer()->Flags() + & CListItemDrawer::ESingleClickDisabledHighlight ) + { + ResetFocus(); + } + else + { + iWidgetsList->SetFocus( ETrue, EDrawNow ); + } iFindbox->MakeVisible( EFalse ); iFindPaneIsVisible = EFalse; @@ -1488,6 +1506,19 @@ { AddWidgetToHomeScreenL(); } + else + { + if ( iWidgetsList->ItemDrawer()->Flags() + & CListItemDrawer::ESingleClickDisabledHighlight ) + { + ResetFocus(); + } + else + { + iWidgetsList->SetFocus( ETrue, EDrawNow ); + UpdateFocusMode(); + } + } } } diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/inc/xneditor.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xneditor.h Tue May 25 12:29:32 2010 +0300 @@ -281,9 +281,9 @@ RPointerArray< CHsContentInfo >& aWidgets ); /** - * Resets runtime cache. + * Resets pluging configurations and templated publishers. */ - void ResetCache(); + void ResetPluginsAndPublishers(); /** * Retrieves native application configuration plugins from HSPS @@ -311,6 +311,9 @@ */ TBool IsViewFull( CXnViewData& aViewData ); + /** callback for notify widget launcher */ + static TInt WidgetListChangedCallBack( TAny* aSelf ); + private: // from MXnViewObserver @@ -336,6 +339,8 @@ void NotifyWidgetRegisteredL(); + void NotifyWidgetUpdatedL(); + private: // from MHspsWrapperObserver @@ -362,9 +367,12 @@ TBool iWidgetsVisibilityState; /** Central repository , to choose plugin, owned*/ CRepository* iRepository; - /** Plugins cache, owned */ - RPointerArray< hspswrapper::CPluginInfo > iPluginsCache; + /** Widget/template plugin configurations, owned */ + RPointerArray< hspswrapper::CPluginInfo > iPluginConfigurations; + /** Oom handler, owned. */ CXnOomSysHandler* iOomSysHandler; + /** Launcher for notifying widget updates */ + CPeriodic* iNotifyWidgetUpdate; }; #endif // C_XNEDITOR_H diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnpopupcontroladapter.h Tue May 25 12:29:32 2010 +0300 @@ -102,11 +102,15 @@ */ void HandleScreenDeviceChangedL(); + /* + * Closes stylus popup menu if it is open + */ + void HideMenuL(); + private: // New functions void PopulateMenuL( CXnPluginData& aPlugin, CXnNode* aItem ); void ShowMenuL( CXnPluginData& aPlugin, TPoint aPosition ); - void HideMenuL(); private: // Data diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h --- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h Tue May 25 12:29:32 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: View control adater. +* Description: View control adapter * */ @@ -27,9 +27,7 @@ // Forward declarations class CXnNodePluginIf; -class CXnBackgroundManager; class CXnAppUiAdapter; -class CXnViewFlicker; // Class declaration /** @@ -75,18 +73,12 @@ // new functions /** - * Resets grabbing + * Resets pointer grabbing * * @since S60 5.2 */ void ResetGrabbing(); - -private: - // new functions - - void RemoveGrabbingControL( - const CCoeControl* aControl, const TPointerEvent& aEvent ) const; - + private: // from MXnUiStateObserver @@ -125,10 +117,8 @@ CXnNodePluginIf& iNode; /** AppUi */ CXnAppUiAdapter& iAppUi; - /** stored point of EButton1Down */ - TPoint iHitpoint; }; -#endif // _XNVIEWCONTROLADAPTER_H +#endif // _XNVIEWCONTROLADAPTER_H // End of File diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp Tue May 25 12:29:32 2010 +0300 @@ -3791,12 +3791,22 @@ { CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >( appui.ViewManager().ActiveViewData().ViewNode()->Control() ); - - control->IgnoreEventsUntilNextPointerUp(); + control->ResetGrabbing(); + +#ifdef RD_TACTILE_FEEDBACK + MTouchFeedback* feedback( MTouchFeedback::Instance() ); + + if ( feedback ) + { + feedback->InstantFeedback( iAdapter, ETouchFeedbackBasic, + ETouchFeedbackVibra, TPointerEvent() ); + + } +#endif } - // Indicate long tap has taken place + // Indicate long tap has taken place iLongtap = ETrue; CXnNode* hold = BuildTriggerNodeL( *engine, diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Tue May 25 12:29:32 2010 +0300 @@ -57,6 +57,7 @@ #include "xnviewdata.h" #include "xnwallpaperview.h" #include "xnbackgroundmanager.h" +#include "xnpopupcontroladapter.h" #include "xneditor.h" #include "xnpanic.h" @@ -92,6 +93,8 @@ ECanBeRemoved }; +const TInt KNotifyWidgetUpdateDelay( 1000000 ); //1sec + // ====================== LOCAL FUNTION PROTOTYPES ============================ static void DeletePluginInfos( TAny* aObject ); static void DeleteItemMaps( TAny* aObject ); @@ -309,6 +312,7 @@ iHspsWrapper = CHspsWrapper::NewL( aUid, this ); iRepository= CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) ); iOomSysHandler = CXnOomSysHandler::NewL(); + iNotifyWidgetUpdate = CPeriodic::New( CActive::EPriorityIdle ); } // --------------------------------------------------------------------------- @@ -317,10 +321,16 @@ // CXnEditor::~CXnEditor() { + if ( iNotifyWidgetUpdate->IsActive() ) + { + iNotifyWidgetUpdate->Cancel(); + } + delete iNotifyWidgetUpdate; + iViewManager.RemoveObserver( *this ); - if( iPluginsCache.Count() ) + if( iPluginConfigurations.Count() ) { - iPluginsCache.ResetAndDestroy(); + iPluginConfigurations.ResetAndDestroy(); } delete iCpsWrapper; delete iHspsWrapper; @@ -609,6 +619,18 @@ } if( ui ) { + CXnNode* popup( iViewManager.UiEngine().StylusPopupNode() ); + if ( popup ) + { + CXnPopupControlAdapter* control = + static_cast< CXnPopupControlAdapter* >( + popup->Control() ); + + if ( control ) + { + control->HideMenuL(); + } + } ui->SetContentController( this ); ui->Activate(); @@ -872,11 +894,10 @@ void CXnEditor::CpsWidgetPluginsL( RPointerArray< CHsContentInfo >& aWidgets ) { // Get publishers from CPS + delete iPublisherMap; + iPublisherMap = NULL; - if( !iPublisherMap ) - { - iPublisherMap = iCpsWrapper->GetTemplatedPublishersL(); - } + iPublisherMap = iCpsWrapper->GetTemplatedPublishersL(); RPointerArray< CPublisherInfo >& publisherInfo( iPublisherMap->PublisherInfo() ); @@ -885,13 +906,13 @@ { CPublisherInfo* info( publisherInfo[i] ); - for ( TInt j = 0; j < iPluginsCache.Count(); j++ ) + for ( TInt j = 0; j < iPluginConfigurations.Count(); j++ ) { - if( iPluginsCache[j]->Name().Length() > 0 ) + if( iPluginConfigurations[j]->Name().Length() > 0 ) { // 8 to 16bit conv - HBufC* nameBuf = HBufC::NewLC( iPluginsCache[j]->Name().Length() ); - nameBuf->Des().Copy( iPluginsCache[j]->Name() ); + HBufC* nameBuf = HBufC::NewLC( iPluginConfigurations[j]->Name().Length() ); + nameBuf->Des().Copy( iPluginConfigurations[j]->Name() ); TBool matchingNames = ( nameBuf->Des() == info->TemplateType() ); CleanupStack::PopAndDestroy(); if ( matchingNames ) @@ -903,8 +924,8 @@ contentInfo->SetNameL( info->WidgetName() ); contentInfo->SetPublisherIdL( info->PublisherId() ); contentInfo->SetMaxWidgets( info->MaxWidgets() ); - contentInfo->SetUidL( iPluginsCache[j]->Uid() ); - contentInfo->SetTypeL( iPluginsCache[j]->Type() ); + contentInfo->SetUidL( iPluginConfigurations[j]->Uid() ); + contentInfo->SetTypeL( iPluginConfigurations[j]->Type() ); contentInfo->SetDescriptionL( info->Description() ); contentInfo->SetIconPathL( info->LogoIcon() ); contentInfo->SetIsWrt( info->ContentType() == KWRTTemplate() ); @@ -1328,7 +1349,7 @@ // void CXnEditor::NotifyWidgetUnregisteredL( const TDesC& aPublisher ) { - ResetCache(); + ResetPluginsAndPublishers(); RemoveUnRegisteredWidgetL( aPublisher ); WidgetListChanged(); } @@ -1339,11 +1360,46 @@ // void CXnEditor::NotifyWidgetRegisteredL() { - ResetCache(); + ResetPluginsAndPublishers(); WidgetListChanged(); } // --------------------------------------------------------------------------- +// CXnEditor::NotifyWidgetUpdatedL +// --------------------------------------------------------------------------- +// +void CXnEditor::NotifyWidgetUpdatedL() + { + if ( iNotifyWidgetUpdate->IsActive() ) + { + iNotifyWidgetUpdate->Cancel(); + } + // start waiting for widget updates (wait time is 1sec). + // if no new updates, notify views about changes. otherwise + // start waiting for new updates again. + iNotifyWidgetUpdate->Start( + KNotifyWidgetUpdateDelay, + KNotifyWidgetUpdateDelay, + TCallBack( WidgetListChangedCallBack, this ) ); + } + +// --------------------------------------------------------------------------- +// CXnEditor::WidgetListChangedCallBack +// --------------------------------------------------------------------------- +// +TInt CXnEditor::WidgetListChangedCallBack( TAny* aSelf ) + { + CXnEditor* editor = static_cast( aSelf ); + if ( editor && editor->iNotifyWidgetUpdate->IsActive() ) + { + // prevent multiple events + editor->iNotifyWidgetUpdate->Cancel(); + editor->WidgetListChanged(); + } + return KErrNone; + } + +// --------------------------------------------------------------------------- // CXnEditor::NotifyViewDeactivatedL // --------------------------------------------------------------------------- // @@ -1403,7 +1459,7 @@ { if ( aEvent == KEventPluginUnInstalled ) { - ResetCache(); + ResetPluginsAndPublishers(); CHsContentInfo* info = CHsContentInfo::NewLC(); @@ -1422,13 +1478,13 @@ } else if ( aEvent == KEventPluginInstalled ) { - ResetCache(); + ResetPluginsAndPublishers(); WidgetListChanged(); } else if ( aEvent == KEventPluginUpdated ) { - ResetCache(); + ResetPluginsAndPublishers(); // If the plugin is in use then reload the widget if ( aPluginId.Length() > 0 ) @@ -1540,13 +1596,13 @@ } // ----------------------------------------------------------------------------- -// CXnEditor::ResetCache +// CXnEditor::ResetPluginsAndPublishers // ----------------------------------------------------------------------------- // -void CXnEditor::ResetCache() +void CXnEditor::ResetPluginsAndPublishers() { // Force loading of widget/template plugin configurations - iPluginsCache.ResetAndDestroy(); + iPluginConfigurations.ResetAndDestroy(); // Forece reloading of CPS publishers delete iPublisherMap; @@ -1596,19 +1652,19 @@ __ASSERT_DEBUG( aWidgets.Count() == 0, User::Leave( KErrGeneral ) ); // If widget/template plugins haven't been fetched yet - if( iPluginsCache.Count() == 0 ) + if( iPluginConfigurations.Count() == 0 ) { // Fetch the plugins into the runtime cache TRAPD( err, DoHspsWidgetPluginsL() ); if( err ) { - ResetCache(); + ResetPluginsAndPublishers(); User::LeaveIfError( err ); } } // Append plugins to the content info array - AppendPluginsL( iPluginsCache, aWidgets ); + AppendPluginsL( iPluginConfigurations, aWidgets ); } // ----------------------------------------------------------------------------- @@ -1617,8 +1673,8 @@ // void CXnEditor::DoHspsWidgetPluginsL() { - iHspsWrapper->GetPluginsL( iPluginsCache, KPluginInterface, KKeyWidget ); - iHspsWrapper->GetPluginsL( iPluginsCache, KPluginInterface, KKeyTemplate ); + iHspsWrapper->GetPluginsL( iPluginConfigurations, KPluginInterface, KKeyWidget ); + iHspsWrapper->GetPluginsL( iPluginConfigurations, KPluginInterface, KKeyTemplate ); } // ----------------------------------------------------------------------------- diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnpopupcontroladapter.cpp Tue May 25 12:29:32 2010 +0300 @@ -19,7 +19,6 @@ #include #include #include -#include #include // User includes @@ -145,6 +144,8 @@ iNode = &aNode.Node(); iUiEngine = iNode->UiEngine(); + + iMenuShown = EFalse; } // ----------------------------------------------------------------------------- @@ -341,17 +342,9 @@ CXnNode* plugin( aPlugin.Owner()->LayoutNode() ); iUiEngine->Editor()->SetTargetPlugin( plugin ); - - if ( AknLayoutUtils::LayoutMirrored() ) - { - iStylusPopupMenu->SetPosition( aPosition, - CAknStylusPopUpMenu::EPositionTypeRightBottom ); - } - else - { - iStylusPopupMenu->SetPosition( aPosition, - CAknStylusPopUpMenu::EPositionTypeLeftBottom ); - } + + iStylusPopupMenu->SetPosition( aPosition, + CAknStylusPopUpMenu::EPositionTypeRightBottom ); iStylusPopupMenu->ShowMenu(); iMenuShown = ETrue; @@ -375,4 +368,5 @@ } } + // End of file diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp Tue May 25 12:29:32 2010 +0300 @@ -591,6 +591,17 @@ CXnNode* node( aContainer.Node()->LayoutNode() ); + CXnDomStringPool* sp( node->DomNode()->StringPool() ); + + CXnProperty* prop = CXnProperty::NewL( + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KBlock, + CXnDomPropertyValue::EString, *sp ); + CleanupStack::PushL( prop ); + + node->SetPropertyWithoutNotificationL( prop ); + CleanupStack::Pop( prop ); + node->ReportXuikonEventL( *iActivate ); if ( iFlags.IsSet( EIsInCall ) ) @@ -731,15 +742,26 @@ // Run controls to powersave mode ChangeControlsStateL( EFalse ); + CXnNode* node( iContainer->Node()->LayoutNode() ); + + CXnDomStringPool* sp( node->DomNode()->StringPool() ); + + CXnProperty* prop = CXnProperty::NewL( + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KNone, + CXnDomPropertyValue::EString, *sp ); + CleanupStack::PushL( prop ); + + node->SetPropertyWithoutNotificationL( prop ); + CleanupStack::Pop( prop ); + if ( !iDeactivate ) { iDeactivate = BuildDeactivateTriggerL( iAppUiAdapter.UiEngine() ); } - - CXnNode* node( iContainer->Node()->LayoutNode() ); - + node->ReportXuikonEventL( *iDeactivate ); - + if ( aHide ) { node->Control()->MakeVisible( EFalse ); diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp Tue May 25 12:29:32 2010 +0300 @@ -11,29 +11,53 @@ * * Contributors: * -* Description: Implementation for wrapper for a box +* Description: View control adapter * */ // System includes -#include -#include // User includes #include "xnappuiadapter.h" #include "xnuiengine.h" +#include "xnnodepluginif.h" #include "xnnode.h" + +#include "xndomdocument.h" #include "xndomnode.h" -#include "xnnodepluginif.h" #include "xnproperty.h" -#include "xnviewadapter.h" -#include "xnbackgroundmanager.h" -#include "xnviewdata.h" -#include "xnviewmanager.h" + #include "xnviewcontroladapter.h" // Constants +// ============================ LOCAL FUNCTIONS ================================ +// ----------------------------------------------------------------------------- +// ResetGrabbingL +// Removes recursively grabbing controls +// ----------------------------------------------------------------------------- +// +static void ResetGrabbingL( CXnControlAdapter* aControl, + const TPointerEvent& aEvent ) + { + if ( aControl ) + { + CCoeControl* grabber( aControl->GrabbingComponent() ); + + if ( grabber ) + { + grabber->IgnoreEventsUntilNextPointerUp(); + + aControl->CCoeControl::HandlePointerEventL( aEvent ); + + CXnControlAdapter* adapter = + dynamic_cast< CXnControlAdapter* >( grabber ); + + ResetGrabbingL( adapter, aEvent ); + } + } + } + // ============================ MEMBER FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -77,6 +101,18 @@ SetComponentsToInheritVisibility( ETrue ); iAppUi.UiStateListener().AddObserver( *this ); + + // By default all views are invisible during construction phase + CXnDomStringPool* sp( aNode.Node().DomNode()->StringPool() ); + + CXnProperty* prop = CXnProperty::NewL( + XnPropertyNames::style::common::KDisplay, + XnPropertyNames::style::common::display::KNone, + CXnDomPropertyValue::EString, *sp ); + CleanupStack::PushL( prop ); + + aNode.SetPropertyWithoutNotificationL( prop ); + CleanupStack::Pop( prop ); } // ----------------------------------------------------------------------------- @@ -85,8 +121,7 @@ // ----------------------------------------------------------------------------- // CXnViewControlAdapter::CXnViewControlAdapter( CXnNodePluginIf& aNode ) - : iNode( aNode ), iAppUi( static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ) ), - iHitpoint( TPoint( -1,-1 ) ) + : iNode( aNode ), iAppUi( static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ) ) { } @@ -146,14 +181,9 @@ // void CXnViewControlAdapter::HandlePointerEventL( const TPointerEvent& aPointerEvent ) - { - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - iHitpoint = aPointerEvent.iPosition; - } - + { iAppUi.UiEngine().DisableRenderUiLC(); - + CXnControlAdapter::HandlePointerEventL( aPointerEvent ); iAppUi.UiEngine().RenderUIL(); @@ -169,33 +199,13 @@ void CXnViewControlAdapter::ResetGrabbing() { TPointerEvent event; + + event.iModifiers = 0; + event.iPosition = TPoint(); + event.iParentPosition = TPoint(); event.iType = TPointerEvent::EButton1Up; - TRAP_IGNORE( RemoveGrabbingControL( this, event ) ); - - iHitpoint.SetXY( -1, -1 ); - } - -// ----------------------------------------------------------------------------- -// CXnViewControlAdapter::RemoveGrabbingControL() -// Removes recursively grabbing controls -// ----------------------------------------------------------------------------- -// -void CXnViewControlAdapter::RemoveGrabbingControL( const CCoeControl* aControl, - const TPointerEvent& aEvent ) const - { - TInt count( aControl->CountComponentControls() ); - - for( TInt i = 0; i < count; i++ ) - { - CCoeControl* child( aControl->ComponentControl( i ) ); - - if( child && child->Rect().Contains( iHitpoint ) ) - { - child->CCoeControl::HandlePointerEventL( aEvent ); - RemoveGrabbingControL( child, aEvent ); - } - } + TRAP_IGNORE( ResetGrabbingL( this, event ) ); } // ----------------------------------------------------------------------------- diff -r 7be2816dbabd -r 137ebc85284b idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Tue May 11 16:02:39 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp Tue May 25 12:29:32 2010 +0300 @@ -66,7 +66,8 @@ const TInt KStabilityInterval( 60000000 ); // 1 minute const TInt KActivationCompleteInterval( 2000000 ); // 2s const TInt KCrashRestoreDefaultThreshold( 3 ); -const TInt KCrashRestoreAllTreshold( 4 ); +const TInt KCrashRestoreRomTreshold( 4 ); +const TInt KCrashRestoreViewsTreshold( 5 ); // ============================ LOCAL FUNCTIONS =============================== // ----------------------------------------------------------------------------- @@ -1791,10 +1792,14 @@ query->RunLD(); } - else if( crashCount >= KCrashRestoreAllTreshold ) - { - iHspsWrapper->RestoreRootL(); - + else if( crashCount == KCrashRestoreRomTreshold ) + { + iHspsWrapper->RestoreRomConfL(); + } + else if( crashCount >= KCrashRestoreViewsTreshold ) + { + iHspsWrapper->RestoreViewsL(); + ResetCrashCount(); return; } diff -r 7be2816dbabd -r 137ebc85284b menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvalueimage.cpp --- a/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvalueimage.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/hierarchynavigator/hnmetadatamodel/src/hnmdvalueimage.cpp Tue May 25 12:29:32 2010 +0300 @@ -278,11 +278,25 @@ { DEBUG16(("_MM_: CHnMdValueImage::FindMatchigMifFileL IN")); + _LIT( KGridRootMif, "gridroot.mif" ); + // whole path to the mif file was not specified TDriveList driveList; HBufC* ret = NULL; - if ( KErrNone == aFs.DriveList( driveList ) ) + if ( aFileName == KGridRootMif ) + { + ret = HBufC::NewL( + 1 + KRscPath().Length() + // 1 - drive letter len. + aFileName.Length() ); + TPtr ptr( ret->Des() ); + TChar driveLetter; + aFs.DriveToChar( EDriveZ, driveLetter ); + ptr.Append( driveLetter ); + ptr.Append( KRscPath ); + ptr.Append( aFileName ); + } + else if ( KErrNone == aFs.DriveList( driveList ) ) { TInt driveNumber( EDriveY ); // start with drive Y do // iterates through drives: Y, X, W, ..., C, B, A, Z @@ -336,15 +350,18 @@ CleanupClosePushL( tmpBuf ); TInt errCode = HnLiwUtils::GetStringL( *iParamList, iMifFile8, iPos, tmpBuf ); - if ( !BaflUtils::FileExists( iCmnPtrs->iFs, tmpBuf ) && tmpBuf.Length() ) + if ( tmpBuf.Length() ) { - // fileName was retrieved but corresponding file was not found - ret = FindMatchigMifFileL( iCmnPtrs->iFs, tmpBuf ); - } - else if ( tmpBuf.Length() ) - { - // return fileName as it is - ret = tmpBuf.AllocL(); + if ( BaflUtils::FileExists( iCmnPtrs->iFs, tmpBuf ) ) + { + // return fileName as it is + ret = tmpBuf.AllocL(); + } + else + { + // fileName was retrieved but corresponding file was not found + ret = FindMatchigMifFileL( iCmnPtrs->iFs, tmpBuf ); + } } // clean up diff -r 7be2816dbabd -r 137ebc85284b menufw/hierarchynavigator/hnpresentationmodel/inc/hnextbmpiconholder.h --- a/menufw/hierarchynavigator/hnpresentationmodel/inc/hnextbmpiconholder.h Tue May 11 16:02:39 2010 +0300 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hnextbmpiconholder.h Tue May 25 12:29:32 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -26,7 +26,7 @@ /** * This is an extended version of @c CHnIconHolder which holds a CGulIcon that does * not own the bitmaps and CLiwBitmapBuffer objects that do. - * + * * Such class was needed because some of the bitmaps for icons are obtained from * CLiwBitmapBuffer objects and there is no way to transfer ownership of that * bitmaps from them. It is not possible to make copies of that bitmaps either, @@ -40,26 +40,32 @@ * This method should be called only once. If you want to store another icon * simply call Close() on this icon holder and then create a new icon holder * to store the new icon. - * + * * @param aGulIcon Icon to store in this icon holder. * @param aBmpBuffer The buffer that owns the primary bitmap. - * @param aMaskBuffer The buffer that owns the mask bitmap. + * @param aMaskBuffer The buffer that owns the mask bitmap. */ IMPORT_C void SetGulIcon( CGulIcon* aGulIcon, CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer ); - + + /** + * Clean both liw bitmap buffer and liw maskbitmap buffer. + * Allows set new mask and new bitmap for the icon. + */ + virtual void CleanBmpBuffer(); + /** * Standard C++ virtual destructor. */ virtual ~CHnExtBmpIconHolder(); private: // data - + /** * Liw bitmap buffer that owns the primary bitmap for the icon. * Co-owns (CLiwBitmapBuffer are ref-counted). */ CLiwBitmapBuffer* iBmpBuffer; - + /** * Liw bitmap buffer that owns the mask bitmap for the icon. * Co-owns (CLiwBitmapBuffer are ref-counted). diff -r 7be2816dbabd -r 137ebc85284b menufw/hierarchynavigator/hnpresentationmodel/inc/hniconholder.h --- a/menufw/hierarchynavigator/hnpresentationmodel/inc/hniconholder.h Tue May 11 16:02:39 2010 +0300 +++ b/menufw/hierarchynavigator/hnpresentationmodel/inc/hniconholder.h Tue May 25 12:29:32 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -39,25 +39,25 @@ * This method should be called only once. If you want to store another icon * simply call Close() on this icon holder and then create a new icon holder * to store the new icon. - * + * * @param aGulIcon Icon to store in this icon holder. */ IMPORT_C void SetGulIcon( CGulIcon* aGulIcon ); - + /** * Returns the icon held by this icon holder. - * + * * @return Icon held by this object (NULL value possible). */ IMPORT_C CGulIcon* GetGulIcon() const; - + /** * Standard C++ destructor. */ ~CHnIconHolder(); - + private: // data - + /** * A CGulIcon object owned by this icon holder. * Can possibly be NULL. diff -r 7be2816dbabd -r 137ebc85284b menufw/hierarchynavigator/hnpresentationmodel/src/hnextbmpiconholder.cpp --- a/menufw/hierarchynavigator/hnpresentationmodel/src/hnextbmpiconholder.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hnextbmpiconholder.cpp Tue May 25 12:29:32 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -28,10 +28,10 @@ CLiwBitmapBuffer* aBmpBuffer, CLiwBitmapBuffer* aMaskBuffer ) { __ASSERT_DEBUG( aGulIcon && aBmpBuffer, User::Invariant() ); - + if ( aGulIcon ) { - __ASSERT_DEBUG( aGulIcon->BitmapsOwnedExternally(), User::Invariant() ); + __ASSERT_DEBUG( aGulIcon->BitmapsOwnedExternally(), User::Invariant() ); CHnIconHolder::SetGulIcon( aGulIcon ); aGulIcon->SetBitmapsOwnedExternally( ETrue ); if ( aBmpBuffer ) @@ -56,9 +56,27 @@ if ( iBmpBuffer ) { iBmpBuffer->DecRef(); - } + } if ( iMaskBuffer ) { iMaskBuffer->DecRef(); } } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CHnExtBmpIconHolder::CleanBmpBuffer() + { + if ( iBmpBuffer ) + { + iBmpBuffer->DecRef(); + iBmpBuffer = NULL; + } + if ( iMaskBuffer ) + { + iMaskBuffer->DecRef(); + iMaskBuffer = NULL; + } + } diff -r 7be2816dbabd -r 137ebc85284b menufw/hierarchynavigator/hnpresentationmodel/src/hniconholder.cpp --- a/menufw/hierarchynavigator/hnpresentationmodel/src/hniconholder.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/hierarchynavigator/hnpresentationmodel/src/hniconholder.cpp Tue May 25 12:29:32 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -37,7 +37,7 @@ { return iGulIcon; } - + // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/matrixmenu/src/mmappui.cpp --- a/menufw/menufwui/matrixmenu/src/mmappui.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/matrixmenu/src/mmappui.cpp Tue May 25 12:29:32 2010 +0300 @@ -12,8 +12,8 @@ * Contributors: * * Description: Application UI class -* Version : %version: MM_176.1.28.1.75 % << Don't touch! Updated by Synergy at check-out. -* Version : %version: MM_176.1.28.1.75 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.78 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_176.1.28.1.78 % << Don't touch! Updated by Synergy at check-out. * */ @@ -46,7 +46,7 @@ #include #include #include //stylus popup for long tap event -#include +#include #include "mmgui.hrh" #include "mmguiconstants.h" @@ -332,10 +332,13 @@ { //make dummy container visible when returning //to menu by AppKey - iDummyContainer->MakeVisible( ETrue ); - RefreshUiPanesL( ETrue ); - iCurrentContainer->MakeVisible( EFalse ); - iDummyContainer->DrawNow(); + if( iDummyContainer && iCurrentContainer ) + { + iDummyContainer->MakeVisible( ETrue ); + RefreshUiPanesL( ETrue ); + iCurrentContainer->MakeVisible( EFalse ); + iDummyContainer->DrawNow(); + } CleanupForExitL( EExitKeyApplication ); User::LeaveIfError( iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( CEikonEnv::Static()->RootWin().Identifier(), 0 ) ); @@ -1448,9 +1451,9 @@ RefreshCbaL(); iGarbage.ResetAndDestroy(); ResetContainerMap(); - iCurrentSuiteModel = NULL; - iCurrentContainer = NULL; - } + iCurrentSuiteModel = NULL; + iCurrentContainer = NULL; + } TRAPD( err, iHNInterface->LoadSuitesFromUriL( aMessage ) ); @@ -1806,9 +1809,10 @@ iToolbar->SetToolbarVisibility( EFalse ); } + TBool scrollView( EFalse ); if( iCurrentContainer != aWidgetContainer ) { - // During open new folder cancel longTap. + // During open new folder cancel longTap. if( iCurrentContainer && iCurrentContainer->IsEditMode() ) iCurrentContainer->EnableLongTapAnimation( EFalse ); @@ -1827,26 +1831,7 @@ { iCurrentContainer->SetHighlightVisibilityL( ETrue ); } - - // force scroll view to highlighted item in case we've been backing back - // and change presentation mode (to list view) had been done. - if( iCurrentContainer->WidgetType() == EListWidget ) - { - TInt offsetBottom = - iCurrentContainer->Widget()->View()->ItemPos( - iCurrentSuiteModel->GetSuiteHighlight() ).iY - + iCurrentContainer->Widget()->ItemHeight() - - iCurrentContainer->Widget()->View()->ViewRect().Height(); - TInt offsetTop = iCurrentContainer->Widget()->View()->ItemPos( - iCurrentSuiteModel->GetSuiteHighlight() ).iY; - TBool takeTop = Abs( offsetTop ) < Abs( offsetBottom ); - TInt offset = ( takeTop ) ? offsetTop : offsetBottom; - if( offset != 0 ) - { - iCurrentContainer->Widget()->HandlePhysicsScrollEventL( - offset ); - } - } + scrollView = ETrue; } else { @@ -1896,6 +1881,16 @@ // restore the correct widget position iCurrentContainer->RestoreWidgetPosition(); + // force scroll view to highlighted item in case we've been backing back + // and change presentation mode (to list view) had been done. + if( scrollView && iCurrentContainer->WidgetType() == EListWidget + && iCurrentSuiteModel->GetSuiteHighlight() > KErrNotFound + && !iCurrentContainer->ItemIsFullyVisible( + iCurrentSuiteModel->GetSuiteHighlight() )) + { + iCurrentContainer->ScrollToItemL( + iCurrentSuiteModel->GetSuiteHighlight() ); + } } // refresh changed items only diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h --- a/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h Tue May 25 12:29:32 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBoxItemDrawer -* Version : %version: MM_38.1.17 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_38.1.18 % << Don't touch! Updated by Synergy at check-out. * */ @@ -65,12 +65,12 @@ * @param aFormattedCellData Cell data. * @param aWidgetType Widget type. */ - static CMmListBoxItemDrawer* NewL( - CMmListBoxModel* aMmListBoxModel, - const CFont* aFont, - CFormattedCellListBoxData* aFormattedCellData, - TMmWidgetType aWidgetType, - CMmTemplateLibrary* aTemplateLibrary ); + static CMmListBoxItemDrawer* NewL( + CMmListBoxModel* aMmListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ); /** * Two-phased constructor. @@ -81,12 +81,12 @@ * @param aFormattedCellData Cell data. * @param aWidgetType Widget type. */ - static CMmListBoxItemDrawer* NewLC( - CMmListBoxModel* aMmListBoxModel, - const CFont* aFont, - CFormattedCellListBoxData* aFormattedCellData, - TMmWidgetType aWidgetType, - CMmTemplateLibrary* aTemplateLibrary ); + static CMmListBoxItemDrawer* NewLC( + CMmListBoxModel* aMmListBoxModel, + const CFont* aFont, + CFormattedCellListBoxData* aFormattedCellData, + TMmWidgetType aWidgetType, + CMmTemplateLibrary* aTemplateLibrary ); /** * Destructor. @@ -226,8 +226,8 @@ * @since S60 5.0 * @param aBgContext Background context. */ - void SetBgContext( - CAknsBasicBackgroundControlContext* aBgContext ); + void SetBgContext( + CAknsBasicBackgroundControlContext* aBgContext ); /** * Sets condition if background should be redrawn. @@ -458,7 +458,7 @@ * @since S60 v3.0 * @param aIsRunning Is scrollbar event running. */ - void SetScrollbarEventRunning( TBool aIsRunning ); + void SetScrollbarEventRunning( TBool aIsRunning ); /** * Sets number of columns in view. @@ -466,16 +466,16 @@ * @since S60 v3.0 * @param aNumberOfColumns Number of columns in view. */ - void SetNumberOfColsInView( TInt aNumberOfColumns ); + void SetNumberOfColsInView( TInt aNumberOfColumns ); - /** - * Used in non-touch edit mode to block drawing of move indicators and highlight - * to clean screen for animation. - * - * @since S60 v3.0 - * @param aDrawn Should highlight and move indicators be drawn. - */ - void SetHighlightShown( TBool aDrawn ); + /** + * Used in non-touch edit mode to block drawing of move indicators and highlight + * to clean screen for animation. + * + * @since S60 v3.0 + * @param aDrawn Should highlight and move indicators be drawn. + */ + void SetHighlightShown( TBool aDrawn ); /** * Draws background. @@ -512,8 +512,8 @@ * @param aItemIsSelected Is item selected. */ void DrawItemText( TInt aItemIndex, const TRect& aItemTextRect, - TBool aItemIsCurrent, TBool aViewIsEmphasized, - TBool aItemIsSelected ) const; + TBool aItemIsCurrent, TBool aViewIsEmphasized, + TBool aItemIsSelected ) const; /** * Draws the actual item contents for the specified item in the specified * rectangle. @@ -526,8 +526,8 @@ * @param aItemIsSelected @c ETrue if the item is selected. */ void DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect, - TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, - TBool aItemIsSelected) const; + TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed, + TBool aItemIsSelected) const; /** * Sets up item currently drawn item subcells. @@ -660,7 +660,7 @@ * @param aSubcellIncrement Is incremented if backdrop subcell template is appended. */ void SetupBackdropSubcellL( - RArray& aTemplateChildArray, TInt aItemIndex, + RArray& aTemplateChildArray, TInt aItemIndex, RBuf& aItemText, TInt& aSubcellIncrement ) const; /** @@ -674,8 +674,8 @@ * @param aSubcellIncrement Is incremented if backdrop subcell template is appended. */ void SetupIconSubcellL( - RArray& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, - RBuf& aItemText, TInt& aSubcellIncrement ) const; + RArray& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const; /** * Determines whether a bitmap of given size needs scaling to be displayed @@ -711,8 +711,8 @@ * @param aChildIndex Index of a template child. */ void SetupTextSubcellL( - RArray& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, - RBuf& aItemText, TInt& aSubcellIncrement ) const; + RArray& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex, + RBuf& aItemText, TInt& aSubcellIncrement ) const; /** * Appends text if there is enough free memory. @@ -742,7 +742,7 @@ * @return ETrue if highlight is drawn for the actually drawn item. */ TBool GetHighlightVisibility( TInt aItemIndex, - TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const; + TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem ) const; /** * Returns backdrop visibility. @@ -943,6 +943,11 @@ */ mutable TBool iLastDrawnItemWasFloating; - }; + /** + * ETrue if the drawing item is floating item of swap transition type. + */ + mutable TBool iIsSwapFloating; + + }; #endif // MMLISTBOXITEMDRAWER_H diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h --- a/menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/inc/mmlistboxmodel.h Tue May 25 12:29:32 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: CMmListBoxItemModel -* Version : %version: MM_18.1.4 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_18.1.5 % << Don't touch! Updated by Synergy at check-out. * */ @@ -43,133 +43,133 @@ NONSHARABLE_CLASS( CMmListBoxModel ): public CAknFilteredTextListBoxModel, public MHnSuiteObserver - { + { public: - // Constructors and destructor + // Constructors and destructor - /** - * Destructor. - */ - ~CMmListBoxModel(); + /** + * Destructor. + */ + ~CMmListBoxModel(); - /** - * Two-phased constructor. - */ - static CMmListBoxModel* NewL( ); + /** + * Two-phased constructor. + */ + static CMmListBoxModel* NewL( ); - /** - * Two-phased constructor. - */ - static CMmListBoxModel* NewLC( ); - - /** - * Gets the text attribute for a specific item by the name of the attribute. - * - * @since S60 v3.0 - * @param aIndex The index of the item for which the text is requested. - * @param aAttributeName The name of the text attribute to be returned. - * @return Size of item. - */ - const TDesC8& GetAttributeAsText( TInt aIndex, const TDesC8 & aAttributeName ); - + /** + * Two-phased constructor. + */ + static CMmListBoxModel* NewLC( ); + + /** + * Gets the text attribute for a specific item by the name of the attribute. + * + * @since S60 v3.0 + * @param aIndex The index of the item for which the text is requested. + * @param aAttributeName The name of the text attribute to be returned. + * @return Size of item. + */ + const TDesC8& GetAttributeAsText( TInt aIndex, const TDesC8 & aAttributeName ); + /** * Gets the graphical attribute for a specific item by the name of the attribute. * The attribute is returned as an icon holder. Please see @c CHnIconHolder for * infomation on what icon holder is and what * it is useful for. - * + * * @param aIndex The index of the item for which the graphic is requested. * @param aAttributeName The name of the graphical attribute to be returned. - * @param aDesiredIconSize The desired icon size. + * @param aDesiredIconSize The desired icon size. * @return An icon holder object. */ CHnIconHolder* GetAttributeAsRefCountedGraphics( TInt aIndex, const TDesC8& aAttributeName, TSize* aDesiredIconSize = NULL ); - - /** - * Sets the suite model. This method is used by matrix menu application when suite is loaded. - * - * @since S60 v3.0 - * @param aSuiteModel The suite model to be set. - */ - void SetSuiteModelL( CHnSuiteModel * aSuiteModel ); - - /** - * Gets the suite model of the currently visible suite. - * - * @since S60 v3.0 - * @return The current suite model. - */ - CHnSuiteModel* GetSuiteModel(); - - /** - * Reorders the model when item positions are edited in edit mode. - * - * @since S60 v3.0 - * @param aFromIndex The starting index of items to be shifted. - * @param aToIndex The end index of items to be shifted. - */ - void ReorderModelL(TInt aFromIndex, TInt aToIndex); - - /** - * Handle event triggered by suite. - * - * @since S60 v3.0 - * @param aCustomSuiteEvent Type of suite event. - * @param aModel The suite model that the event concerns. - */ - void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, + + /** + * Sets the suite model. This method is used by matrix menu application when suite is loaded. + * + * @since S60 v3.0 + * @param aSuiteModel The suite model to be set. + */ + void SetSuiteModelL( CHnSuiteModel * aSuiteModel ); + + /** + * Gets the suite model of the currently visible suite. + * + * @since S60 v3.0 + * @return The current suite model. + */ + CHnSuiteModel* GetSuiteModel(); + + /** + * Reorders the model when item positions are edited in edit mode. + * + * @since S60 v3.0 + * @param aFromIndex The starting index of items to be shifted. + * @param aToIndex The end index of items to be shifted. + */ + void ReorderModelL(TInt aFromIndex, TInt aToIndex); + + /** + * Handle event triggered by suite. + * + * @since S60 v3.0 + * @param aCustomSuiteEvent Type of suite event. + * @param aModel The suite model that the event concerns. + */ + void HandleSuiteEventL( THnCustomSuiteEvent aCustomSuiteEvent, CHnSuiteModel* aModel ); - + /** * Determines the number of item-specific menu items for given item. - * + * * @since S60 v3.0 * @param aItemIndex Item index. * @return Number of item-specific menu items. */ TInt GetNumberOfSpecificMenuItemsL( TInt aItemIndex ); - + private: - /** - * Gets the attribute by name. - * - * @since S60 v3.0 - * @param aIndex The index of the item for which the attribute is requested. - * @param aAttributeName The name of the requested attribute. - * @return Size of item. - */ + /** + * Gets the attribute by name. + * + * @since S60 v3.0 + * @param aIndex The index of the item for which the attribute is requested. + * @param aAttributeName The name of the requested attribute. + * @return Size of item. + */ CHnAttributeBase* GetAttribute( TInt aIndex, const TDesC8 & aAttributeName ); - - /** - * Updates the item text array when model is reordered or new model is loaded. - * It is important that the number of elements in the array is the same - * as number of items in the suite. - * - * @since S60 v3.0 - */ - void UpdateDummyArrayDataL(); + + /** + * Updates the item text array when model is reordered or new model is loaded. + * It is important that the number of elements in the array is the same + * as number of items in the suite. + * + * @since S60 v3.0 + */ + void UpdateDummyArrayDataL(); - + /** - * Constructor for performing 1st stage construction - */ - CMmListBoxModel( ); + * Constructor for performing 1st stage construction + */ + CMmListBoxModel( ); - /** - * Default symbian 2nd stage constructor. - */ - void ConstructL(); + /** + * Default symbian 2nd stage constructor. + */ + void ConstructL(); private: - + /** * Not own. Suite model being the container for the data. */ CHnSuiteModel* iSuiteModel; - - }; + + }; #endif // CMMLISTBOXMODEL_H diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/src/mmgrid.cpp --- a/menufw/menufwui/mmwidgets/src/mmgrid.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp Tue May 25 12:29:32 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_103 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_104 % << Don't touch! Updated by Synergy at check-out. * */ @@ -277,7 +277,7 @@ { TBool highlightWasVisible = parent->IsHighlightVisible(); CAknGrid::HandlePointerEventL( aPointerEvent ); - // Tricky: Do not allow the base class implementation of HandlePointerEventL + // Tricky: Do not allow the base class implementation of HandlePointerEventL // to remove the highlight on EButton1Up event when context menu // is displayed for an item if ( aPointerEvent.iType == TPointerEvent::EButton1Up && @@ -293,19 +293,19 @@ if ( CurrentItemIndex() != itemUnderPointerIndex ) { CMmWidgetContainer* parent = static_cast( Parent() ); - if ( parent->IsNoItemDragged() ) - { - if ( ItemDrawer()->Flags() & CListItemDrawer::EPressedDownState ) - { - ItemDrawer()->ClearFlags( CListItemDrawer::EPressedDownState ); - iView->DrawItem( CurrentItemIndex() ); - } - } - else - { - iView->SetCurrentItemIndex( itemUnderPointerIndex ); - iView->DrawItem(itemUnderPointerIndex); - } + if ( parent->IsNoItemDragged() ) + { + if ( ItemDrawer()->Flags() & CListItemDrawer::EPressedDownState ) + { + ItemDrawer()->ClearFlags( CListItemDrawer::EPressedDownState ); + iView->DrawItem( CurrentItemIndex() ); + } + } + else + { + iView->SetCurrentItemIndex( itemUnderPointerIndex ); + iView->DrawItem(itemUnderPointerIndex); + } } } @@ -389,23 +389,23 @@ ++totalNumberOfRows; } const TInt topItemRowIndex = TopItemIndex() / numOfCols; - + // desired view position relative to the first item in grid (always positive) TInt desiredViewPosition = rowHeight * topItemRowIndex - VerticalItemOffset(); - + desiredViewPosition += distanceInPixels; - + const TInt viewPositionMin = 0; - const TInt viewPositionMax = - Max( 0, ( totalNumberOfRows * rowHeight ) - view->ViewRect().Height() ); - + const TInt viewPositionMax = + Max( 0, ( totalNumberOfRows * rowHeight ) - view->ViewRect().Height() ); + desiredViewPosition = Min( desiredViewPosition, viewPositionMax ); desiredViewPosition = Max( desiredViewPosition, viewPositionMin ); - + ASSERT( desiredViewPosition >= 0 ); - + TInt newTopItemIndex = ( desiredViewPosition / rowHeight ) * numOfCols; - TInt newVerticalOffset = -( desiredViewPosition % rowHeight ); + TInt newVerticalOffset = -( desiredViewPosition % rowHeight ); SetTopItemIndex( newTopItemIndex ); SetVerticalItemOffset( newVerticalOffset ); } @@ -420,43 +420,43 @@ TInt nextScrollDelay = 0; TBool readyForScrolling = iMmDrawer->GetAnimator()->IsReadyForNewAnimation() - && iMmDrawer->GetFloatingItemCount() != 0; + && iMmDrawer->GetFloatingItemCount() != 0; - if ( IsPointerInTopScrollingThreshold( aPointerEvent ) ) - { - // scroll up by one row - TInt newCurrentItemIndex = CurrentItemIndex() - view->NumberOfColsInView(); + if ( IsPointerInTopScrollingThreshold( aPointerEvent ) ) + { + // scroll up by one row + TInt newCurrentItemIndex = CurrentItemIndex() - view->NumberOfColsInView(); if ( newCurrentItemIndex < 0 ) { newCurrentItemIndex = CurrentItemIndex(); } nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * - Max( 1, aPointerEvent.iPosition.iY - Rect().iTl.iY ); + Max( 1, aPointerEvent.iPosition.iY - Rect().iTl.iY ); - if ( readyForScrolling ) - { - ScrollWithoutRedraw( -iItemHeight ); - View()->SetCurrentItemIndex( newCurrentItemIndex ); - } - } - else if ( IsPointerInBottomScrollingThreshold( aPointerEvent) ) - { - TInt newCurrentItemIndex = CurrentItemIndex() + view->NumberOfColsInView(); - if ( newCurrentItemIndex > iModel->NumberOfItems() - 1 ) - { - newCurrentItemIndex = CurrentItemIndex(); - } - - nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * - Max( 1, Rect().iBr.iY - aPointerEvent.iPosition.iY ); + if ( readyForScrolling ) + { + ScrollWithoutRedraw( -iItemHeight ); + View()->SetCurrentItemIndex( newCurrentItemIndex ); + } + } + else if ( IsPointerInBottomScrollingThreshold( aPointerEvent) ) + { + TInt newCurrentItemIndex = CurrentItemIndex() + view->NumberOfColsInView(); + if ( newCurrentItemIndex > iModel->NumberOfItems() - 1 ) + { + newCurrentItemIndex = CurrentItemIndex(); + } - if ( readyForScrolling ) - { - ScrollWithoutRedraw( iItemHeight ); - View()->SetCurrentItemIndex( newCurrentItemIndex ); - } - } + nextScrollDelay = MmEffects::KEditModeScrollingDelayFactor * + Max( 1, Rect().iBr.iY - aPointerEvent.iPosition.iY ); + + if ( readyForScrolling ) + { + ScrollWithoutRedraw( iItemHeight ); + View()->SetCurrentItemIndex( newCurrentItemIndex ); + } + } return nextScrollDelay; } @@ -691,12 +691,18 @@ TInt topRow = TopItemIndex() / numOfCols; - if ( !( TopItemIndex() % numOfCols == 0 && - topRow <= maxPossibleTopRow ) ) + if( !( TopItemIndex() % numOfCols == 0 + && topRow <= maxPossibleTopRow ) ) { topRow = Min( topRow, maxPossibleTopRow ); SetTopItemIndex( topRow * numOfCols ); } + else if( ( (CMmWidgetContainer* ) Parent() )->IsEditMode() + && ( Abs(maxPossibleTopRow - topRow) == 1) // prevention scrolling both scrollbar and view too much rows + && !View()->ItemIsPartiallyVisible(TopItemIndex())) // prevention scrolling view during remove item via menu + { + SetTopItemIndex( maxPossibleTopRow * numOfCols ); + } // prevent problems with view being scrolled up beyond limits if ( topRow == maxPossibleTopRow && VerticalItemOffset() < 0 ) @@ -924,13 +930,13 @@ // // ----------------------------------------------------------------------------- // -void CMmGrid::ProcessScrollEventL( CEikScrollBar* aScrollBar, +void CMmGrid::ProcessScrollEventL( CEikScrollBar* aScrollBar, TEikScrollEvent aEventType ) { CAknGrid::HandleScrollEventL( aScrollBar, aEventType ); iCurrentTopItemIndex = TopItemIndex(); - // setting default highligh in order not to overwrite the top item index + // setting default highlight in order not to overwrite the top item index // set before in the SetLayout method CMmWidgetContainer* parent = static_cast< CMmWidgetContainer* > ( Parent() ); if (!parent->IsHighlightVisible()) @@ -964,7 +970,7 @@ } iSkippedScrollbarEventsCount = 0; } - + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -983,37 +989,37 @@ // ----------------------------------------------------------------------------- // void CMmGrid::SetVerticalItemOffset(TInt aOffset) - { - static_cast (View())->SetItemOffsetInPixels(aOffset); - UpdateScrollBarThumbs(); - } + { + static_cast (View())->SetItemOffsetInPixels(aOffset); + UpdateScrollBarThumbs(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TInt CMmGrid::VerticalItemOffset() const - { - return static_cast (View())->VerticalItemOffset(); - } + { + return static_cast (View())->VerticalItemOffset(); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmGrid::SetItemHeight( TInt aItemHeight ) - { - iItemHeight = aItemHeight; - } + { + iItemHeight = aItemHeight; + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // void CMmGrid::UpdateScrollBarThumbs() - { - CAknGrid::UpdateScrollBarThumbs(); - } + { + CAknGrid::UpdateScrollBarThumbs(); + } // ----------------------------------------------------------------------------- // @@ -1023,9 +1029,9 @@ { TInt componentControls(0); if ( !iDisableChildComponentDrawing ) - { + { componentControls = CAknGrid::CountComponentControls(); - } + } return componentControls; } // ----------------------------------------------------------------------------- diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/src/mmgridcontainer.cpp Tue May 25 12:29:32 2010 +0300 @@ -12,8 +12,8 @@ * Contributors: * * Description: -* Version : %version: MM_74 % << Don't touch! Updated by Synergy at check-out. -* Version : %version: MM_74 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_75 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_75 % << Don't touch! Updated by Synergy at check-out. * */ @@ -92,9 +92,9 @@ // ----------------------------------------------------------------------------- // THnSuiteWidgetType CMmGridContainer::WidgetType() - { - return EGridWidget; - } + { + return EGridWidget; + } // ----------------------------------------------------------------------------- // CMmGridContainer::ConstructL() // 2nd phase constructor @@ -125,15 +125,15 @@ CMmGrid* CMmGridContainer::CreateGridL( CMmTemplateLibrary* aTemplateLibrary ) { iGrid = CMmGrid::NewL( this, - EAknListBoxSelectionList | EAknListBoxLoopScrolling | EAknListBoxDisableHighlight , aTemplateLibrary ); + EAknListBoxSelectionList | EAknListBoxLoopScrolling | EAknListBoxDisableHighlight , aTemplateLibrary ); iGrid->SetContainerWindowL( *this ); iGrid->CreateScrollBarFrameL( ETrue ); iGrid->SetPrimaryScrollingType( - CAknGridView::EScrollFollowsItemsAndLoops ); + CAknGridView::EScrollFollowsItemsAndLoops ); iGrid->SetSecondaryScrollingType( - CAknGridView::EScrollFollowsGrid ); + CAknGridView::EScrollFollowsGrid ); iGrid->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); + CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto ); iGrid->ScrollBarFrame()->DrawBackground( EFalse, EFalse ); return iGrid; } @@ -146,7 +146,7 @@ { CMmWidgetContainer::SizeChanged(); if ( iGrid ) - { + { // iGrid->SetRect( Rect() ); iGrid->SetupLayout(); } @@ -157,34 +157,34 @@ // void CMmGridContainer::SetEditModeL( TBool aIsEditMode ) { - if (aIsEditMode && !AknLayoutUtils::PenEnabled() ) - { - iGrid->SetPrimaryScrollingType( - CAknGridView::EScrollStops ); - iGrid->SetSecondaryScrollingType( - CAknGridView::EScrollStops ); + if (aIsEditMode && !AknLayoutUtils::PenEnabled() ) + { + iGrid->SetPrimaryScrollingType( + CAknGridView::EScrollStops ); + iGrid->SetSecondaryScrollingType( + CAknGridView::EScrollStops ); } else - { - iGrid->SetPrimaryScrollingType( - CAknGridView::EScrollFollowsItemsAndLoops ); - iGrid->SetSecondaryScrollingType( - CAknGridView::EScrollFollowsGrid ); + { + iGrid->SetPrimaryScrollingType( + CAknGridView::EScrollFollowsItemsAndLoops ); + iGrid->SetSecondaryScrollingType( + CAknGridView::EScrollFollowsGrid ); - } + } - // In EditMode we allow Avkon to redraw scrollbar background - // to prevent scrollbar flicking. - // When edit mode is disabled, this redrawing causes performance problems - // (and disabling it does not produce erroneous side-effects). - if( aIsEditMode ) - { - iGrid->ScrollBarFrame()->DrawBackground( EFalse, ETrue ); - } - else - { - iGrid->ScrollBarFrame()->DrawBackground( EFalse, EFalse ); - } + // In EditMode we allow Avkon to redraw scrollbar background + // to prevent scrollbar flicking. + // When edit mode is disabled, this redrawing causes performance problems + // (and disabling it does not produce erroneous side-effects). + if( aIsEditMode ) + { + iGrid->ScrollBarFrame()->DrawBackground( EFalse, ETrue ); + } + else + { + iGrid->ScrollBarFrame()->DrawBackground( EFalse, EFalse ); + } CMmWidgetContainer::SetEditModeL( aIsEditMode ); } @@ -214,18 +214,18 @@ // ----------------------------------------------------------------------------- // TInt CMmGridContainer::DefaultHighlightOffset() - { - TInt topVisibleItemIndex = iGrid->View()->TopItemIndex(); - TInt hiddenPixels = -iGrid->View()->ItemOffsetInPixels(); + { + TInt topVisibleItemIndex = iGrid->View()->TopItemIndex(); + TInt hiddenPixels = -iGrid->View()->ItemOffsetInPixels(); - if ( iGrid->View()->ItemIsPartiallyVisible( topVisibleItemIndex ) - && hiddenPixels > iGrid->View()->ItemSize().iHeight / 2 ) - { - topVisibleItemIndex += ColumnsInCurrentView(); - } + if ( iGrid->View()->ItemIsPartiallyVisible( topVisibleItemIndex ) + && hiddenPixels > iGrid->View()->ItemSize().iHeight / 2 ) + { + topVisibleItemIndex += ColumnsInCurrentView(); + } - return topVisibleItemIndex; - } + return topVisibleItemIndex; + } // ----------------------------------------------------------------------------- // @@ -243,10 +243,10 @@ // ----------------------------------------------------------------------------- // void CMmGridContainer::SetItemDrawerAndViewBgContext( - CAknsBasicBackgroundControlContext * aBgContext ) - { - iGrid->SetItemDrawerAndViewBgContext (aBgContext); - } + CAknsBasicBackgroundControlContext * aBgContext ) + { + iGrid->SetItemDrawerAndViewBgContext (aBgContext); + } // ----------------------------------------------------------------------------- // @@ -254,10 +254,10 @@ // ----------------------------------------------------------------------------- // void CMmGridContainer::SetupWidgetLayoutL() - { - User::LeaveIfNull( iGrid ); - iGrid->SetupLayout(); - } + { + User::LeaveIfNull( iGrid ); + iGrid->SetupLayout(); + } // ----------------------------------------------------------------------------- // @@ -286,9 +286,9 @@ // --------------------------------------------------------------------------- // void CMmGridContainer::HandleItemAdditionL() - { - iGrid->HandleItemAdditionL(); - } + { + iGrid->HandleItemAdditionL(); + } // --------------------------------------------------------------------------- @@ -296,47 +296,49 @@ // --------------------------------------------------------------------------- // void CMmGridContainer::HandleItemRemovalL() - { + { - GetMmModel()->HandleSuiteEventL( ESuiteItemsRemoved, GetMmModel()->GetSuiteModel() ); - ValidateWidgetCurrentItemIndex(); - iDrawer->RemoveFloatingItems(); - if( IsEditMode() ) - { - iDrawer->GetAnimator()->SetNextRedrawToWholeScreen(); - } + GetMmModel()->HandleSuiteEventL( ESuiteItemsRemoved, GetMmModel()->GetSuiteModel() ); + ValidateWidgetCurrentItemIndex(); + iDrawer->RemoveFloatingItems(); + if( IsEditMode() ) + { + iDrawer->GetAnimator()->SetNextRedrawToWholeScreen(); + } - CacheWidgetPosition(); - iGrid->HandleItemRemovalL(); - RestoreWidgetPosition(); - CacheWidgetPosition(); + CacheWidgetPosition(); + iGrid->View()->SetDisableRedraw( ETrue ); //prevention scroll view + iGrid->HandleItemRemovalL(); + iGrid->View()->SetDisableRedraw( EFalse ); + RestoreWidgetPosition(); + CacheWidgetPosition(); - if ( iCurrentHighlight != iGrid->CurrentItemIndex() ) - { - iCurrentHighlight = iGrid->CurrentItemIndex(); - if( !iCurrentHighlight && !iGrid->Model()->NumberOfItems() ) - { - iCurrentHighlight = KErrNotFound ; - } - CHnSuiteModel* suiteModel = GetSuiteModelL(); - if ( suiteModel ) - { - suiteModel->SetSuiteHighlightL( iCurrentHighlight ); - } - } - static_cast( iGrid->ItemDrawer() )->TrimCacheSize( + if ( iCurrentHighlight != iGrid->CurrentItemIndex() ) + { + iCurrentHighlight = iGrid->CurrentItemIndex(); + if( !iCurrentHighlight && !iGrid->Model()->NumberOfItems() ) + { + iCurrentHighlight = KErrNotFound ; + } + CHnSuiteModel* suiteModel = GetSuiteModelL(); + if ( suiteModel ) + { + suiteModel->SetSuiteHighlightL( iCurrentHighlight ); + } + } + static_cast( iGrid->ItemDrawer() )->TrimCacheSize( GetMmModel()->NumberOfItems() ); - } + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // TInt CMmGridContainer::ColumnsInCurrentView() - { - CAknGridView* view ( (CAknGridView*) iGrid->View() ); - return view->NumberOfColsInView(); - } + { + CAknGridView* view ( (CAknGridView*) iGrid->View() ); + return view->NumberOfColsInView(); + } // --------------------------------------------------------------------------- // // --------------------------------------------------------------------------- @@ -361,27 +363,27 @@ // ----------------------------------------------------------------------------- // void CMmGridContainer::SetVerticalItemOffset( TInt aOffset ) - { - iGrid->SetVerticalItemOffset( aOffset ); - } + { + iGrid->SetVerticalItemOffset( aOffset ); + } // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- // TInt CMmGridContainer::VerticalItemOffset() const - { - return iGrid->VerticalItemOffset(); - } + { + return iGrid->VerticalItemOffset(); + } //---------------------------------------------------------------------------- // // --------------------------------------------------------------------------- // void CMmGridContainer::UpdateViewScrollBarThumbs() - { - iGrid->UpdateScrollBarThumbs(); - } + { + iGrid->UpdateScrollBarThumbs(); + } // ----------------------------------------------------------------------------- // diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/src/mmlistbox.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/src/mmlistbox.cpp Tue May 25 12:29:32 2010 +0300 @@ -705,20 +705,20 @@ // ----------------------------------------------------------------------------- // void CMmListBox::UpdateScrollBarsNoRedrawL() - { - HandleScrollbarVisibilityChangeL(); - if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) { - CMmListBoxView* view = static_cast( View() ); - view->DisableScrollToItem( ETrue ); - TScrollToItemEnabler reverter = { view }; - CleanupClosePushL( reverter ); - CEikFormattedCellListBoxTypedef::UpdateScrollBarsL(); - CleanupStack::PopAndDestroy( &reverter ); - iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( - ScrollBarFrame()->VerticalScrollBar()->Rect().Width() ); + HandleScrollbarVisibilityChangeL(); + if ( ScrollBarFrame()->VerticalScrollBar()->IsVisible() ) + { + CMmListBoxView* view = static_cast( View() ); + view->DisableScrollToItem( ETrue ); + TScrollToItemEnabler reverter = { view }; + CleanupClosePushL( reverter ); + CEikFormattedCellListBoxTypedef::UpdateScrollBarsL(); + CleanupStack::PopAndDestroy( &reverter ); + iMmDrawer->TemplateLibrary()->SetScrollbarWidthL( + ScrollBarFrame()->VerticalScrollBar()->Rect().Width() ); + } } - } // ----------------------------------------------------------------------------- // diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp --- a/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp Tue May 25 12:29:32 2010 +0300 @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef RD_UI_TRANSITION_EFFECTS_LIST #include @@ -53,6 +54,7 @@ #include "mmwidgetcontainer.h" #include "hnsuitemodel.h" #include "menudebug.h" +#include "hnextbmpiconholder.h" // ----------------------------------------------------------------------------- // @@ -77,6 +79,7 @@ // this is needed to get iColors initialized on first use: iLastDrawnItemWasFloating = ETrue; SetFlags( CListItemDrawer::EDisableHighlight ); + iIsSwapFloating = EFalse; } // ----------------------------------------------------------------------------- @@ -314,13 +317,13 @@ iZoomIconIndex = iFloatingItems[i].GetDrawnItemIndex(); iIconAnimationZoomRatio = iFloatingItems[i].GetCurrentZoomRatio(); - if ( ItemHasFloatingType( drawnItemIndex, EDrag) || - ItemHasFloatingType( drawnItemIndex, EDragTransition) ) + if ( ItemHasFloatingType( drawnItemIndex, EDrag) || + ItemHasFloatingType( drawnItemIndex, EDragTransition) ) { ClearFlags( CListItemDrawer::EPressedDownState ); } - - DrawActualItem( drawnItemIndex, rect, ETrue, EFalse, EFalse, EFalse ); + type == ESwapTransition ? iIsSwapFloating = ETrue : iIsSwapFloating = EFalse; + DrawActualItem( drawnItemIndex, rect, ETrue, EFalse, EFalse, EFalse ); iIconAnimationZoomRatio = tempZoomRatio; iZoomIconIndex = tempZoomIconIndex; } @@ -399,6 +402,7 @@ } } + iIsSwapFloating = EFalse; DrawActualItem(aItemIndex, actualItemRect, aItemIsCurrent, aViewIsEmphasized, aViewIsDimmed, aItemIsSelected); const_cast(this)->iLeftOverAreaUnderAnimatedItem = EFalse; @@ -505,7 +509,7 @@ } #endif - if( iDrawSeparatorLines ) + if( iDrawSeparatorLines && !iIsSwapFloating ) { CMmListBoxView* view = static_cast( iWidget->View() ); if( aItemIndex != ( view->ModelItemsCount() - 1 )) @@ -1183,30 +1187,65 @@ { CFbsBitmap* bitmap = icon->Bitmap(); ASSERT( bitmap ); + TInt errTooBig( KErrNone ); //resize the item if it is a move indicator if( iIsIndicatorItem ) { - AknIconUtils::SetSize( bitmap, child.iRectAccordingToParent.Size(), + errTooBig = AknIconUtils::SetSize( bitmap, + child.iRectAccordingToParent.Size(), EAspectRatioNotPreserved ); } else { - TSize bmpSize = bitmap->SizeInPixels(); - TBool setSizeRequired = bitmap->DisplayMode() == ENone; - if ( targetSize.iWidth && targetSize.iHeight && - ( setSizeRequired || !BitmapFitsIntoTarget( bmpSize, targetSize ) ) ) - { + TSize bmpSize = bitmap->SizeInPixels(); + TBool setSizeRequired = bitmap->DisplayMode() == ENone; + if ( targetSize.iWidth && targetSize.iHeight && + ( setSizeRequired || !BitmapFitsIntoTarget( bmpSize, targetSize ) ) ) + { CFbsBitmap* mask = icon->Mask(); if( mask ) { - __ASSERT_DEBUG( bmpSize == mask->SizeInPixels(), User::Invariant() ); - AknIconUtils::SetSize( mask, targetSize, EAspectRatioPreservedAndUnusedSpaceRemoved ); - } - AknIconUtils::SetSize( bitmap, targetSize, EAspectRatioPreservedAndUnusedSpaceRemoved ); + __ASSERT_DEBUG( bmpSize == mask->SizeInPixels(), User::Invariant() ); + errTooBig = AknIconUtils::SetSize( mask, targetSize, + EAspectRatioPreservedAndUnusedSpaceRemoved ); + } + if( !errTooBig ) + errTooBig = AknIconUtils::SetSize( bitmap, targetSize, + EAspectRatioPreservedAndUnusedSpaceRemoved ); } } - TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )->AppendIconL( iconHolder ); + if( errTooBig == KErrTooBig ) + { + // If icon is not created, try to create default application icon + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + CFbsBitmap* bitmap( NULL ); + CFbsBitmap* maskBitmap( NULL ); + TRAPD( err, + { + AknsUtils::CreateIconLC( skin, + KAknsIIDQgnMenuUnknownLst, bitmap, maskBitmap, + AknIconUtils::AvkonIconFileName(), + EMbmAvkonQgn_menu_unknown_lst, + EMbmAvkonQgn_menu_unknown_lst_mask ); + CleanupStack::Pop( 2 ); // for trap + } + ); + if( !err ) + { + if( maskBitmap) + AknIconUtils::SetSize( maskBitmap, targetSize, + EAspectRatioPreservedAndUnusedSpaceRemoved ); + AknIconUtils::SetSize( bitmap, targetSize, + EAspectRatioPreservedAndUnusedSpaceRemoved ); + static_cast(iconHolder)->CleanBmpBuffer(); + icon->SetBitmap(bitmap); + icon->SetMask(maskBitmap); + icon->SetBitmapsOwnedExternally(EFalse); + } + } + + TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )->AppendIconL( iconHolder ); HBufC8* number = HnConvUtils::NumToStr8LC( iconIndex ); const TInt newLength = aItemText.Length() + number->Length(); @@ -1322,7 +1361,8 @@ { TSize itemSize = GetItemSize( aItemIndex, aItemIndex == iWidget->View()->CurrentItemIndex() ); - CHnIconHolder* iconHolder = iMmModel->GetAttributeAsRefCountedGraphics( aItemIndex, child.iData, &itemSize ); + CHnIconHolder* iconHolder = iMmModel->GetAttributeAsRefCountedGraphics( + aItemIndex, child.iData, &itemSize ); icon = iconHolder ? iconHolder->GetGulIcon() : NULL; if( icon ) { @@ -1331,7 +1371,8 @@ TPoint( itemSize.iWidth, itemSize.iHeight ) ); AknIconUtils::SetSize( bitmap, itemSize, EAspectRatioNotPreserved ); - TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )->AppendIconL( iconHolder ); + TInt iconIndex = iItemsDataCache->GetItemCacheL( aItemIndex )-> + AppendIconL( iconHolder ); HBufC8* number = HnConvUtils::NumToStr8LC( iconIndex ); TInt newLength = aItemText.Length() + number->Length(); @@ -1399,10 +1440,13 @@ //Backdrop icon as first element to draw TInt subcellIncrement( 0 ); - if( GetBackdropVisibility( aItemIndex, aItemIsCurrent ) ) + if( ( GetBackdropVisibility( aItemIndex, aItemIsCurrent ) + || ItemHasFloatingType( aItemIndex, ESwapTransition ) ) + && !iIsSwapFloating ) { SetupBackdropSubcellL( templateChildArray, aItemIndex, itemText, subcellIncrement ); iItemHasBackdrop = ETrue; + iIsSwapFloating = EFalse; } else { @@ -1519,9 +1563,9 @@ TBool highlightVisibility( EFalse ); if( !iItemHasBackdrop && !iLeftOverAreaUnderAnimatedItem ) //never draw highlight when item has backdrop or when left over area under animated item { - TBool currentlyDraggedItem = - ItemHasFloatingType( aItemIndex, EDrag ) || - ItemHasFloatingType( aItemIndex, EDragTransition ); + TBool currentlyDraggedItem = + ItemHasFloatingType( aItemIndex, EDrag ) || + ItemHasFloatingType( aItemIndex, EDragTransition ); if( ( STATIC_CAST(CMmWidgetContainer*,Widget()->Parent())->IsHighlightVisible() && aItemIsCurrent && aAllowHighlightForNonDraggedItem ) @@ -1540,7 +1584,7 @@ TBool CMmListBoxItemDrawer::GetBackdropVisibility( TInt aItemIndex, TBool aItemIsCurrent ) const { - TBool currentlyDraggedItem = + TBool currentlyDraggedItem = ItemHasFloatingType( aItemIndex, EDrag ) || ItemHasFloatingType( aItemIndex, EDragTransition ); diff -r 7be2816dbabd -r 137ebc85284b menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp --- a/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Tue May 11 16:02:39 2010 +0300 +++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp Tue May 25 12:29:32 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: MM_71.1.17.1.64 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: MM_71.1.17.1.65 % << Don't touch! Updated by Synergy at check-out. * */ @@ -1745,6 +1745,9 @@ SetHighlightVisibilityL( EFalse ); if( aChange == EItemsAdded ) { + // force update scrollbar to go down + if( WidgetType() == EGridWidget && NumberOfItems() > 0) + Widget()->SetCurrentItemIndex( NumberOfItems() - 1 ); HandleItemAdditionL(); } else if( aChange == EItemsRemoved ) diff -r 7be2816dbabd -r 137ebc85284b menufw/menusuites/foldersuite/loc/matrixmenudata.loc Binary file menufw/menusuites/foldersuite/loc/matrixmenudata.loc has changed diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/contextengine/tsfswserver/engine/inc/tsfswdatalist.h --- a/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswdatalist.h Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/contextengine/tsfswserver/engine/inc/tsfswdatalist.h Tue May 25 12:29:32 2010 +0300 @@ -94,11 +94,6 @@ CTsFsWidgetList* Widgets(); /** - * Set flag iTaskListDirty; - */ - void SetDirty(); - - /** * Set flag iAppDataRefreshNeeded */ void SetAppDataRefreshNeeded(); @@ -122,7 +117,7 @@ * Moves entry on given window app/widget id to * the first position on conten data list */ - void MoveEntryAtStart( TInt aAppId, TBool aWidget ); + TBool MoveEntryAtStart( TInt aAppId, TBool aWidget ); /** * If application uid exists in the contained CTsFsAlwaysShownAppList @@ -266,6 +261,19 @@ */ TBool CheckIfExists( const CTsFswEntry& aEntry, const RTsFswArray& aNewList ) const; + + /** + * Set flag iTaskListDirty; + * @param aDirty new flag value. + */ + void SetDirty( TBool aDirty ); + + /** + * Removes the screenshot handle from content entry. + * Reverts to parental screenshot, if previously was set to embeded. + * @param aBmpHandle handle of removed screenshot. + */ + TBool RemoveScreenshotFromParent( TInt aBmpHandle ); private: CTsFswEngine& iEngine; diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/contextengine/tsfswserver/engine/src/tsfswdatalist.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfswdatalist.cpp Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswdatalist.cpp Tue May 25 12:29:32 2010 +0300 @@ -28,7 +28,8 @@ #include #include - +// Special case: ovi store secure widget UID +const TUid KTsOviStoreSecureWidgetUid = { 0x2001A93E }; // ================= MEMBER FUNCTIONS ======================= @@ -113,7 +114,8 @@ if ( iTaskListDirty ) { CollectTasksL(); - // dirty flag is cleared in the above call + // clear dirty flag + SetDirty(EFalse); } // Get app icon for entries without screenshot, @@ -153,8 +155,7 @@ TBool CTsFswDataList::CollectTasksL() { // clear dirty flag - iTaskListDirty = EFalse; - TBool changed = EFalse; + TBool changed = iTaskListDirty; RTsFswArray newAppsList; RTsFswArray newWidgetsList; @@ -206,9 +207,9 @@ // CTsFswDataList::SetDirty() // -------------------------------------------------------------------------- // -void CTsFswDataList::SetDirty() +void CTsFswDataList::SetDirty(TBool aDirty) { - iTaskListDirty = ETrue; + iTaskListDirty = aDirty; } // -------------------------------------------------------------------------- @@ -252,15 +253,19 @@ { TBool changed = EFalse; CFbsBitmap** bmp = iScreenshots.Find( aId ); + if ( bmp ) { + changed |= AssignScreenshotHandle( aId, 0 ); + changed |= RemoveScreenshotFromParent( (*bmp)->Handle()); delete *bmp; iScreenshots.Remove( aId ); - changed = AssignScreenshotHandle( aId, 0 ); } return changed; } + + // -------------------------------------------------------------------------- // CTsFswDataList::FindScreenshotByWgId // -------------------------------------------------------------------------- @@ -276,10 +281,11 @@ // CTsFswDataList::MoveEntryAtStart // -------------------------------------------------------------------------- // -void CTsFswDataList::MoveEntryAtStart(TInt aAppId, TBool aWidget) +TBool CTsFswDataList::MoveEntryAtStart(TInt aAppId, TBool aWidget) { TSLOG_CONTEXT( MoveEntryAtStart, TSLOG_LOCAL ); + TBool wasMoved(EFalse); TInt appId(0); //check embeded case if( !aWidget ) @@ -302,15 +308,19 @@ for ( TInt i = 0; i < iData.Count(); ++i ) { - if( iData[i]->AppUid().iUid == appId && iData[i]->Widget() == aWidget) + if( iData[i]->AppUid().iUid == appId && + ((iData[i]->Widget() == aWidget) || (iData[i]->AppUid() == KTsOviStoreSecureWidgetUid ))) { CTsFswEntry* entry = iData[i]; iData.Remove(i); iData.Insert(entry, 0); + SetDirty(ETrue); + wasMoved = ETrue; break; } } TSLOG_OUT(); + return wasMoved; } // -------------------------------------------------------------------------- @@ -629,13 +639,14 @@ aAsigned = EFalse; for (TInt i = 0, ie = iData.Count(); i != ie; ++i) { - if (iData[i]->Widget()) + if (iData[i]->Widget() || iData[i]->AppUid() == KTsOviStoreSecureWidgetUid ) { TInt widgetId = iData[i]->AppUid().iUid; if (widgetId == aWgIdForScreenshot) { iData[i]->SetScreenshotHandle(aBitmapHandle); aAsigned = ETrue; + SetDirty(ETrue); break; } continue; @@ -645,6 +656,7 @@ { iData[i]->SetScreenshotHandle(aBitmapHandle); aAsigned = ETrue; + SetDirty(ETrue); break; } } @@ -800,4 +812,24 @@ return appUid; } +// -------------------------------------------------------------------------- +// CTsFswDataList::RemoveScreenshotFromParent +// -------------------------------------------------------------------------- +// +TBool CTsFswDataList::RemoveScreenshotFromParent( TInt aBmpHandle ) + { + TBool changed(EFalse); + for( TInt i = 0; i < iData.Count(); ++i) + { + if ( !iData[i]->Widget() && iData[i]->ScreenshotHandle() == aBmpHandle ) + { + changed = ETrue; + iData[i]->SetScreenshotHandle( + LookupScreenshotHandle( iData[i]->WgId()) ); + } + } + return changed; + } + + // end of file diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp --- a/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/contextengine/tsfswserver/engine/src/tsfswengine.cpp Tue May 25 12:29:32 2010 +0300 @@ -238,20 +238,19 @@ TSLOG_CONTEXT( UpdateTaskList, TSLOG_LOCAL ); TSLOG_IN(); + // screenshot taking support - call Register and Unregister when needed + UpdatePreviewContent(); + + // get the foreground app uid and publish it to CFW if different than before + TRAP_IGNORE( PublishFgAppUidL() ); + // There can be many calls in a row, use a timer to prevent degrading // device performance. - iDataList->SetDirty(); if ( !iUpdateStarter->IsActive() ) { iUpdateStarter->Start( KContentRefreshDelay, 0, TCallBack( UpdateStarterCallback, this ) ); } - - // screenshot taking support - call Register and Unregister when needed - UpdatePreviewContent(); - - // get the foreground app uid and publish it to CFW if different than before - TRAP_IGNORE( PublishFgAppUidL() ); TSLOG_OUT(); } @@ -316,6 +315,11 @@ { iFgAppUid = newUid; iDataList->MoveEntryAtStart(newUid.iUid, EFalse); + TBool change( iDataList->MoveEntryAtStart(newUid.iUid, EFalse) ); + if( change ) + { + iObserver.FswDataChanged(); + } } TSLOG_OUT(); @@ -755,10 +759,9 @@ { TSLOG_CONTEXT( HandleWidgetUpdateL, TSLOG_LOCAL ); - iDataList->MoveEntryAtStart(aWidgetId, ETrue); + TBool contentChanged( iDataList->MoveEntryAtStart(aWidgetId, ETrue) ); CFbsBitmap* bmp = 0; - TBool contentChanged(EFalse); if( aBitmapHandle ) { TRAPD( err, bmp = CopyBitmapL( aBitmapHandle, EFalse ) ); diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h --- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h Tue May 25 12:29:32 2010 +0300 @@ -161,12 +161,6 @@ * Handling short/long app key. */ void HandleAppKey(TInt aType); - - /* - * Updates components visibility, used to switch off - * grid scrollbar visibility for transition effects - */ - void UpdateComponentVisibility(); private: diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp Tue May 25 12:29:32 2010 +0300 @@ -254,7 +254,6 @@ TBool /*aLayers*/, TUint aSubCom ) { - TRAP_IGNORE( RequestPopUpL() ); const TDesC8* ptr = reinterpret_cast(iAppView); GfxTransEffect::Abort(iAppView); GfxTransEffect::Begin( iAppView, aTranstionId ); @@ -286,7 +285,6 @@ else { // App start animation - TRAP_IGNORE( RequestPopUpL() ); const TDesC8* ptr = reinterpret_cast(iAppView); GfxTransEffect::Abort(iAppView); TInt groupId = GfxTransEffect::BeginGroup(); @@ -312,13 +310,9 @@ // CTsAppUi::TransitionFinished // ----------------------------------------------------------------------------- // -void CTsAppUi::TransitionFinished(const CCoeControl* aControl, +void CTsAppUi::TransitionFinished(const CCoeControl* /*aControl*/, TUint /*aAction*/) { - if ( aControl == iAppView ) - { - TRAP_IGNORE( DisablePopUpL() ); - } } // ----------------------------------------------------------------------------- @@ -697,6 +691,7 @@ { SetOrientationL(EAppUiOrientationPortrait); } + SetFullScreenApp(EFalse); iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront); } TSLOG_OUT(); diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp Tue May 25 12:29:32 2010 +0300 @@ -446,7 +446,6 @@ // Forward event to interested controls iFastSwapArea->HandleSwitchToForegroundEvent(); - iFastSwapArea->UpdateComponentVisibility(); // Check for layout updates CTsAppUi* appUi = static_cast(iCoeEnv->AppUi()); @@ -483,7 +482,6 @@ MakeVisible( ETrue ); } - iFastSwapArea->UpdateComponentVisibility(); DrawDeferred(); TSLOG_OUT(); @@ -601,8 +599,6 @@ { iEvtHandler->EnableEventHandling(ETrue); iExitOnPointerUp = EFalse; - LaunchFeedback(ETouchFeedbackBasic, TTouchFeedbackType( - ETouchFeedbackVibra | ETouchFeedbackAudio), aPointerEvent); if( !DragArea().Contains(aPointerEvent.iParentPosition) || !iFastSwapArea->Count() ) @@ -615,6 +611,13 @@ iExitOnPointerUp = ETrue; } } + else if ( !iAppsHeading->Rect().Contains( aPointerEvent.iParentPosition ) || + !iFastSwapArea->Count() ) + { + // Feedback only on "active" areas of UI + LaunchFeedback(ETouchFeedbackBasic, TTouchFeedbackType( + ETouchFeedbackVibra | ETouchFeedbackAudio), aPointerEvent); + } } else if( TPointerEvent::EButton1Up == aPointerEvent.iType && iExitOnPointerUp ) { @@ -623,6 +626,8 @@ !iAppsHeading->Rect().Contains(aPointerEvent.iParentPosition) ) || !iFastSwapArea->Count() ) { + LaunchFeedback(ETouchFeedbackBasic, TTouchFeedbackType( + ETouchFeedbackVibra | ETouchFeedbackAudio), aPointerEvent); iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit); } } diff -r 7be2816dbabd -r 137ebc85284b taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp --- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp Tue May 11 16:02:39 2010 +0300 +++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp Tue May 25 12:29:32 2010 +0300 @@ -394,7 +394,7 @@ HandleFswContentChanged(); iGrid->SetCurrentDataIndex(selIdx); UpdateGrid(ETrue, EFalse); - DrawDeferred(); + iGrid->DrawDeferred(); // Order full redraw after switch if(iRedrawTimer) @@ -413,14 +413,14 @@ // void CTsFastSwapArea::Draw( const TRect& /*aRect*/ ) const { - CWindowGc& gc = SystemGc(); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - AknsDrawUtils::Background( skin, - cc, - this, - gc, - Rect() ); +// CWindowGc& gc = SystemGc(); +// MAknsSkinInstance* skin = AknsUtils::SkinInstance(); +// MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); +// AknsDrawUtils::Background( skin, +// cc, +// this, +// gc, +// Rect() ); } // -------------------------------------------------------------------------- @@ -720,7 +720,7 @@ static_cast(&iParent)->EnableDragEvents(EFalse); } - for ( TInt i = 0, ie = iArray.Count(); i != ie; ++i ) + for ( TInt i = 0; i < iArray.Count(); ++i ) { const TDesC& appName( iArray[i]->AppName() ); const TInt formatLen = 3 + 2; @@ -785,18 +785,18 @@ iGrid->SetCloseItemsL(closeItemArray); iGrid->SetStrokeItemsL(strokeItemArray); + // Update scrollbar visibility + if( iGrid->ScrollBarFrame() ) + { + iGrid->SetScrollBarFrame(NULL,CEikListBox::EOwnedExternally); + } + // Cleanup CleanupStack::PopAndDestroy(&strokeItemArray); CleanupStack::PopAndDestroy(&closeItemArray); CleanupStack::Pop(textArray); CleanupStack::Pop(iconArray); - if( iGrid->ScrollBarFrame() ) - { - iGrid->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff); - } - // refresh the items in the grid iEvtHandler.ReInitPhysicsL( GridWorldSize(), ViewSize(), ETrue ); UpdateGrid( ETrue, !aSuppressAnimation ); @@ -868,6 +868,8 @@ iGrid->HideHighlight(); } CancelLongTapAnimation(); + iGrid->MakeVisible(EFalse); + iGrid->DrawNow(); } // ----------------------------------------------------------------------------- @@ -915,12 +917,12 @@ iRedrawTimer->Cancel(); iRedrawTimer->After(KRedrawTime); - itemDrawer->SetRedrawBackground(EFalse); - // give feedback LaunchPopupFeedback(); iPrevAppCount = iArray.Count(); + + iGrid->MakeVisible(ETrue); TSLOG_OUT(); } @@ -959,6 +961,14 @@ CancelLongTapAnimation(); iKeyEvent = ETrue; + + //do not forward the event until item is higlighted + TKeyResponse response = ShowHighlightOnKeyEvent(aKeyEvent, aType); + if( response == EKeyWasConsumed ) + { + return EKeyWasConsumed; + } + // handle the 'clear' key if ( aType == EEventKey && aKeyEvent.iCode == EKeyBackspace ) { @@ -970,13 +980,6 @@ return EKeyWasConsumed; } - //do not forward the event until item is higlighted - TKeyResponse response = ShowHighlightOnKeyEvent(aKeyEvent, aType); - if( response == EKeyWasConsumed ) - { - return EKeyWasConsumed; - } - // pass the event to grid // do not pass down and up arrow key events if ( aKeyEvent.iScanCode != EStdKeyUpArrow && @@ -1022,8 +1025,11 @@ TKeyResponse retVal(EKeyWasNotConsumed); if (aKeyEvent.iScanCode == EStdKeyLeftArrow || - aKeyEvent.iScanCode == EStdKeyRightArrow) - { + aKeyEvent.iScanCode == EStdKeyRightArrow || + aKeyEvent.iScanCode == EStdKeyDevice3 || + aKeyEvent.iScanCode == EStdKeyBackspace || + aKeyEvent.iScanCode == EStdKeyEnter ) + { if (!iGrid->IsHighlightVisible()) { if (aType == EEventKey) @@ -1075,6 +1081,7 @@ CancelLongTapAnimation( EFalse ); if( iActivateOnPointerRelease != TPoint() ) { + iHandlePointerCandidate = ETrue; TapL(iActivateOnPointerRelease); iActivateOnPointerRelease = TPoint(); } @@ -1433,7 +1440,8 @@ if(visibleItem != SelectedIndex()) { iGrid->SetCurrentDataIndex( visibleItem ); - DrawDeferred(); + iParent.DrawDeferred(); + iGrid->DrawDeferred(); } } @@ -1516,12 +1524,6 @@ // void CTsFastSwapArea::MoveOffset(const TPoint& aPoint, TBool aDrawNow) { - TSLOG_CONTEXT( CTsFastSwapArea::MoveOffset, TSLOG_LOCAL ); - TSLOG2_IN("Old position x: %d, y:%d", ViewPos().iX, ViewPos().iY); - TSLOG2_IN("New position x: %d, y:%d", aPoint.iX, aPoint.iY); - TSLOG_OUT(); - - if( iHandlePointerCandidate ) { //pointer was pressed and it's being waiting for handling @@ -1548,7 +1550,8 @@ // Center view gridViewRect.iTl.iX += ( Rect().Width() - GridItemCount() * iGridItemWidth ) / 2; } - DrawDeferred(); + //iParent.DrawDeferred(); + iGrid->DrawDeferred(); iGrid->SetRect( gridViewRect ); iLogicalViewPosOffset = 0; } @@ -1650,7 +1653,7 @@ void CTsFastSwapArea::Stop() { CenterItem( KUpdateGridTime ); - DrawNow(); + DrawDeferred(); } // ----------------------------------------------------------------------------- @@ -1789,22 +1792,33 @@ } else { + TInt retItemPosX(0); TInt offsetCheck = GridWorldSize().iWidth; // View inside of grid world rect for ( TInt i = 0 ; i < GridItemCount(); i++ ) { - TInt offset = aViewPos.iX - ItemViewPosition( i ).iX; + TInt itemPosX = ItemViewPosition( i ).iX; + TInt offset = aViewPos.iX - itemPosX; if ( Abs( offset ) <= offsetCheck ) { offsetCheck = Abs( offset ); retVal = i; + retItemPosX = itemPosX; } else { break; } } + // Check if item is fully visible. If not + // return next one if possible + if ( retItemPosX - iGridItemWidth / 2 < absViewPos.iX && + retVal + 1 < GridItemCount() ) + { + retVal++; + } } + return retVal; } @@ -1836,22 +1850,6 @@ // ----------------------------------------------------------------------------- -// CTsFastSwapArea::UpdateComponentVisibility -// ----------------------------------------------------------------------------- -// -void CTsFastSwapArea::UpdateComponentVisibility() - { - // Switch off scrollbars - CEikScrollBarFrame* scrollBar = iGrid->ScrollBarFrame(); - if(scrollBar) - { - TRAP_IGNORE( scrollBar->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EOff)); - } - } - - -// ----------------------------------------------------------------------------- // CTsFastSwapArea::GetCurrentScreenOrientation // ----------------------------------------------------------------------------- // @@ -1916,12 +1914,13 @@ { TBool retVal(EFalse); TInt appCount = iArray.Count(); + + TApaTaskList taskList( iEikonEnv->WsSession() ); + TApaTask task = taskList.FindApp( KTsHomescreenUid ); + TInt homescrWgId = task.WgId(); + if ( iPrevAppCount != appCount ) { - TApaTaskList taskList( iEikonEnv->WsSession() ); - TApaTask task = taskList.FindApp( KTsHomescreenUid ); - TInt homescrWgId = task.WgId(); - for ( TInt i = 0; i < iArray.Count(); i++ ) { TInt wgId = iArray[i]->WgId(); @@ -1932,6 +1931,10 @@ } } } + else if ( aWgId == homescrWgId ) + { + retVal = ETrue; + } iPrevAppCount = appCount; return retVal; } @@ -1966,13 +1969,11 @@ { if ( Rect().Contains(aHitPoint) ) { - for ( TInt i = 0; i < GridItemCount(); i++ ) + TInt itemIdx; + TBool isItemHit = iGrid->GridView()->XYPosToItemIndex( aHitPoint, itemIdx ); + if ( isItemHit && ( CanClose( itemIdx ) || CanCloseAll( itemIdx ) ) ) { - TBool isItemHit = iGrid->GridView()->XYPosToItemIndex( aHitPoint, i ); - if ( isItemHit && ( CanClose( i ) || CanCloseAll( i ) ) ) - { - return ETrue; - } + return ETrue; } } return EFalse;