widgets/widgetapp/src/WidgetUiWindow.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 13:52:38 +0300
branchRCL_3
changeset 41 4bd5176e1bc8
parent 40 8bfb9186a8b8
child 42 a1a5d4e727e8
permissions -rw-r--r--
Revision: 201019 Kit: 2010121
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     1
/*
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2006, 2008 Nokia Corporation and/or its subsidiary(-ies).
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     8
*
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    11
*
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    12
* Contributors:
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    13
*
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
    14
* Description:
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    15
*
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    16
*/
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    17
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    18
#include "WidgetUi.hrh"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    19
#include "WidgetUiWindow.h"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    20
#include "WidgetUiWindowView.h"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    21
#include "WidgetUiWindowContainer.h"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    22
#include "WidgetUiWindowManager.h"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    23
#include "WidgetUiDialogsProviderProxy.h"
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
    24
#include <widgetregistryconstants.h>
25
0ed94ceaa377 Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    25
#include "browser_platform_variant.hrh"
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    26
#ifdef BRDO_WRT_HS_FF
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    27
#include "cpspublisher.h"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    28
#endif
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    29
#include <AknUtils.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    30
#include <ImageConversion.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    31
#include <WidgetUi.rsg>
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
    32
#include <browserdialogsprovider.h>
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    33
#include <schemehandler.h>
25
0ed94ceaa377 Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    34
#include <internetconnectionmanager.h>
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    35
#include "WidgetInstallerInternalCRKeys.h"
25
0ed94ceaa377 Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 15
diff changeset
    36
#include <browseruisdkcrkeys.h>
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    37
#include <StringLoader.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    38
#include <centralrepository.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    39
#include <ApUtils.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    40
#include <AiwGenericParam.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    41
#include <ActiveApDb.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    42
#include <aknsdrawutils.h>
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    43
#include "SWInstWidgetUid.h"
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    44
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    45
#ifdef RD_SCALABLE_UI_V2
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    46
#include <centralrepository.h>
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    47
#include <SensorPluginDomainCrKeys.h>
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    48
#endif //RD_SCALABLE_UI_V2
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    49
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    50
// EXTERNAL DATA STRUCTURES
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    51
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    52
// EXTERNAL FUNCTION PROTOTYPES
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    53
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    54
// CONSTANTS
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    55
static const TUint32 KDummyCommand = 0;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    56
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    57
const TUint KWmlNoDefaultAccessPoint = KMaxTUint; // see cenrep setting default -1 as int, here as uint
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    58
const TUint KWmlNoDefaultSnapId = KMaxTUint; // see cenrep setting default -1 as int, here as uint
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
    59
#ifdef BRDO_OCC_ENABLED_FF
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
    60
const TInt KRetryConnectivityTimeout( 2*1000*1000 ); // 2 seconds
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
    61
#endif
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
    62
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    63
// MACROS
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    64
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    65
// LOCAL CONSTANTS AND MACROS
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    66
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    67
// MODULE DATA STRUCTURES
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    68
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    69
// LOCAL FUNCTION PROTOTYPES
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    70
static HBufC* GetUlrL(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    71
    RWidgetRegistryClientSession& aSession,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    72
    const TUid& aUid );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    73
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    74
// FORWARD DECLARATIONS
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    75
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    76
// ============================= LOCAL FUNCTIONS ===============================
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    77
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    78
HBufC* GetUlrL(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    79
    RWidgetRegistryClientSession& aSession,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    80
    const TUid& aUid )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    81
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    82
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    83
    CWidgetPropertyValue* val( aSession.GetWidgetPropertyValueL( aUid, EMainHTML ) );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    84
    CleanupStack::PushL( val );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    85
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    86
    HBufC* res( static_cast< const TDesC& >( *val ).AllocL() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    87
    CleanupStack::PopAndDestroy( val );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    88
    return res;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    89
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    90
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    91
// ============================ MEMBER FUNCTIONS ===============================
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    92
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    93
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    94
// CWidgetUiWindow::CWidgetUiWindow()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    95
// C++ constructor
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    96
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    97
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    98
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
    99
CWidgetUiWindow::CWidgetUiWindow( CWidgetUiWindowManager& aWindowManager, CCpsPublisher* aCpsPublisher )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   100
    : iWindowManager( aWindowManager ), iCpsPublisher( aCpsPublisher ), iNetworkAccessGrant(EInvalid),
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   101
      iPreferredOrientation(TBrCtlDefs::EOrientationUndefined),
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   102
      iIsCurrent(EFalse), iShowSoftkeys(EFalse), iWidgetLoaded(EFalse),
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   103
      iSchemeProcessing (EFalse),iClickCount(0), iWidgetLoadStarted(EFalse),
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   104
      iNetworkState(ENetworkNotAllowed), iUserPermission(ETrue)
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   105
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   106
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   107
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   108
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   109
// CWidgetUiWindow::ConstructL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   110
// Symbian constructor
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   111
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   112
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   113
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   114
void CWidgetUiWindow::ConstructL( const TUid& aUid )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   115
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   116
    iUid = aUid;
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   117
    iDialogsProvider = CBrowserDialogsProvider::NewL( NULL );
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   118
    
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   119
    iPenEnabled = AknLayoutUtils::PenEnabled();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   120
    iShowSoftkeys = iPenEnabled;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   121
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   122
    CWidgetUiWindowView* view = iWindowManager.View();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   123
    // view->ShowActivatedObject(EFalse);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   124
    //TRect rect( view->Container()->Rect() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   125
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   126
    TRect rect;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   127
    RWidgetRegistryClientSession clientSession = iWindowManager.WidgetUIClientSession();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   128
    iUrl = GetUlrL( clientSession, aUid );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   129
    iWidgetUiObserver = CWidgetUiObserver::NewL( *this );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   130
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   131
    iWidgetUiDialogsProviderProxy = CWidgetUiDialogsProviderProxy::NewL(*iDialogsProvider, NULL, *this);
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   132
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   133
#ifdef BRDO_WRT_HS_FF
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   134
    iNetworkModeWait = new(ELeave) CActiveSchedulerWait();
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   135
#endif
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   136
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   137
    unsigned int capabilities;
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   138
    if (iWindowManager.CursorShowMode() == TBrCtlDefs::ENoCursor)
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   139
        {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   140
        //no cursor
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   141
        capabilities = TBrCtlDefs::ECapabilityLoadHttpFw |
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   142
                         TBrCtlDefs::ECapabilityWebKitLite |
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   143
                         TBrCtlDefs::ECapabilityClientResolveEmbeddedURL;
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   144
        }
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   145
    else
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   146
        {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   147
        //cursor is setting
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   148
        capabilities = TBrCtlDefs::ECapabilityLoadHttpFw |
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   149
                        TBrCtlDefs::ECapabilityCursorNavigation|
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   150
                        TBrCtlDefs::ECapabilityWebKitLite |
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   151
                        TBrCtlDefs::ECapabilityClientResolveEmbeddedURL;
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   152
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   153
        }
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   154
    iEngine = CreateBrowserControlL(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   155
        view->Container(),
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   156
        rect,
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   157
            capabilities,
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   158
        TBrCtlDefs::ECommandIdBase,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   159
        iWidgetUiObserver, /* softkeys */
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   160
        iWidgetUiObserver, /* link resolver */
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   161
        this, /* special load observer */
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   162
        iWidgetUiObserver, /* layout observer */
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   163
        iWidgetUiDialogsProviderProxy,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   164
        iWidgetUiObserver, /* window observer */
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   165
        iWidgetUiObserver /* download observer */);
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   166
    //Set the cursor mode inside Widget
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   167
    iEngine->SetBrowserSettingL(TBrCtlDefs::ESettingsCursorShowMode, iWindowManager.CursorShowMode());
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   168
    iEngine->SetBrowserSettingL(TBrCtlDefs::ESettingsEnterKeyMode, iWindowManager.EnterKeyMode());
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   169
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   170
    iEngine->AddLoadEventObserverL( iWidgetUiObserver );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   171
    iEngine->AddStateChangeObserverL( view );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   172
    iEngine->SetComponentsToInheritVisibility();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   173
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   174
    iWidgetExtension = iEngine->CreateWidgetExtensionL( *this );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   175
    iWidgetExtension->SetParamL( TBrCtlDefs::EWidgetIdentifier, aUid.iUid );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   176
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   177
    iWidgetBundleId = HBufC::NewL(KWidgetRegistryVal);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   178
    TPtr widgetBundleId = iWidgetBundleId->Des();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   179
    iWidgetPath = HBufC::NewL(KWidgetRegistryVal);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   180
    TPtr widgetPath = iWidgetPath->Des();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   181
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   182
    clientSession.GetWidgetBundleId( aUid, widgetBundleId );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   183
    clientSession.GetWidgetPath( aUid, widgetPath );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   184
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   185
    iWidgetExtension->SetParamL( TBrCtlDefs::EWidgetBasePath, widgetPath );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   186
    iWidgetExtension->SetParamL( TBrCtlDefs::EWidgetBundleId, widgetBundleId );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   187
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   188
    //    SetSoftkeysVisible(iPenEnabled);// default softkeys visible for touch and invisible for non-touch
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   189
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   190
    //iEngine->MakeVisible( EFalse );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   191
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   192
    // Updating Widget UI window state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   193
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   194
    if(HasMiniviewL())
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   195
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   196
        SetWindowStateMiniViewL( EMiniViewEnabled );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   197
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   198
    else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   199
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   200
        SetWindowStateMiniViewL( EMiniViewNotEnabled );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   201
        }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   202
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   203
    iDlId = 0;
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   204
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   205
    iNeedToNotifyNetworkState = EFalse;
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   206
    // determine initial widget online/offline network state
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   207
    DetermineNetworkState();
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   208
    iAsyncCallBack = new (ELeave) CAsyncCallBack(TCallBack(DeleteItself,this),CActive::EPriorityUserInput);
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   209
#ifdef BRDO_OCC_ENABLED_FF
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   210
    iConnStageNotifier = CConnectionStageNotifierWCB::NewL();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   211
    //this is required, browser's connection oberver should be hit first. (incase of netscape plgins, transactions will be closed.)
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   212
    iConnStageNotifier->SetPriority(CActive::EPriorityHigh);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   213
    iRetryConnectivity = CPeriodic::NewL(CActive::EPriorityStandard);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   214
#endif
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   215
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   216
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   217
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   218
// CWidgetUiWindow::~CWidgetUiWindow()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   219
// Destructor
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   220
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   221
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   222
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   223
CWidgetUiWindow::~CWidgetUiWindow()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   224
    {
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   225
    if( iDialogsProvider)
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   226
        {
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   227
         iDialogsProvider->CancelAll();
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   228
        }
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   229
    if (iEngine && iWidgetUiObserver)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   230
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   231
        iEngine->RemoveLoadEventObserver( iWidgetUiObserver );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   232
        iEngine->RemoveStateChangeObserver( iWindowManager.View() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   233
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   234
    delete iEngine;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   235
    delete iWidgetUiObserver;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   236
    delete iUrl;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   237
    delete iWidgetPath;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   238
    delete iWidgetBundleId;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   239
    delete iRightSoftKeyLabel;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   240
    delete iLeftSoftKeyLabel;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   241
    delete iWidgetUiDialogsProviderProxy;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   242
    delete iSchemeHandler;
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   243
    
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   244
    iActiveMiniviewBitmap = 0;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   245
    iMiniviewBitmap1.Reset();
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   246
    iMiniviewBitmap2.Reset();
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   247
    
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   248
#ifdef BRDO_WRT_HS_FF
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   249
    delete iNetworkModeWait;
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   250
#endif
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   251
    if(iAsyncCallBack)
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   252
        {
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   253
        iAsyncCallBack->Cancel();
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   254
        }
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   255
    delete iAsyncCallBack;
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   256
    iAsyncCallBack=NULL;  
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   257
    delete iDialogsProvider;
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   258
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   259
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   260
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   261
// CWidgetUiWindow::CbaGroup()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   262
// returns cba group
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   263
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   264
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   265
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   266
CEikButtonGroupContainer* CWidgetUiWindow::CbaGroup()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   267
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   268
    return iWindowManager.View()->CbaGroup();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   269
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   270
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   271
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   272
// CWidgetUiWindow::OpenWindowL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   273
// Creates CWidgetUiWindow object
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   274
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   275
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   276
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   277
CWidgetUiWindow* CWidgetUiWindow::OpenWindowL( CWidgetUiWindowManager& aWindowManager,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   278
                                         const TUid& aUid, CCpsPublisher* aCpsPublisher )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   279
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   280
    CWidgetUiWindow* window = new ( ELeave ) CWidgetUiWindow( aWindowManager, aCpsPublisher );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   281
    CleanupStack::PushL( window );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   282
    window->ConstructL( aUid );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   283
    CleanupStack::Pop( window );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   284
    return window;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   285
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   286
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   287
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   288
// CWidgetUiWindow::setWindowStateFullView()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   289
// Sets the widget state if widget is opened in full view
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   290
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   291
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   292
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   293
void CWidgetUiWindow::SetWindowStateFullView( TBool aWidgetFullViewState)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   294
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   295
    iWidgetWindowState.iFullViewState = aWidgetFullViewState;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   296
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   297
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   298
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   299
// CWidgetUiWindow::setWindowStateMiniView()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   300
// Sets the MiniView widget state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   301
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   302
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   303
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   304
/*void CWidgetUiWindow::SetWindowStateMiniView( TInt widgetMiniViewState )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   305
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   306
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   307
    switch(widgetMiniViewState)
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   308
        {
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   309
        case 0: iWidgetWindowState.miniViewState = EMiniViewNotEnabled;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   310
                break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   311
        case 1: iWidgetWindowState.miniViewState = EMiniViewEnabled;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   312
                break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   313
        case 2: iWidgetWindowState.miniViewState = EPublishStart;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   314
                break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   315
        case 3: iWidgetWindowState.miniViewState = EPublishSuspend;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   316
                break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   317
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   318
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   319
    */
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   320
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   321
// CWidgetUiWindow::setWindowStateMiniView()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   322
// Sets the MiniView widget state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   323
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   324
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   325
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   326
void CWidgetUiWindow::SetWindowStateMiniViewL( TMiniViewState widgetMiniViewState)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   327
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   328
    iWidgetWindowState.iMiniViewState = widgetMiniViewState;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   329
    if (  iWidgetWindowState.iMiniViewState == EPublishStart )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   330
        iWidgetExtension->SetParamL( TBrCtlDefs::EWidgetPublishState, ETrue);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   331
    else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   332
        iWidgetExtension->SetParamL( TBrCtlDefs::EWidgetPublishState, EFalse);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   333
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   334
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   335
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   336
// CWidgetUiWindow::getWidgetMiniViewState()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   337
// Get  the MiniView widget state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   338
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   339
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   340
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   341
TMiniViewState CWidgetUiWindow::WidgetMiniViewState() const
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   342
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   343
    return iWidgetWindowState.iMiniViewState;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   344
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   345
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   346
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   347
// CWidgetUiWindow::getWidgetFullViewState()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   348
// Get  the FullView widget state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   349
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   350
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   351
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   352
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   353
TBool CWidgetUiWindow::WidgetFullViewState() const
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   354
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   355
    return iWidgetWindowState.iFullViewState;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   356
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   357
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   358
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   359
// CWidgetUiWindow::DialogMimeFileSelectLC()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   360
// Navigates through your file system and selects a file of specific mime type
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   361
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   362
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   363
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   364
TBool CWidgetUiWindow::DialogMimeFileSelectLC(HBufC*& aSelectedFileName,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   365
                                 const TDesC& aMimeType)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   366
    {
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   367
    return iDialogsProvider->DialogMimeFileSelectLC(aSelectedFileName, aMimeType);
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   368
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   369
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   370
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   371
// CWidgetUiWindow::SetSoftkeysVisible()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   372
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   373
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   374
void CWidgetUiWindow::SetSoftkeysVisible(TBool aVisible)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   375
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   376
    iShowSoftkeys = (aVisible);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   377
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   378
    MakeSoftkeysVisible(aVisible, EFalse);
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   379
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   380
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   381
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   382
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   383
// CWidgetUiWindow::SetDisplayMode()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   384
// switch the display orientation to landscape or portrait
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   385
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   386
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   387
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   388
void CWidgetUiWindow::SetDisplayMode( TBrCtlDefs::TBrCtlOrientation aOrientation )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   389
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   390
    if (aOrientation != TBrCtlDefs::EOrientationUndefined)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   391
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   392
        iPreferredOrientation = aOrientation;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   393
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   394
    switch (iPreferredOrientation)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   395
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   396
        case TBrCtlDefs::EOrientationLandscape:
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   397
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   398
            iWindowManager.SetDisplayLandscape();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   399
            break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   400
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   401
        case TBrCtlDefs::EOrientationPortrait:
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   402
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   403
            iWindowManager.SetDisplayPortrait();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   404
            break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   405
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   406
        default:
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   407
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   408
            iWindowManager.SetDisplayAuto();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   409
            break;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   410
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   411
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   412
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   413
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   414
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   415
// CWidgetUiWindow::SetSoftKeyLabelL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   416
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   417
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   418
void CWidgetUiWindow::SetSoftKeyLabelL( TBrCtlKeySoftkey aKeySoftkey, const TDesC& aText)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   419
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   420
    TInt command;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   421
    if (aKeySoftkey == EKeyLeft)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   422
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   423
        command = EAknSoftkeyOptions;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   424
        // save the softkey label if it changes
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   425
        if (iLeftSoftKeyLabel && iLeftSoftKeyLabel->Compare(aText))
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   426
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   427
            delete iLeftSoftKeyLabel;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   428
            iLeftSoftKeyLabel = NULL;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   429
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   430
        if (!iLeftSoftKeyLabel)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   431
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   432
            iLeftSoftKeyLabel = aText.AllocL();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   433
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   434
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   435
    else // EKeyRight
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   436
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   437
        command = EAknSoftkeyExit;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   438
        // save the softkey label if it changes
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   439
        if (iRightSoftKeyLabel && iRightSoftKeyLabel->Compare(aText))
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   440
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   441
            delete iRightSoftKeyLabel;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   442
            iRightSoftKeyLabel = NULL;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   443
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   444
        if (!iRightSoftKeyLabel)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   445
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   446
            iRightSoftKeyLabel = aText.AllocL();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   447
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   448
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   449
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   450
    // make sure softkeys are visible before setting the text
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   451
    // CEikButtonGroupContainer::Current() returns NULL if softkeys are not visible
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   452
    SetSoftkeysVisible(iShowSoftkeys);
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   453
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   454
    TInt err(KErrNotFound);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   455
    // check to see if aText is a filename
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   456
    if (aText.Find(_L(".")) != KErrNotFound)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   457
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   458
        TRAP(err,SetSoftKeyImageL( command, aText ));
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   459
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   460
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   461
    if (CbaGroup())
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   462
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   463
        if (err != KErrNone)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   464
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   465
            CbaGroup()->SetCommandL( command, aText );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   466
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   467
        CbaGroup()->DrawDeferred();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   468
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   469
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   470
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   471
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   472
// CWidgetUiWindow::SetSoftKeyImageL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   473
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   474
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   475
void CWidgetUiWindow::SetSoftKeyImageL(const TInt aCommand, const TDesC& aFilename)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   476
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   477
    HBufC* filename = HBufC::NewLC( iUrl->Length() + aFilename.Length() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   478
    TPtr ptr(filename->Des());
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   479
    TInt last = iUrl->LocateReverse('\\');
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   480
    if (last > 0)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   481
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   482
        ptr.Append(iUrl->Left(++last));
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   483
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   484
    ptr.Append(aFilename);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   485
    ptr.ZeroTerminate();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   486
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   487
    RFs& server( CCoeEnv::Static()->FsSession() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   488
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   489
    CImageDecoder *iImageDecoder = CImageDecoder::FileNewL(server,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   490
               ptr,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   491
               CImageDecoder::EOptionAlwaysThread);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   492
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   493
    TFrameInfo info = iImageDecoder->FrameInfo();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   494
    TRect      rect = info.iFrameCoordsInPixels;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   495
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   496
    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   497
    CleanupStack::PushL(bitmap);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   498
    CFbsBitmap* mask = new (ELeave) CFbsBitmap;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   499
    CleanupStack::PushL(mask);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   500
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   501
    bitmap->Create( rect.Size(), info.iFrameDisplayMode );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   502
    mask->Create( rect.Size(), EGray256 );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   503
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   504
    TRequestStatus Status;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   505
    iImageDecoder->Convert( &Status, *bitmap, *mask );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   506
    User::WaitForRequest( Status );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   507
    delete iImageDecoder;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   508
    iImageDecoder = NULL;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   509
    //bitmap->Compress();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   510
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   511
    if (CbaGroup())
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   512
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   513
        CbaGroup()->SetCommandL( aCommand, *bitmap, *mask ); // FYI This hasn't been implemented
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   514
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   515
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   516
    CleanupStack::PopAndDestroy(3);// filename,bitmap,mask
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   517
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   518
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   519
// -----------------------------------------------------------------------------
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   520
// CWidgetUiWindow::RelayoutL( TInt aType )
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   521
// switch the display orientation based on preferred setting
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   522
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   523
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   524
//
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   525
void CWidgetUiWindow::RelayoutL( TInt aType )
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   526
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   527
    if (iIsCurrent)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   528
        {
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   529
#ifdef RD_SCALABLE_UI_V2
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   530
        if(aType == KEikDynamicLayoutVariantSwitch)
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   531
            {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   532
            CRepository* iSensor = CRepository::NewLC(KCRUidSensorSettings);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   533
            TInt sensorOn = 0;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   534
            //get sensor is on/off from general settings
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   535
            iSensor->Get(KSenSettingsSensorsOn, sensorOn);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   536
            if(sensorOn == 0)
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   537
                {    
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   538
                TRect rec = iWindowManager.View()->Container()->Rect();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   539
                if( rec.Height() < rec.Width())
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   540
                    iPreferredOrientation = TBrCtlDefs::EOrientationLandscape;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   541
                else
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   542
                    iPreferredOrientation = TBrCtlDefs::EOrientationPortrait;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   543
                }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   544
            CleanupStack::PopAndDestroy();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   545
            }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   546
#endif // RD_SCALABLE_UI_V2
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   547
        SetDisplayMode(iPreferredOrientation);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   548
        SetSoftkeysVisible(iShowSoftkeys);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   549
        //iWindowManager.View()->Container()->SizeChanged();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   550
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   551
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   552
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   553
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   554
// CWidgetUiWindow::SetCurrentWindow()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   555
// sets this window current or not and resets the previous state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   556
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   557
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   558
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   559
void CWidgetUiWindow::SetCurrentWindow( TBool aCurrent )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   560
    {
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   561
    if (iIsCurrent != aCurrent && iWindowManager.View() && Engine())
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   562
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   563
        iIsCurrent = aCurrent;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   564
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   565
        iWindowManager.View()->UpdateStatusPane(EFalse); // deactivates any open edit boxes
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   566
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   567
        if (aCurrent)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   568
            {
5
10e98eab6f85 Revision: 200919
Pat Downey <patrick.downey@nokia.com>
parents: 1
diff changeset
   569
            UpdateCba();
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   570
            Engine()->MakeVisible( iWidgetLoaded );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   571
            // redraw incase the orientation changed while in the background
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   572
            RelayoutL();
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   573
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   574
        else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   575
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   576
            // close the menu
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   577
            iWindowManager.View()->StopDisplayingMenuBar();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   578
            //deactivate optionsmenu flag
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   579
            iWindowManager.View()->DeActivateOptionsMenu();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   580
            Engine()->MakeVisible(EFalse);// hide the active widget
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   581
            }
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   582
        if ( !aCurrent &&  (EPublishStart != WidgetMiniViewState()) )
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   583
            {
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   584
            iWidgetExtension->HandleCommandL ( (TInt)TBrCtlDefs::ECommandAppBackground + (TInt)TBrCtlDefs::ECommandIdBase );
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   585
            if( iWindowManager.AnyWidgetOnHs() )
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   586
                {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   587
                //If there is no widget on HS then we should not stop the JS timers
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   588
                Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandAppBackground + (TInt)TBrCtlDefs::ECommandIdBase);
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   589
                }
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   590
            }
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   591
        if ( aCurrent )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   592
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   593
            Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandAppForeground + (TInt)TBrCtlDefs::ECommandIdBase);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   594
            iWidgetExtension->HandleCommandL( (TInt)TBrCtlDefs::ECommandAppForeground + (TInt)TBrCtlDefs::ECommandIdBase );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   595
           }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   596
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   597
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   598
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   599
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   600
// CWidgetUiWindow::UpdateCba()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   601
// Restore the softkeys when the widget comes from the background
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   602
// Reset the softkeys when the widget goes in the background
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   603
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   604
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   605
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   606
void CWidgetUiWindow::UpdateCba( )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   607
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   608
    if (iIsCurrent)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   609
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   610
        TBool showSoftkeys( iShowSoftkeys );// save state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   611
            //CbaGroup()->MakeVisible( ETrue );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   612
        if (iRightSoftKeyLabel)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   613
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   614
            // restore the Right Softkey
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   615
            TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyRight,*iRightSoftKeyLabel,KDummyCommand,EChangeReasonLoad));
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   616
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   617
        else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   618
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   619
            // reset the Right Softkey
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   620
            TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyRight,KNullDesC,KDummyCommand,EChangeReasonLoad));
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   621
            }
27
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   622
        if (iLeftSoftKeyLabel)
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   623
            {
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   624
            // restore the Left Softkey
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   625
            TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyLeft,*iLeftSoftKeyLabel,KDummyCommand,EChangeReasonLoad));
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   626
            }
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   627
        else
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   628
            {
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   629
            // reset the Left Softkey
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   630
            TRAP_IGNORE(iWidgetUiObserver->UpdateSoftkeyL(EKeyLeft,KNullDesC,KDummyCommand,EChangeReasonLoad));
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   631
            }
6297cdf66332 Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 26
diff changeset
   632
        
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   633
        // restore state
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   634
        if ( !showSoftkeys )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   635
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   636
            CbaGroup()->MakeVisible( EFalse );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   637
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   638
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   639
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   640
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   641
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   642
// CWidgetUiWindow::ReloadWidget()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   643
// load the widget
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   644
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   645
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   646
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   647
void CWidgetUiWindow::ReloadWidget( )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   648
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   649
    SetWidgetLoaded(EFalse);
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   650
    iWidgetLoadStarted = ETrue;
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   651
    TRAPD(err,iEngine->LoadFileL( iUrl->Des() ));
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   652
    if (err != KErrNone)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   653
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   654
        SetWidgetLoaded(ETrue);
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   655
        iWidgetLoadStarted = EFalse;
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   656
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   657
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   658
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   659
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   660
// CWidgetUiWindow::SetWidgetLoaded()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   661
// notification that the widget has finished loading
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   662
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   663
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   664
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   665
void CWidgetUiWindow::SetWidgetLoaded( TBool aWidgetLoaded )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   666
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   667
    iWidgetLoaded = aWidgetLoaded;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   668
    RWidgetRegistryClientSession& widgetRegistry = iWindowManager.WidgetUIClientSession();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   669
    TInt fullView = widgetRegistry.IsWidgetInFullView( Uid() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   670
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   671
    if (iWidgetLoaded && iIsCurrent && fullView )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   672
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   673
        Engine()->MakeVisible( ETrue );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   674
        }
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   675
    PublishSnapShot();
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   676
    if(iWidgetLoaded && iNeedToNotifyNetworkState)
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   677
        DetermineNetworkState();
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   678
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   679
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   680
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   681
// CWidgetUiWindow::PublishSnapShot()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   682
// pubish offscreen bitmap to CPSpublisger
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   683
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   684
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   685
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   686
void CWidgetUiWindow::PublishSnapShot()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   687
    {
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   688
    if( iWidgetLoaded && (WidgetMiniViewState() == EPublishStart ) )
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   689
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   690
#ifdef BRDO_WRT_HS_FF
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   691
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   692
        if ( iCpsPublisher)
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   693
            {
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   694
            // Swap bitmaps
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   695
            if(iActiveMiniviewBitmap == &iMiniviewBitmap1)
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   696
            	iActiveMiniviewBitmap = &iMiniviewBitmap2;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   697
            else
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   698
            	iActiveMiniviewBitmap = &iMiniviewBitmap1;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   699
            
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   700
            // Take snapshot and publish	
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   701
            TRAP_IGNORE(
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   702
               (iEngine->TakeSnapshotL( *iActiveMiniviewBitmap ));
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   703
                iCpsPublisher->PublishBitmapL( *iActiveMiniviewBitmap, *iWidgetBundleId );
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   704
                );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   705
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   706
#endif
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   707
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   708
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   709
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   710
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   711
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   712
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   713
// CWidgetUiWindow::HasMiniviewL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   714
// Check whether widget has miniview or not
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   715
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   716
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   717
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   718
TBool CWidgetUiWindow::HasMiniviewL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   719
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   720
    RWidgetRegistryClientSession clientSession = iWindowManager.WidgetUIClientSession();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   721
    CWidgetPropertyValue* propValue = clientSession.GetWidgetPropertyValueL( iUid, EMiniViewEnable );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   722
    TInt hasMiniview = *propValue;
5
10e98eab6f85 Revision: 200919
Pat Downey <patrick.downey@nokia.com>
parents: 1
diff changeset
   723
    delete propValue;
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   724
    return hasMiniview;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   725
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   726
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   727
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   728
// CWidgetUiWindow::CheckNetworkAccessL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   729
// Check Network access is allowed
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   730
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   731
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   732
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   733
TBool CWidgetUiWindow::CheckNetworkAccessL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   734
    {
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   735
    // if widgets in offline mode, deny network access
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   736
    if (iWindowManager.GetNetworkMode() == EOfflineMode && !( EMiniViewEnabled == WidgetMiniViewState() ||
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   737
        EMiniViewNotEnabled == WidgetMiniViewState() ))
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   738
        {
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   739
        // if widget is in full view, offer user the option to go to online mode.The widget should be in HS else dont ask HS for prompt.
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   740
#ifdef BRDO_WRT_HS_FF
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   741
        if ( WidgetFullViewState() && WidgetMiniViewState() != EPublishStart )
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   742
            {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   743
            iCpsPublisher->NetworkConnectionAllowedL();
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   744
            iNetworkModeWait->Start();
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   745
            }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   746
#endif
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   747
        if (iWindowManager.GetNetworkMode() == EOfflineMode)
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   748
            {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   749
            SetNetworkAccessGrant( EDeny );
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   750
            User::Leave( KErrAccessDenied );
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
   751
            }
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   752
        }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   753
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   754
    // begin info.plist (declare EAllowNetworkAccess or EAllowFullAccess ?)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   755
    RWidgetRegistryClientSession& widgetRegistry
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   756
                = iWindowManager.WidgetUIClientSession();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   757
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   758
    CWidgetPropertyValue* propValue = widgetRegistry.GetWidgetPropertyValueL(iUid, EAllowNetworkAccess );
5
10e98eab6f85 Revision: 200919
Pat Downey <patrick.downey@nokia.com>
parents: 1
diff changeset
   759
    TInt networkAccess = *propValue;
10e98eab6f85 Revision: 200919
Pat Downey <patrick.downey@nokia.com>
parents: 1
diff changeset
   760
    delete propValue;
36
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   761
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   762
    propValue = widgetRegistry.GetWidgetPropertyValueL(iUid, EAllowFullAccess );
5
10e98eab6f85 Revision: 200919
Pat Downey <patrick.downey@nokia.com>
parents: 1
diff changeset
   763
    TInt fullAccess = *propValue;
10e98eab6f85 Revision: 200919
Pat Downey <patrick.downey@nokia.com>
parents: 1
diff changeset
   764
    delete propValue;
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   765
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   766
    if ( !( networkAccess || fullAccess ) )
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   767
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   768
        SetNetworkAccessGrant( EDeny );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   769
        User::Leave( KErrAccessDenied );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   770
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   771
    SetNetworkAccessGrant( EAllow );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   772
    // end info.plist check
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   773
    return ETrue;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   774
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   775
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   776
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   777
// CWidgetUiWindow::NetworkSecurityCheckL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   778
// Prompt for netwrok security
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   779
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   780
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   781
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   782
void CWidgetUiWindow::NetworkSecurityCheckL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   783
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   784
    if ( EInvalid == NetworkAccessGrant() && CheckNetworkAccessL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   785
        && EDeny != NetworkAccessGrant())
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   786
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   787
        TInt prompt =  1 ; // default to prompt
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   788
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   789
        // CRepository KWidgetPomptForNetworkAccess: missing => prompt,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   790
        // 0 => allow, 1 => prompt
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   791
        CRepository* rep( NULL );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   792
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   793
        // WidgetApp sharing WidgetInstaller cenrep
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   794
        TRAPD( cenrepError, rep = CRepository::NewL( TUid::Uid( KSWInstWidgetUIUid ) ) );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   795
        if ( !cenrepError )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   796
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   797
             if ( rep->Get( KWidgetPomptForNetworkAccess, prompt ) )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   798
                {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   799
                    prompt = 1; // got error, force prompt
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   800
                }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   801
                delete rep;
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   802
            }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   803
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   804
            if ( prompt )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   805
                {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   806
                TBool grant = EFalse;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   807
                HBufC* message = StringLoader::LoadLC( R_WIDGETUI_NETWORK_ACCESS );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   808
                HBufC* yes = StringLoader::LoadLC( R_WIDGETUI_SOFTKEY_YES );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   809
                HBufC* no = StringLoader::LoadLC( R_WIDGETUI_SOFTKEY_NO );
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
   810
                grant = iDialogsProvider->DialogConfirmL( _L(""), *message, *yes, *no );
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   811
                CleanupStack::PopAndDestroy( 3 );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   812
                // save prompt result for session
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   813
                SetNetworkAccessGrant( grant? EAllow : EDeny );
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   814
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   815
                CheckUserPermissionChanged( grant );
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   816
                }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   817
            else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   818
                {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   819
                // cenrep setting is no prompt for session
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   820
                SetNetworkAccessGrant( EAllow );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   821
                }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   822
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   823
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   824
        // after code above, which may have prompted user, perform a final access check
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   825
        if ( EAllow != NetworkAccessGrant( ) )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   826
        {
1
7c90e6132015 Revision: 200915
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents: 0
diff changeset
   827
        User::Leave( KErrCancel );
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   828
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   829
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   830
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   831
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   832
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   833
// CWidgetUiWindow::ConnectionManagement()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   834
// Set up the access point from browser setting
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   835
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   836
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   837
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   838
void CWidgetUiWindow::ConnectionManagement()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   839
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   840
    if ( !iWindowManager.GetConnection()->Connected() )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   841
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   842
        // setup a new connection depending on browser settings
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   843
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   844
        // 2.1. deal with access point settings
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   845
        TInt ask( 1 );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   846
        TInt wmlId( KWmlNoDefaultAccessPoint );
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   847
        TInt snapId( KWmlNoDefaultSnapId );
35
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
   848
#ifndef BRDO_OCC_ENABLED_FF
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   849
        CRepository* rep( NULL );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   850
        TRAPD( cenrepError, rep = CRepository::NewL( KCRUidBrowser ) );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   851
        if ( KErrNone == cenrepError )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   852
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   853
            (void)rep->Get( KBrowserAccessPointSelectionMode, ask );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   854
            (void)rep->Get( KBrowserDefaultAccessPoint, wmlId );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   855
            (void)rep->Get( KBrowserNGDefaultSnapId, snapId );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   856
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   857
        delete rep;
35
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
   858
#endif
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   859
        if ( ask == EBrowserCenRepApSelModeDestination &&
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   860
           ( snapId != KWmlNoDefaultSnapId) )
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   861
            {
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   862
            iWindowManager.GetConnection()->SetRequestedSnap( snapId );
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   863
            iWindowManager.GetConnection()->SetConnectionType( CMManager::EDestination );
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   864
            }
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   865
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   866
        if ( !ask && (KWmlNoDefaultAccessPoint != wmlId) )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   867
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   868
            // set the access point (ap)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   869
            CApUtils* apUtils( NULL );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   870
            TInt apUtilError( KErrNone );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   871
            TRAP(   apUtilError,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   872
                    apUtils = CApUtils::NewLC( *(iWindowManager.GetDb()->Database()) );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   873
                    TUint32 iap = apUtils->IapIdFromWapIdL( wmlId );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   874
                    CleanupStack::PopAndDestroy();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   875
                    iWindowManager.GetConnection()->SetRequestedAP( iap );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   876
                );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   877
            }
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   878
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   879
        if ( EBrowserCenRepApSelModeAlwaysAsk == ask )
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   880
            {
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   881
              //Always ask case
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   882
              TUint32 ap( 0 );
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   883
              iWindowManager.GetConnection()->SetRequestedAP( ap );
36
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   884
#ifdef BRDO_OCC_ENABLED_FF
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   885
              TUint32 snapId = 0; //Defaults connects to Internet snap
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   886
              iWindowManager.GetConnection()->SetConnectionType(CMManager::EDestination);
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   887
              iWindowManager.GetConnection()->SetRequestedSnap(snapId);
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   888
#endif
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   889
            }
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   890
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   891
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   892
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   893
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   894
// CWidgetUiWindow::StartNetworkConnection()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   895
// Start network connection
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   896
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   897
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   898
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   899
void CWidgetUiWindow::StartNetworkConnectionL(TBool* aNewConn)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   900
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   901
    *aNewConn = EFalse;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   902
    if ( !iWindowManager.GetConnection()->Connected() )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   903
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   904
        // 2.2. make a connection
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   905
        iConnecting=ETrue;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   906
        TInt connFailure = 0;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   907
        TRAPD(err, connFailure=iWindowManager.GetConnection()->StartConnectionL( ETrue ));
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   908
        iConnecting=EFalse;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   909
        User::LeaveIfError(err);
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   910
        if(iDeleteItself)
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   911
            iAsyncCallBack->CallBack();
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   912
        if (KErrCancel == connFailure)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   913
            {
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   914
#ifdef BRDO_WRT_HS_FF
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   915
            if(! (EMiniViewEnabled == WidgetMiniViewState() || 
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   916
                  EMiniViewNotEnabled == WidgetMiniViewState()) )
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   917
                {        
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   918
                iCpsPublisher->NetworkConnectionCancelledL();
34
220a17280356 Revision: 201006
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 27
diff changeset
   919
                iNetworkModeWait->Start();
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
   920
                }
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
   921
#endif
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   922
            User::Leave( connFailure );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   923
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   924
        else if ( KErrNone != connFailure )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   925
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   926
            // Note: In case of no network signal, user may be prompted
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   927
            // multiple times to pick a connection. But that is likely the
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   928
            // least evil option, because they can pick another connection,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   929
            // or hit cancel altogether in which case the KErrCancel block above
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   930
            // kicks in and sets a EDeny.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   931
            User::Leave( connFailure );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   932
            }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
   933
        *aNewConn = ETrue;
40
8bfb9186a8b8 Revision: 201018
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 38
diff changeset
   934
        
8bfb9186a8b8 Revision: 201018
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 38
diff changeset
   935
#ifdef BRDO_OCC_ENABLED_FF        
8bfb9186a8b8 Revision: 201018
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 38
diff changeset
   936
        TRAP_IGNORE(ConnNeededStatusL(KErrNone)); 
8bfb9186a8b8 Revision: 201018
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 38
diff changeset
   937
#endif        
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   938
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   939
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   940
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   941
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   942
// CWidgetUiWindow::NetworkConnectionNeededL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   943
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   944
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   945
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   946
void CWidgetUiWindow::NetworkConnectionNeededL( TInt* aConnectionPtr,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   947
                                      TInt* aSockSvrHandle,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   948
                                      TBool* aNewConn,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   949
                                      TApBearerType* aBearerType )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   950
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   951
    {
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   952
#ifdef BRDO_OCC_ENABLED_FF
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   953
    TBool retryFlag = GetRetryFlag();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   954
    if( retryFlag )
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   955
        {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   956
        return;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   957
        }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
   958
#endif
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   959
    // default in case connection setup fails
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   960
    *aConnectionPtr = 0;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   961
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   962
    if( EMiniViewEnabled == WidgetMiniViewState() ||
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   963
        EMiniViewNotEnabled == WidgetMiniViewState())
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   964
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   965
        // step 1: session security check
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   966
        NetworkSecurityCheckL();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   967
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   968
    else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   969
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   970
        CheckNetworkAccessL();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   971
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   972
    if( EAllow == NetworkAccessGrant() )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   973
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   974
        // step 2: manage the connection
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   975
        ConnectionManagement();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   976
        StartNetworkConnectionL(aNewConn);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   977
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   978
        // retest connected status since above code may have started a connection
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   979
        if ( iWindowManager.GetConnection()->Connected() )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   980
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   981
            // make leaving call first so if leaves, then do cleanup
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   982
            TRAPD( bearError,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   983
               *aBearerType = iWindowManager.GetConnection()->CurrentBearerTypeL(); );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   984
            if ( bearError )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   985
                {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   986
                // on error, close connection
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   987
                TRAP_IGNORE( iWindowManager.GetConnection()->StopConnectionL(); );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   988
                *aNewConn = EFalse; // force to false in case it was true
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   989
                }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   990
            else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   991
                {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   992
                // non leaving code only
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   993
                *aConnectionPtr = reinterpret_cast<TInt>( &iWindowManager.GetConnection()->Connection() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   994
                *aSockSvrHandle = iWindowManager.GetConnection()->SocketServer().Handle();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   995
                }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   996
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   997
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   998
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
   999
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1000
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1001
// CWidgetUiWindow::HandleRequestL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1002
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1003
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1004
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1005
TBool CWidgetUiWindow::HandleRequestL( RArray<TUint>* aTypeArray, CDesCArrayFlat* aDesArray )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1006
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1007
    TBool ret( ETrue );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1008
    TRAPD( err, DoHandleRequestL( aTypeArray, aDesArray ) );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1009
     if( KErrNone != err )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1010
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1011
        iSchemeProcessing = EFalse;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1012
        User::Leave( err );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1013
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1014
    return ret;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1015
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1016
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1017
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1018
// CWidgetUiWindow::HandleRequestL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1019
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1020
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1021
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1022
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1023
TBool CWidgetUiWindow::HandleDownloadL(RArray<TUint>* aTypeArray, CDesCArrayFlat* aDesArray)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1024
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1025
    TBool paramFound( EFalse );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1026
    TPtrC fileName = ExtractBrCtlParam(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1027
                        EParamLocalFileName,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1028
                        aTypeArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1029
                        aDesArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1030
                        paramFound );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1031
    TPtrC contentType = ExtractBrCtlParam(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1032
                            EParamReceivedContentType,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1033
                            aTypeArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1034
                            aDesArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1035
                            paramFound );
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1036
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1037
    HBufC8* contentType8 = 0;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1038
    if ( !paramFound )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1039
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1040
        contentType8 = KNullDesC8().AllocLC();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1041
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1042
    else
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1043
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1044
        contentType8 = HBufC8::NewLC( contentType.Length() );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1045
        // 16 bit buffer copied into 8 bit buffer.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1046
        contentType8->Des().Copy( contentType );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1047
        }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1048
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1049
    //Get the download Id of the transaction.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1050
    //Because, resource loader will not delete the download
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1051
    //So after handling the download, it will be cleared.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1052
    TPtrC dlId = ExtractBrCtlParam(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1053
                            EParamTransactionId,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1054
                            aTypeArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1055
                            aDesArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1056
                            paramFound );
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1057
35
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
  1058
    if ( paramFound )
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
  1059
        {
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
  1060
        TLex lex(dlId);
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
  1061
        User::LeaveIfError(lex.Val(iDlId));
1f3c3f2f5b0a Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 34
diff changeset
  1062
        }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1063
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1064
    TDataType dataType( *contentType8 );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1065
    CAiwGenericParamList* genericParamList =
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1066
        BrCtlParamList2GenericParamListL( aTypeArray, aDesArray );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1067
    CleanupStack::PushL( genericParamList );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1068
    RFile tempFile;
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1069
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1070
    iWindowManager.DocHandler().SetExitObserver(this);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1071
    iWindowManager.DocHandler().OpenTempFileL( fileName, tempFile );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1072
    CleanupClosePushL( tempFile );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1073
    iWindowManager.DocHandler().OpenFileEmbeddedL( tempFile,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1074
                                 dataType,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1075
                                 *genericParamList );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1076
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1077
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1078
    CleanupStack::PopAndDestroy( &tempFile ); // tempFile
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1079
    CleanupStack::PopAndDestroy( genericParamList ); // genericParamList
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1080
    CleanupStack::PopAndDestroy( contentType8 ); // contentType8
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1081
    return EFalse;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1082
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1083
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1084
// ---------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1085
// CWidgetUiWindow::HandleServerAppExit()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1086
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1087
// ---------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1088
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1089
void CWidgetUiWindow::HandleServerAppExit( TInt /*aReason*/ )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1090
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1091
    if(!iSchemeProcessing)
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1092
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1093
        //Clear the download.
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1094
        iEngine->HandleDownloadCommandL(iDlId, TBrCtlDefs::EDownloadCmdCancel);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1095
        iDlId = 0;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1096
        return;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1097
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1098
    iSchemeProcessing = EFalse;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1099
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1100
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1101
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1102
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1103
// CWidgetUiWindow::DoHandleRequestL
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1104
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1105
// -----------------------------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1106
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1107
TBool CWidgetUiWindow::DoHandleRequestL(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1108
    RArray<TUint>* aTypeArray, CDesCArrayFlat* aDesArray )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1109
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1110
    if( !iSchemeProcessing )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1111
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1112
        iSchemeProcessing = ETrue;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1113
        TBool paramFound( EFalse );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1114
        TPtrC requestUrl = ExtractBrCtlParam(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1115
                EParamRequestUrl,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1116
                aTypeArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1117
                aDesArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1118
                paramFound );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1119
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1120
        // pass to the CSchemaHandler
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1121
        CSchemeHandler* newSH = CSchemeHandler::NewL( requestUrl );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1122
        delete iSchemeHandler;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1123
        iSchemeHandler = newSH;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1124
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1125
        // construct the current accesspoint
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1126
        // if it's connected, always add it
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1127
        if ( iWindowManager.GetConnection() && iWindowManager.GetConnection()->Connected() )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1128
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1129
            CAiwGenericParamList* paramsList = CAiwGenericParamList::NewL();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1130
            CleanupStack::PushL(paramsList);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1131
            TInt32 ap = iWindowManager.GetConnection()->CurrentAPId();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1132
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1133
            TAiwVariant paramVariant (ap);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1134
            TAiwGenericParam genericParam( EGenericParamAccessPoint, paramVariant );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1135
            paramsList->AppendL (genericParam );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1136
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1137
            // set the parameter
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1138
            iSchemeHandler->SetParameterList( paramsList );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1139
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1140
            CleanupStack::Pop();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1141
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1142
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1143
        iSchemeHandler->Observer( this );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1144
        iSchemeHandler->HandleUrlEmbeddedL();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1145
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1146
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1147
    return ETrue;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1148
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1149
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1150
// ---------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1151
// CWidgetUiWindow::ExtractBrCtlParam()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1152
// ---------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1153
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1154
TPtrC CWidgetUiWindow::ExtractBrCtlParam
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1155
    ( TUint aParamTypeToFind,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1156
      RArray<TUint>* aTypeArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1157
      CDesCArrayFlat* aDesArray,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1158
      TBool& aParamFound ) const
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1159
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1160
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1161
    // initialize output parameter
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1162
    aParamFound = EFalse;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1163
    TPtrC16 retParamValue;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1164
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1165
    for( TInt j = 0; j < aTypeArray->Count(); j++ )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1166
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1167
        const TUint paramType = (*aTypeArray)[j];
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1168
        if ( aParamTypeToFind == paramType )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1169
            {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1170
            // That's we need
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1171
            retParamValue.Set( aDesArray->MdcaPoint(j) );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1172
            aParamFound = ETrue; // Indicate it in the out param
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1173
            break; // break the loop - we found it
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1174
            }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1175
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1176
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1177
    return retParamValue;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1178
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1179
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1180
// ---------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1181
// CWidgetUiWindow::BrCtlParamList2GenericParamListL()
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1182
// ---------------------------------------------------------
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1183
//
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1184
CAiwGenericParamList* CWidgetUiWindow::BrCtlParamList2GenericParamListL(
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1185
                           RArray<TUint>* /*aTypeArray*/,
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1186
                           CDesCArrayFlat* /*aDesArray*/ ) const
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1187
    {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1188
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1189
     //Creating generic param list
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1190
    CAiwGenericParamList* genericParamList = CAiwGenericParamList::NewLC();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1191
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1192
        // Always add the access point, if currently connected
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1193
    if( iWindowManager.GetConnection() && iWindowManager.GetConnection()->Connected() )
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1194
        {
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1195
        TInt32 ap = iWindowManager.GetConnection()->CurrentAPId();
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1196
        TAiwVariant paramVariant (ap);
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1197
        TAiwGenericParam genericParam( EGenericParamAccessPoint, paramVariant );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1198
        genericParamList->AppendL (genericParam );
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1199
        }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1200
    CleanupStack::Pop( genericParamList ); // genericParamList
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1201
    return genericParamList;
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1202
    }
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1203
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1204
// ---------------------------------------------------------
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1205
// CWidgetUiWindow::CheckUserPermissionChanged()
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1206
// ---------------------------------------------------------
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1207
//
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1208
void CWidgetUiWindow::CheckUserPermissionChanged(TBool iCurrUserPerm)
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1209
    {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1210
    if ( iUserPermission != iCurrUserPerm )
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1211
        {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1212
        iUserPermission = iCurrUserPerm;
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1213
        DetermineNetworkState();
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1214
        }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1215
    }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1216
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1217
// ---------------------------------------------------------
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1218
// CWidgetUiWindow::DetermineNetworkState()
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1219
// ---------------------------------------------------------
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1220
//
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1221
void CWidgetUiWindow::DetermineNetworkState()
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1222
    {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1223
    TNetworkState currNetState;
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1224
    RWidgetRegistryClientSession& widgetRegistry = iWindowManager.WidgetUIClientSession();
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1225
    TInt inMiniView = !(WidgetMiniViewState()==EMiniViewEnabled || WidgetMiniViewState()==EMiniViewNotEnabled);//widgetRegistry.IsWidgetInMiniView( iUid);
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1226
    CWidgetPropertyValue* propValue = widgetRegistry.GetWidgetPropertyValueL( iUid, EAllowNetworkAccess );
36
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
  1227
    TInt netAccessWdgtProp = propValue && *propValue;    // AllowNetworkAccess in the info.plist file
c711bdda59f4 Revision: 201012
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
  1228
    delete propValue;
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1229
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1230
    if ( netAccessWdgtProp && ((inMiniView && (iWindowManager.GetNetworkMode() == (TInt)EOnlineMode))
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1231
                                    || (!inMiniView && iUserPermission)) )
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1232
        {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1233
        if ( iWindowManager.GetNetworkConn() )
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1234
            {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1235
            currNetState = ENetworkAccessible;
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1236
            }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1237
        else
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1238
            {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1239
            currNetState = ENetworkAccessAllowed;
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1240
            }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1241
        }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1242
    else
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1243
        {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1244
        currNetState = ENetworkNotAllowed;
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1245
        }
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1246
10
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1247
    if ( iNetworkState != currNetState )
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1248
        {
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1249
        iNetworkState = currNetState;
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1250
        // send the new widget network state to widget engine
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1251
        iWidgetExtension->SetParamL( TBrCtlDefs::EWidgetNetworkState, (TInt)iNetworkState );
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1252
        }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1253
    }
a359256acfc6 Revision: 200929
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 5
diff changeset
  1254
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1255
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1256
// -----------------------------------------------------------------------------
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1257
// CWidgetUiWindow::MakeSoftkeysVisible()
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1258
// -----------------------------------------------------------------------------
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1259
//
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1260
void CWidgetUiWindow::MakeSoftkeysVisible(TBool aVisible, TBool aTextBoxUpdate)
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1261
    {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1262
    if (CbaGroup() && !(aTextBoxUpdate && iShowSoftkeys))
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1263
        {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1264
        CbaGroup()->MakeVisible( aVisible );
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1265
        //in case CBA keys are disbaled by javascript ,SetToolbarVisibility EFalse,
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1266
        //Since it would take entire screen.Else SetToolbarVisibility to ETrue in Landscape mode
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1267
        aVisible?iWindowManager.View()->UpdateToolbar(ETrue):iWindowManager.View()->UpdateToolbar(EFalse);
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1268
        CbaGroup()->DrawNow();
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1269
        TRect clientRect = iWindowManager.View()->ClientRect();
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1270
        // resize the container to take into account the size of the softkey labels
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1271
        // reduction is only needed for portrait mode (softkey on bottom) since landscape
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1272
        // mode softkeys don't take up screen real estate
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1273
        if (AknLayoutUtils::CbaLocation() == AknLayoutUtils::EAknCbaLocationBottom)
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1274
            {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1275
            CbaGroup()->ReduceRect(clientRect);
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1276
            }
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1277
        //Check if the container rect needs change and then call setRect
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1278
        if(clientRect != iWindowManager.View()->Container()->Rect())
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1279
           iWindowManager.View()->Container()->SetRect(clientRect);
15
60c5402cb945 Revision: 200941
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 11
diff changeset
  1280
11
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1281
        if (!aTextBoxUpdate)
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1282
            {
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1283
            // status pane always off unless in text box
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1284
            iWindowManager.View()->UpdateStatusPane(EFalse);
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1285
            }
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1286
        }
c8a366e56285 Revision: 200937
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 10
diff changeset
  1287
    }
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1288
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1289
// -----------------------------------------------------------------------------
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1290
// CWidgetUiWindow::NeedToNotifyNetworkState()
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1291
// -----------------------------------------------------------------------------
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1292
//
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1293
void CWidgetUiWindow::NeedToNotifyNetworkState(TBool aNetworkState)
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1294
    {
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1295
    iNeedToNotifyNetworkState = aNetworkState;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1296
    }
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1297
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1298
// -----------------------------------------------------------------------------
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1299
// CWidgetUiWindow::CanBeDeleted()
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1300
// -----------------------------------------------------------------------------
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1301
//
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1302
TBool CWidgetUiWindow::CanBeDeleted()
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1303
    {
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1304
    iDeleteItself = iConnecting;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1305
    return !iConnecting;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1306
    }
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1307
    
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1308
// -----------------------------------------------------------------------------
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1309
// CWidgetUiWindow::DeleteItself()
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1310
// -----------------------------------------------------------------------------
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1311
//
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1312
TInt CWidgetUiWindow::DeleteItself(TAny* aPtr)
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1313
    {
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1314
    CWidgetUiWindow* self = (CWidgetUiWindow*)aPtr;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1315
    CWidgetUiWindowManager* p = &self->iWindowManager;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1316
    delete self;
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1317
    //The Correct fix is to call AppUI::Exit()
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1318
    //But that is leaving
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1319
    if(p->WindowListCount() == 0)
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1320
        User::Exit(KErrNone);
26
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1321
    return 0;
cb62a4f66ebe Revision: 200951
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 25
diff changeset
  1322
    }
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1323
    
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1324
#ifdef BRDO_OCC_ENABLED_FF
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1325
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1326
// CWidgetUiWindow::ConnectionStageAchievedL()
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1327
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1328
//
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1329
void CWidgetUiWindow::ConnectionStageAchievedL()
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1330
    {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1331
    iWindowManager.GetConnection()->Disconnect();
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1332
    
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1333
    TNifProgressBuf buf = iConnStageNotifier->GetProgressBuffer();
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1334
    if( buf().iError == KErrDisconnected )
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1335
        {
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1336
        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1337
        SetRetryFlag(ETrue);    
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1338
    
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1339
        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelQueuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
40
8bfb9186a8b8 Revision: 201018
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 38
diff changeset
  1340
    
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1341
        if( iRetryConnectivity && iRetryConnectivity->IsActive())
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1342
            {
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1343
            iRetryConnectivity->Cancel();
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1344
            }
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1345
        iRetryConnectivity->Start(KRetryConnectivityTimeout, 0,TCallBack(RetryConnectivity,this));
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1346
        }
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1347
    }  
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1348
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1349
void CWidgetUiWindow::ConnNeededStatusL( TInt aErr )
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1350
    {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1351
    StopConnectionObserving(); //Need to stop the connection observer first
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1352
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1353
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1354
    if ( !iConnStageNotifier->IsActive() )
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1355
        {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1356
        TName* connectionName = iWindowManager.GetConnection()->ConnectionNameL();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1357
        CleanupStack::PushL( connectionName );
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1358
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1359
        iConnStageNotifier->StartNotificationL(connectionName, KLinkLayerClosed, this);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1360
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1361
        CleanupStack::PopAndDestroy();  //connectionName
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1362
        }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1363
    } 
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1364
void CWidgetUiWindow::StopConnectionObserving()
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1365
    {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1366
    
40
8bfb9186a8b8 Revision: 201018
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 38
diff changeset
  1367
    if ( iConnStageNotifier )
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1368
        {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1369
        iConnStageNotifier->Cancel();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1370
        }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1371
    } 
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1372
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1373
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1374
// CWidgetUiWindow::SetRetryFlag
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1375
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1376
//
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1377
void CWidgetUiWindow::SetRetryFlag(TBool flag)
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1378
     {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1379
     reConnectivityFlag = flag;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1380
     }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1381
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1382
// CWidgetUiWindow::RetryConnectivity
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1383
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1384
//
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1385
TInt CWidgetUiWindow::RetryConnectivity(TAny* aWidgetUiWindow)
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1386
    {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1387
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1388
    TInt err = ((CWidgetUiWindow*)aWidgetUiWindow)->RetryInternetConnection();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1389
    return err;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1390
    }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1391
TInt CWidgetUiWindow::RetryInternetConnection()
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1392
    {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1393
    //First cancel the timer
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1394
    if ( iRetryConnectivity && iRetryConnectivity->IsActive() )
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1395
    {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1396
        iRetryConnectivity->Cancel();
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1397
    }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1398
    TInt err = KErrNone;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1399
    if ( !iWindowManager.GetConnection()->Connected() )
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1400
       {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1401
       TRAP_IGNORE( err = iWindowManager.GetConnection()->StartConnectionL( ETrue ) );
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1402
       }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1403
    if( err == KErrNone )
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1404
       { 
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1405
   
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1406
       TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1407
       SetRetryFlag(EFalse);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1408
       
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1409
       TRAP_IGNORE(ConnNeededStatusL(err)); //Start the observer again
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1410
       TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandRetryTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1411
       }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1412
    else
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1413
        {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1414
        TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandUnSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) );
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1415
        SetRetryFlag(EFalse);
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1416
        TRAP_IGNORE(Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandClearQuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) );
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1417
        }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1418
    
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1419
    return err;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1420
    }
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1421
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1422
// CWidgetUiWindow::GetRetryFlag
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1423
// -----------------------------------------------------------------------------
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1424
//
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1425
 TBool CWidgetUiWindow::GetRetryFlag()
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1426
      {
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1427
      return reConnectivityFlag;
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1428
      } 
41
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1429
 
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1430
 void CWidgetUiWindow::CancelAllDialogs()
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1431
     {
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1432
     if( iDialogsProvider)
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1433
         {
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1434
          iDialogsProvider->CancelAll();
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1435
         }
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1436
     }
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1437
 
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1438
 TBool CWidgetUiWindow::IsDialogsLaunched()
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1439
     {
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1440
     return (iDialogsProvider && iDialogsProvider->IsDialogLaunched() );
4bd5176e1bc8 Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 40
diff changeset
  1441
     }
38
4917f9bf7995 Revision: 201016
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 36
diff changeset
  1442
#endif 
0
dd21522fd290 Revision: 200911
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff changeset
  1443
// End of file