widgets/widgetapp/src/WidgetUiWindow.cpp
changeset 65 5bfc169077b2
parent 38 6297cdf66332
child 68 92a765b5b3e7
--- a/widgets/widgetapp/src/WidgetUiWindow.cpp	Tue Feb 02 00:56:45 2010 +0200
+++ b/widgets/widgetapp/src/WidgetUiWindow.cpp	Fri Mar 19 09:52:28 2010 +0200
@@ -21,8 +21,8 @@
 #include "WidgetUiWindowContainer.h"
 #include "WidgetUiWindowManager.h"
 #include "WidgetUiDialogsProviderProxy.h"
-#include <widgetregistryconstants.h>
-#include "browser_platform_variant.hrh"
+#include "WidgetRegistryConstants.h"
+#include "Browser_platform_variant.hrh"
 #ifdef BRDO_WRT_HS_FF
 #include "cpspublisher.h"
 #endif
@@ -31,9 +31,9 @@
 #include <WidgetUi.rsg>
 
 #include <schemehandler.h>
-#include <internetconnectionmanager.h>
+#include <InternetConnectionManager.h>
 #include "WidgetInstallerInternalCRKeys.h"
-#include <browseruisdkcrkeys.h>
+#include <BrowserUiSDKCRKeys.h>
 #include <StringLoader.h>
 #include <centralrepository.h>
 #include <ApUtils.h>
@@ -42,6 +42,7 @@
 #include <aknsdrawutils.h>
 #include "SWInstWidgetUid.h"
 
+
 // EXTERNAL DATA STRUCTURES
 
 // EXTERNAL FUNCTION PROTOTYPES
@@ -193,10 +194,8 @@
 
     iDlId = 0;
 
-    iNeedToNotifyNetworkState = EFalse;
     // determine initial widget online/offline network state
     DetermineNetworkState();
-    iAsyncCallBack = new (ELeave) CAsyncCallBack(TCallBack(DeleteItself,this),CActive::EPriorityUserInput);
     }
 
 // -----------------------------------------------------------------------------
@@ -221,20 +220,10 @@
     delete iLeftSoftKeyLabel;
     delete iWidgetUiDialogsProviderProxy;
     delete iSchemeHandler;
-    
-    iActiveMiniviewBitmap = 0;
-    iMiniviewBitmap1.Reset();
-    iMiniviewBitmap2.Reset();
-    
+    delete iMiniviewBitmap;
 #ifdef BRDO_WRT_HS_FF
     delete iNetworkModeWait;
 #endif
-    if(iAsyncCallBack)
-        {
-        iAsyncCallBack->Cancel();
-        }
-    delete iAsyncCallBack;
-    iAsyncCallBack=NULL;    
     }
 
 // -----------------------------------------------------------------------------
@@ -581,17 +570,7 @@
             // reset the Right Softkey
             TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyRight,KNullDesC,KDummyCommand,EChangeReasonLoad));
             }
-        if (iLeftSoftKeyLabel)
-            {
-            // restore the Left Softkey
-            TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyLeft,*iLeftSoftKeyLabel,KDummyCommand,EChangeReasonLoad));
-            }
-        else
-            {
-            // reset the Left Softkey
-            TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyLeft,KNullDesC,KDummyCommand,EChangeReasonLoad));
-            }
-        
+
         // restore state
         if ( !showSoftkeys )
             {
@@ -634,9 +613,6 @@
         {
         Engine()->MakeVisible( ETrue );
         }
-    PublishSnapShot();
-    if(iWidgetLoaded && iNeedToNotifyNetworkState)
-        DetermineNetworkState();
     }
 
 // -----------------------------------------------------------------------------
@@ -651,18 +627,16 @@
         {
 #ifdef BRDO_WRT_HS_FF
 
-        if ( iCpsPublisher)
+        if ( !iMiniviewBitmap )
             {
-            // Swap bitmaps
-            if(iActiveMiniviewBitmap == &iMiniviewBitmap1)
-            	iActiveMiniviewBitmap = &iMiniviewBitmap2;
-            else
-            	iActiveMiniviewBitmap = &iMiniviewBitmap1;
-            
-            // Take snapshot and publish	
+            iMiniviewBitmap = new CFbsBitmap();
+            }
+
+        if ( iMiniviewBitmap && iCpsPublisher)
+            {
             TRAP_IGNORE(
-               (iEngine->TakeSnapshotL( *iActiveMiniviewBitmap ));
-                iCpsPublisher->PublishBitmapL( *iActiveMiniviewBitmap, *iWidgetBundleId );
+               (iEngine->TakeSnapshotL( *iMiniviewBitmap ));
+                iCpsPublisher->PublishBitmapL( *iMiniviewBitmap, *iWidgetBundleId );
                 );
             }
 #endif
@@ -836,13 +810,6 @@
                     iWindowManager.GetConnection()->SetRequestedAP( iap );
                 );
             }
-
-        if ( EBrowserCenRepApSelModeAlwaysAsk == ask )
-            {
-              //Always ask case
-              TUint32 ap( 0 );
-              iWindowManager.GetConnection()->SetRequestedAP( ap );
-            }
         }
     }
 
@@ -858,21 +825,11 @@
     if ( !iWindowManager.GetConnection()->Connected() )
         {
         // 2.2. make a connection
-        iConnecting=ETrue;
-        TInt connFailure = 0;
-        TRAPD(err, connFailure=iWindowManager.GetConnection()->StartConnectionL( ETrue ));
-        iConnecting=EFalse;
-        User::LeaveIfError(err);
-        if(iDeleteItself)
-            iAsyncCallBack->CallBack();
+        TInt connFailure = iWindowManager.GetConnection()->StartConnectionL( ETrue );
         if (KErrCancel == connFailure)
             {
 #ifdef BRDO_WRT_HS_FF
-            if(! (EMiniViewEnabled == WidgetMiniViewState() || 
-                  EMiniViewNotEnabled == WidgetMiniViewState()) )
-                {        
-                iCpsPublisher->NetworkConnectionCancelledL();
-                }
+            iCpsPublisher->NetworkConnectionCancelledL();
 #endif
             User::Leave( connFailure );
             }
@@ -1164,7 +1121,7 @@
     {
     TNetworkState currNetState;
     RWidgetRegistryClientSession& widgetRegistry = iWindowManager.WidgetUIClientSession();
-    TInt inMiniView = !(WidgetMiniViewState()==EMiniViewEnabled || WidgetMiniViewState()==EMiniViewNotEnabled);//widgetRegistry.IsWidgetInMiniView( iUid);
+    TInt inMiniView = widgetRegistry.IsWidgetInMiniView( iUid);
     CWidgetPropertyValue* propValue = widgetRegistry.GetWidgetPropertyValueL( iUid, EAllowNetworkAccess );
     TInt netAccessWdgtProp = *propValue;    // AllowNetworkAccess in the info.plist file
 
@@ -1226,38 +1183,4 @@
             }
         }
     }
-
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::NeedToNotifyNetworkState()
-// -----------------------------------------------------------------------------
-//
-void CWidgetUiWindow::NeedToNotifyNetworkState(TBool aNetworkState)
-    {
-    iNeedToNotifyNetworkState = aNetworkState;
-    }
-
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::CanBeDeleted()
-// -----------------------------------------------------------------------------
-//
-TBool CWidgetUiWindow::CanBeDeleted()
-    {
-    iDeleteItself = iConnecting;
-    return !iConnecting;
-    }
-    
-// -----------------------------------------------------------------------------
-// CWidgetUiWindow::DeleteItself()
-// -----------------------------------------------------------------------------
-//
-TInt CWidgetUiWindow::DeleteItself(TAny* aPtr)
-    {
-    CWidgetUiWindow* self = (CWidgetUiWindow*)aPtr;
-    CWidgetUiWindowManager* p = &self->iWindowManager;
-    delete self;
-    if(p->WindowListCount() == 0)
-        p->ExitNow();
-    return 0;
-    }
-
 // End of file