--- a/uifw/AknGlobalUI/AknCapServer/src/AknFastswapWindowControl.cpp Thu Jul 29 14:21:56 2010 +0800
+++ b/uifw/AknGlobalUI/AknCapServer/src/AknFastswapWindowControl.cpp Fri Aug 06 17:25:01 2010 +0800
@@ -39,8 +39,6 @@
#include <akntransitionutils.h>
#include <akntranseffect.h>
#include <gfxtranseffect/gfxtranseffect.h>
-#include <WidgetRegistryConstants.h>
-#include <WidgetRegistryData.h>
#include <featmgr.h>
#include <aknglobalpopupprioritycontroller.h>
#include <centralrepository.h>
@@ -157,150 +155,6 @@
return KErrNone;
}
-NONSHARABLE_CLASS(CAknWidgetList) : public CBase
- {
- public:
- static CAknWidgetList* NewL( CAknFastSwapWindowControl& aParent );
- /** Destructor */
- ~CAknWidgetList();
-
- /**
- * Initializes the list that stores widgets.
- * @return -
- */
- void InitializeWidgetListL();
-
- /**
- * Check if a uid is the uid of the widget application.
- * @param aAppUid The application uid to be checked.
- * @return ETrue application uid belongs to widget application - EFalse otherwise.
- */
- TBool IsWidgetAppUI( TUid aAppUid );
-
- /**
- * Check if the window group id value refers to widget.
- * @param aWgId window group id.
- * @return ETrue if window group id has value that refers to widget.
- */
- TBool IsWidget( TInt aWgId );
-
- /**
- * Map tasklist application index to application Uid.
- *
- * @param aIndex index of tasklist item array.
- * @param aAlwaysShownCount number of applications that are always shown on
- the active applications list.
- * @return application Uid
- */
- TUid IndexToAppUid( TInt aIndex, TInt aAlwaysShownCount );
-
- private:
- /** Constructor */
- CAknWidgetList( CAknFastSwapWindowControl& aParent );
- void ConstructL();
- void ResetArrayOfWidgetInfo( RWidgetInfoArray& aWidgetInfoArr );
-
- static void CleanupConnect( TAny* aThis );
-
- public:
- /** Contains list of widgets that are currently running */
- RWidgetInfoArray iRunningWidgets;
- private:
- CAknFastSwapWindowControl& iParent;
- RWidgetRegistryClientSession iWidgetRegistryClientSession;
- };
-
-
-CAknWidgetList* CAknWidgetList::NewL( CAknFastSwapWindowControl& aParent )
- {
- _AKNTRACE_FUNC_ENTER;
- CAknWidgetList* self = new (ELeave) CAknWidgetList( aParent );
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(); //self
- _AKNTRACE_FUNC_EXIT;
- return self;
- }
-
-CAknWidgetList::CAknWidgetList( CAknFastSwapWindowControl& aParent ): iParent( aParent )
- {
- }
-
-CAknWidgetList::~CAknWidgetList()
- {
- _AKNTRACE_FUNC_ENTER;
- ResetArrayOfWidgetInfo( iRunningWidgets );
- iRunningWidgets.Reset();
- _AKNTRACE_FUNC_EXIT;
- }
-
-void CAknWidgetList::ConstructL()
- {
- }
-
-void CAknWidgetList::CleanupConnect( TAny* aThis )
- {
- _AKNTRACE_FUNC_ENTER;
- (( CAknWidgetList*)aThis)->iWidgetRegistryClientSession.Disconnect();
- _AKNTRACE_FUNC_EXIT;
- }
-
-void CAknWidgetList::InitializeWidgetListL()
- {
- _AKNTRACE_FUNC_ENTER;
- ResetArrayOfWidgetInfo( iRunningWidgets );
- iRunningWidgets.Reset();
- User::LeaveIfError( iWidgetRegistryClientSession.Connect() );
- CleanupStack::PushL( TCleanupItem( CleanupConnect, this) );
- iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets);
- for ( TInt i = iRunningWidgets.Count() - 1; i > -1; i-- )
- {
- if ( !iWidgetRegistryClientSession.IsWidgetInFullView(iRunningWidgets[i]->iUid) )
- {
- delete iRunningWidgets[i];
- iRunningWidgets.Remove(i);
- }
- }
- CleanupStack::Pop(); // clean WidgetRegistryClientSession item
- iWidgetRegistryClientSession.Disconnect();
- _AKNTRACE_FUNC_EXIT;
- }
-
-TBool CAknWidgetList::IsWidgetAppUI( TUid aAppUid )
- {
- _AKNTRACE( "[%s] aAppUid = %d",
- __FUNCTION__, aAppUid.iUid );
- return (aAppUid == KWidgetAppUid);
- }
-
-TBool CAknWidgetList::IsWidget( TInt aWgId )
- {
- _AKNTRACE( "[%s] aWgId = %d",
- __FUNCTION__, aWgId );
- return (aWgId == KWidgetWithoutWG);
- }
-
-TUid CAknWidgetList::IndexToAppUid( TInt aIndex, TInt aAlwaysShownCount )
- {
- _AKNTRACE( "[%s] aIndex = %d aAlwaysShownCount = %d",
- __FUNCTION__, aIndex, aAlwaysShownCount );
- return iRunningWidgets[aIndex + iRunningWidgets.Count() +
- aAlwaysShownCount - iParent.iNumberOfWGs]->iUid;
- }
-
-void CAknWidgetList::ResetArrayOfWidgetInfo(
- RWidgetInfoArray& aWidgetInfoArr )
- {
- _AKNTRACE_FUNC_ENTER;
- for ( TInt i = 0; i < aWidgetInfoArr.Count(); i++ )
- {
- CWidgetInfo *item = aWidgetInfoArr[i];
- delete item ;
- }
- _AKNTRACE_FUNC_EXIT;
- }
-
-
NONSHARABLE_CLASS(CAknAlwaysShownAppList) : public CBase
{
public:
@@ -528,9 +382,8 @@
// might leave.
//
CAknFastSwapWindowControl::CAknFastSwapWindowControl(CAknCapAppServerAppUi& aAppUi)
-: iAppUi( aAppUi ),iLowMemory( EFalse ), iLowMemIcons( EFalse ), iAppArcSessionInitiated( EFalse ),
- iWidgetAppUiWgId(-1), iWidgetsSupported( EFalse ),
- iTooltipModeTouch( EFalse ),iTransparencyEnabled( CAknEnv::Static()->TransparencyEnabled() ),
+: iAppUi( aAppUi ), iLowMemory( EFalse ), iLowMemIcons( EFalse ), iAppArcSessionInitiated( EFalse ),
+ iTooltipModeTouch( EFalse ), iTransparencyEnabled( CAknEnv::Static()->TransparencyEnabled() ),
iIsStylusPopupShow(EFalse), iState( EWaiting )
{
AKNTASHOOK_ADD( this, "CAknFastSwapWindowControl" );
@@ -559,10 +412,6 @@
}
}
- if (FeatureManager::FeatureSupported(KFeatureIdWebWidgets))
- {
- iWidgetsSupported = ETrue;
- }
CreateCbaL();
CreateGridL();
CreateItemArraysL();
@@ -587,10 +436,6 @@
// the list for always shown applications in the fast swap
iAlwaysShownList = CAknAlwaysShownAppList::NewL( *this );
- if (iWidgetsSupported)
- {
- iWidgetList = CAknWidgetList::NewL( *this );
- }
MakeVisible( EFalse );
_AKNTRACE_FUNC_EXIT;
}
@@ -610,7 +455,7 @@
AknsUtils::DeregisterControlPosition( iGrid );
}
delete iAlwaysShownList;
- delete iWidgetList;
+
FadeBackground( EFalse );
delete iFrameContext;
delete iGrid; // destroys also iIconArray and scrollbar frame
@@ -886,10 +731,7 @@
iAppArcSession.GetAllApps();
// create list for always shown applications
iAlwaysShownList->InitializeAlwaysShownListL();
- if (iWidgetsSupported)
- {
- iWidgetList->InitializeWidgetListL();
- }
+
//Initializes CAknFastSwapWindowControl private data ( iWgIds, iNumberOfWGs )
RWsSession& wsSession=iEikonEnv->WsSession();
TInt count=wsSession.NumWindowGroups( 0 );
@@ -940,10 +782,7 @@
{
iAlwaysShownList->AddWgGroupToAlwaysShownList( applicationUid, wgId );
}
- else if (iWidgetsSupported && iWidgetList->IsWidgetAppUI(applicationUid))
- {
- iWidgetAppUiWgId = wgId;
- }
+
// could't use windowName->IsAppReady(), because then java and console application
// wouldn't be seen in FSW. Now it is possible that some system apps are seen at the
// beginning of their start for a while in FSW (even they should be hidden all the time)
@@ -959,15 +798,6 @@
}
}
- if (iWidgetsSupported)
- {
- for ( TInt index = 0; index < iWidgetList->iRunningWidgets.Count(); index++)
- {
- SWindowGroupInfo wgInfo = { KWidgetWithoutWG, EFalse };
- shownWgIds->AppendL( wgInfo );
- }
- }
-
// always shown applications are appended to the end of window group list
for ( TInt index = 0; index < iAlwaysShownList->iAppList->Count(); index++)
{
@@ -2043,21 +1873,6 @@
name.Append( KTab );
name.Append( caption );
}
- else if (iWidgetsSupported && iWidgetList->IsWidget( wgId ))
- {
- appUid = iWidgetList->IndexToAppUid( index, iAlwaysShownList->iAppList->Count() );
- iAppArcSession.GetAppInfo( info, appUid );
-
- // retrieve the app name
- TPtrC caption = info.iShortCaption;
- name.Zero();
-
- // conversion from TInt to TReal, might be a problem in the future
- name.AppendNum( index );
-
- name.Append( KTab );
- name.Append( caption );
- }
//
// Running Applications
//
@@ -2231,10 +2046,6 @@
{
LaunchAppL( iAlwaysShownList->IndexToAppUid( aIndex ) );
}
- else if ( iWidgetsSupported && wgId == KWidgetWithoutWG )
- {
- LaunchAppL( iWidgetList->IndexToAppUid( aIndex, iAlwaysShownList->iAppList->Count() ) );
- }
// brings existing application to foreground and closes fastswap
else
{
@@ -3033,25 +2844,7 @@
iIsClosing = ETrue;
- if (iWidgetsSupported && iWidgetList->IsWidget( iConfirmCloseWgId ))
- {
- TWsEvent event;
- event.SetType(EEventUser);
-
- TUid widgetUid = iWidgetList->IndexToAppUid(aIndex, iAlwaysShownList->iAppList->Count());
-
- TInt32 widgetAppUiUidInt = KWidgetAppUid.iUid;
- TInt32 widgetUidInt = widgetUid.iUid;
- TUint8* eventData = event.EventData();
- // Fill bits 0-31 with widget application Uid.
- (TUint32&)*eventData = widgetAppUiUidInt;
- eventData+=sizeof(TUint32);
- // Fill bits 32-63 with uid of the widget that should be closed.
- (TUint32&)*eventData = widgetUidInt;
- // Send the event to Widget AppUi.
- iEikonEnv->WsSession().SendEventToWindowGroup(iWidgetAppUiWgId, event);
- }
- else if ( aIsShift )
+ if ( aIsShift )
{
TApaTask task( iEikonEnv->WsSession() );
task.SetWgId( iConfirmCloseWgId );