omadrm/drmplugins/drmrohandler/src/rohandlerdmgrwrapper.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:21:16 +0100
branchRCL_3
changeset 72 1481bf457703
parent 71 1221b68b8a5f
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
     2
* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies).
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  rohandler wrapper for Download manager
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 *
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#include <es_enum_partner.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#endif
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <centralrepository.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <cdblen.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    24
#ifdef __SERIES60_NATIVE_BROWSER
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    25
#include <browseruisdkcrkeys.h>
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    26
#endif
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    27
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <cmconnectionmethod.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include <cmdestination.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include <cmconnectionmethoddef.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include <cmmanager.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#ifdef RD_MULTIPLE_DRIVE
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include <driveinfo.h>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
#endif
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
#include <data_caging_path_literals.hrh>
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    39
#include <downloadmgrclient.h>
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    40
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include <es_enum.h> // tconnectioninfo
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
#include <es_sock.h> // rconnection rsocket
18
8a03a285ab14 Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    43
#include <RoapEng.h>
8a03a285ab14 Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    44
#include <RoapDef.h>
8a03a285ab14 Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    45
#include <RoapObserver.h>
8a03a285ab14 Revision: 201009
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 0
diff changeset
    46
#include "RoapSyncWrapper.h"
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
#include "rohandlerdmgrwrapper.h"
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
#ifdef _DEBUG
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
#define DRMDEBUG( a ) RDebug::Print( a )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
#define DRMDEBUG2( a, b ) RDebug::Print( a, b )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
#define DRMDEBUG3( a, b, c ) RDebug::Print( a, b, c )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
#define DRMDEBUGMETHOD( a ) RDebug::Print( \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
    RoHdlrDMgrWrDebugLiterals::KMethodFormat(), &( a ) )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
// #define DRMDEBUGMETHODSTART( a ) RDebug::Print( \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
// RoHdlrDMgrWrDebugLiterals::KMethodStartFormat(), &( a ) )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
// #define DRMDEBUGMETHODFINISH( a ) RDebug::Print( \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
// RoHdlrDMgrWrDebugLiterals::KMethodFinishFormat(), &( a ) )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
// #define LOG( a ) RFileLogger::Write( \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
// KRoLogDir(), KRoLogFile(), EFileLoggingModeAppend, a );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
// #define LOGHEX( ptr, len ) RFileLogger::HexDump( \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
//  KRoLogDir(), KRoLogFile(), EFileLoggingModeAppend, \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
//  _S( "" ), _S( "" ), ptr, len );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
// #define LOG2( a, b ) RFileLogger::WriteFormat( \
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
// KRoLogDir(), KRoLogFile(), EFileLoggingModeAppend, a, b );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
namespace RoHdlrDMgrWrDebugLiterals
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
    // Uncomment following literals if using macros LOG, LOG2 or LOGHEX anywhere
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    //    _LIT( KRoLogDir, "DRM" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    //    _LIT( KRoLogFile, "RoHdlDmgrWrapper.log" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
    // method Formatters ( used in macros DRMDEBUGMETHOD )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    _LIT( KMethodFormat, "CRoHandlerDMgrWrapper::%S" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
    // method Formatters ( used in macro DRMDEBUGMETHODSTART )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
    //    _LIT( KMethodStartFormat, "CRoHandlerDMgrWrapper::%S -->" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
    // method Formatters ( used in macro DRMDEBUGMETHODFINISH )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
    //    _LIT( KMethodFinishFormat, "--> CRoHandlerDMgrWrapper::%S" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
    _LIT( KFormatMembValInt, "%S = %d" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
    //Constructors, destructor
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
    _LIT( KMethDestructor, "~CRoHandlerDMgrWrapper" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
    //Methods
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
    _LIT( KMethConstructL, "ConstructL" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    _LIT( KMethNewL, "NewL" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    _LIT( KMethNewLC, "NewLC" );
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    96
    _LIT( KMethDownloadAndHandleRoapTriggerL, "DownloadAndHandleRoapTriggerL" );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    97
    _LIT( KMethDownloadAndHandleRoapTriggerFromPrUrlL,
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
    98
        "DownloadAndHandleRoapTriggerFromPrUrlL" );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
    _LIT( KMethDoDownloadAndHandleRoapTriggerL,
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
        "DoDownloadAndHandleRoapTriggerL" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
    _LIT( KFormatDoDlHdlRoapTrigL, "DoDownloadAndHandleRoapTriggerL: %S" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    _LIT( KStrDlCreated, "download created" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
    _LIT( KStrDlFinished, "download finished" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
    _LIT( KMethSetDefaultAccessPointL, "SetDefaultAccessPointL" );
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   106
    _LIT( KMiIapId, "iIapId" );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
    _LIT( KMethHandleDMgrEventL, "HandleDMgrEventL" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
    _LIT( KFormatMethHandleDMgrEventL, "HandleDMgrEventL %S" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
    _LIT( KStrEHttpDlCreated, "EHttpDlCreated" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
    _LIT( KStrEHttpContentTypeReceived, "EHttpContentTypeReceived" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
    _LIT( KStrEHttpProgDisconnected, "EHttpProgDisconnected" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
    _LIT( KStrEHttpDlInprogress, "EHttpDlInprogress" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
    _LIT( KStrEHttpDlCompleted, "EHttpDlCompleted" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
    _LIT( KStrEHttpDlFailed, "EHttpDlFailed" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
    _LIT( KStrEConnectionFailed, "EConnectionFailed" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
    _LIT( KFormatEDlAttrErrorId, "EDlAttrErrorId = %d" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   119
    _LIT( KMiDownLoadState, "iDownLoadState" );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   120
    _LIT( KMiProgressState, "iProgressState" );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
#else
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
#define DRMDEBUG( a )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
#define DRMDEBUG2( a, b )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
#define DRMDEBUG3( a, b, c )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
#define DRMDEBUGMETHOD( a )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
//#define DRMDEBUGMETHODSTART( a )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
//#define DRMDEBUGMETHODFINISH( a )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
//#define LOG( a )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
//#define LOGHEX( ptr, len )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
//#define LOG2( a, b )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
#endif
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   138
#ifndef __SERIES60_NATIVE_BROWSER
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   139
const TUid KCRUidBrowser =
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   140
    {0x10008D39};
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   141
const TUint32 KBrowserDefaultAccessPoint = 0x0000000E;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   142
const TUint32 KBrowserAccessPointSelectionMode = 0x0000001E;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   143
const TUint32 KBrowserNGDefaultSnapId = 0x00000053;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   144
#endif
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   145
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
// CONSTANTS
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
#ifndef RD_MULTIPLE_DRIVE
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
_LIT( KHelperTriggerFilePath, "d:\\" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
#endif
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   151
// ============================== LOCAL FUNCTIONS ==============================
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   152
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   153
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   154
// DoResetAndDestroy
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   155
// Does RPointerArray< typename >->ResetAndDestroy() for the given array aPtr.
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   156
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   157
//
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   158
template< typename elemType >
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   159
LOCAL_C void DoResetAndDestroy( TAny* aPtr )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   160
    {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   161
    ( reinterpret_cast< RPointerArray< elemType >* >( aPtr ) )->
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   162
        ResetAndDestroy();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   163
    }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   164
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   165
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   166
// DeleteHttpDowload
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   167
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   168
//
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   169
LOCAL_C void DeleteHttpDowload( TAny* aDownload )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   170
    {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   171
    reinterpret_cast< RHttpDownload* >( aDownload )->Delete();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   172
    }
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
// UpdateBufferL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
template< typename bufType, typename descType >
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
LOCAL_C void UpdateBufferL( bufType*& aTargetBuf, const descType& aSourceBuf )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
    if ( aTargetBuf )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
        delete aTargetBuf;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
        aTargetBuf = NULL;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
    if ( aSourceBuf.Length() )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
        aTargetBuf = aSourceBuf.AllocL();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   192
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   193
// IapIdOfDefaultSnapL
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   194
// for trapping purposes only
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   195
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   196
//
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   197
LOCAL_C TUint32 IapIdOfDefaultSnapL(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   198
    RCmManager& aCmManager,
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   199
    const TUint32 aDefaultSnap )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   200
    {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   201
    RCmDestination dest( aCmManager.DestinationL( aDefaultSnap ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   202
    CleanupClosePushL( dest );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   203
    TUint32 iapIdOfDest( 0 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   204
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   205
    if ( dest.ConnectionMethodCount() <= 0 )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   206
        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   207
        User::Leave( KErrNotFound );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   208
        }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   209
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   210
    RCmConnectionMethod cMeth( dest.ConnectionMethodL( 0 ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   211
    CleanupClosePushL( cMeth );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   212
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   213
    iapIdOfDest = cMeth.GetIntAttributeL( CMManager::ECmIapId );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   214
    CleanupStack::PopAndDestroy( &cMeth );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   215
    CleanupStack::PopAndDestroy( &dest );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   216
    return iapIdOfDest;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   217
    }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   218
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   219
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
// ============================= MEMBER FUNCTIONS ==============================
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
// CRoHandlerDMgrWrapper::CRoHandlerDMgrWrapper
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
CRoHandlerDMgrWrapper::CRoHandlerDMgrWrapper() :
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
    CActive( CActive::EPriorityStandard ),
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
    iIapId( 0 ), iState( EInit )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
    CActiveScheduler::Add( this );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
// CRoHandlerDMgrWrapper::ConstructL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
void CRoHandlerDMgrWrapper::ConstructL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethConstructL() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
    // Get UID from process
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
    const TInt KRoHandlerDMgrWrapperUid = 0x101F7B92;
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   242
    iDlMgr.ConnectL( TUid::Uid( KRoHandlerDMgrWrapperUid ), *this, EFalse );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
    User::LeaveIfError( iFs.Connect() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
    User::LeaveIfError( iFs.ShareProtected() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
// CRoHandlerDMgrWrapper::NewL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
CRoHandlerDMgrWrapper* CRoHandlerDMgrWrapper::NewL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethNewL() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
    CRoHandlerDMgrWrapper* self( CRoHandlerDMgrWrapper::NewLC() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
    CleanupStack::Pop( self );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
    return self;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
// CRoHandlerDMgrWrapper::NewLC
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
CRoHandlerDMgrWrapper* CRoHandlerDMgrWrapper::NewLC()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethNewLC() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
    CRoHandlerDMgrWrapper* self( new ( ELeave ) CRoHandlerDMgrWrapper() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
    CleanupStack::PushL( self );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
    self->ConstructL();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
    return self;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
// CRoHandlerDMgrWrapper::~CRoHandlerDMgrWrapper
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
CRoHandlerDMgrWrapper::~CRoHandlerDMgrWrapper()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
    Cancel();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethDestructor() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
    delete iTriggerUrl;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
    delete iTriggerBuf;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
    delete iFileName;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
    delete iRoapEng;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   287
#ifdef _DEBUG
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   288
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   289
    if ( iDlMgr.Handle() )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   290
        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   291
        iDlMgr.Close();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   292
        }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   293
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   294
#else
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   295
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   296
    iDlMgr.Close();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   297
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   298
#endif
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   299
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
    iFs.Close();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
// ---------------------------------------------------------------------------
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   304
// CRoHandlerDMgrWrapper::DownloadAndHandleRoapTriggerL
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
void CRoHandlerDMgrWrapper::HandleRoapTriggerL( const TDesC8& aTrigger )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
    if ( iState != EInit || iWait.IsStarted() )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
        User::Leave( KErrNotReady );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
    UpdateBufferL< HBufC8, TDesC8 >( iTriggerBuf, aTrigger );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
    Continue( EMeteringReportSubmit, KErrNone );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
    iWait.Start();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
// ---------------------------------------------------------------------------
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   320
// CRoHandlerDMgrWrapper::DownloadAndHandleRoapTriggerL
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   321
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   322
//
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   323
void CRoHandlerDMgrWrapper::DownloadAndHandleRoapTriggerL( const HBufC8* aUrl )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   324
    {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   325
    DRMDEBUGMETHOD(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   326
        RoHdlrDMgrWrDebugLiterals::KMethDownloadAndHandleRoapTriggerL() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   327
    if ( iState != EInit || iWait.IsStarted() )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   328
        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   329
        User::Leave( KErrNotReady );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   330
        }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   331
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   332
    UpdateBufferL< HBufC8, TDesC8 >( iTriggerUrl, *aUrl );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   333
    Continue( EGetMeteringTrigger, KErrNone );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   334
    iWait.Start();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   335
    }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   336
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   337
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   338
// CRoHandlerDMgrWrapper::DownloadAndHandleRoapTriggerFromPrUrlL
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   339
// ---------------------------------------------------------------------------
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   340
//
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   341
void CRoHandlerDMgrWrapper::DownloadAndHandleRoapTriggerFromPrUrlL(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   342
        const HBufC8* aUrl )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   343
    {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   344
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethDownloadAndHandleRoapTriggerFromPrUrlL() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   345
    if ( iState != EInit || iWait.IsStarted() )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   346
        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   347
        User::Leave( KErrNotReady );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   348
        }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   349
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   350
    UpdateBufferL< HBufC8, TDesC8 >( iTriggerUrl, *aUrl );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   351
    Continue( EGetPrUrlTrigger, KErrNone );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   352
    iWait.Start();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   353
    }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   354
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   355
// ---------------------------------------------------------------------------
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
// CRoHandlerDMgrWrapper::DoDownloadRoapTriggerL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
void CRoHandlerDMgrWrapper::DoDownloadRoapTriggerL( TMeterState aNextState )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
    RFile roapTrigger;
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   362
    TBool result( EFalse );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   363
    TFileName triggerFileName;
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethDoDownloadAndHandleRoapTriggerL() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
    // If no Trigger URL then nothing to download. So finish transaction
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
    if ( !iTriggerUrl || iTriggerUrl->Length() <= 0 )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
        Continue( EComplete, KErrNone );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
        return;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
#ifndef RD_MULTIPLE_DRIVE
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
    User::LeaveIfError( roapTrigger.Temp(
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   376
            iFs, KHelperTriggerFilePath, triggerFileName, EFileWrite ) );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
#else //RD_MULTIPLE_DRIVE
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
    _LIT( KDrive, "%c:\\" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
    TInt driveNumber( -1 );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
    TChar driveLetter;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
    DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRam, driveNumber );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
    iFs.DriveToChar( driveNumber, driveLetter );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   385
    TFileName helperTriggerFilePath;
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   387
    helperTriggerFilePath.Format( KDrive, ( TUint )driveLetter );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   388
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   389
    User::LeaveIfError( roapTrigger.Temp( iFs, helperTriggerFilePath,
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   390
            triggerFileName, EFileWrite ) );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
#endif
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   393
    UpdateBufferL< HBufC, TFileName >( iFileName, triggerFileName );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   395
    // create and start download
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   396
    RHttpDownload& download = iDlMgr.CreateDownloadL( *iTriggerUrl, result );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   397
    // Put download for proper cleanup.
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   398
    TCleanupItem item( DeleteHttpDowload, &download );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   399
    CleanupStack::PushL( item );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   400
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
    CleanupClosePushL( roapTrigger );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   403
    if ( result )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   404
        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   405
        DRMDEBUG2(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   406
            RoHdlrDMgrWrDebugLiterals::KFormatDoDlHdlRoapTrigL(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   407
            &RoHdlrDMgrWrDebugLiterals::KStrDlCreated() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   408
        iDownloadSuccess = EFalse;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   409
        iConnectionError = EFalse;
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   411
        SetDefaultAccessPointL();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   412
        User::LeaveIfError( download.SetFileHandleAttribute( roapTrigger ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   413
        User::LeaveIfError( download.SetBoolAttribute(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   414
                EDlAttrNoContentTypeCheck, ETrue ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   415
        User::LeaveIfError( download.Start() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   416
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   417
        // wait until download is finished
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   418
        iState = aNextState;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   419
        TRequestStatus* status( &iStatus );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   420
        *status = KRequestPending;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   421
        SetActive();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   422
        }
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
    CleanupStack::PopAndDestroy( &roapTrigger );
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   424
    CleanupStack::Pop( &download ); // Left open for DoSaveRoapTrigger
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
// CRoHandlerDMgrWrapper::DoSaveRoapTriggerL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
void CRoHandlerDMgrWrapper::DoSaveRoapTriggerL( TMeterState aNextState )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
    // Check success of download
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
    DRMDEBUG2(
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
        RoHdlrDMgrWrDebugLiterals::KFormatDoDlHdlRoapTrigL(),
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
        &RoHdlrDMgrWrDebugLiterals::KStrDlFinished() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   437
    // Fetch download created in DoDownloadRoapTriggerL
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   438
    RHttpDownload* download = iDlMgr.FindDownload( *iTriggerUrl, KNullDesC8() );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
    // Delete trigger URL so that it is possible to check
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
    // whether or not meteringResponse has PrUrl.
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
    delete iTriggerUrl;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
    iTriggerUrl = NULL;
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   443
    // Put download for proper cleanup.
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   444
    TCleanupItem item( DeleteHttpDowload, download );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   445
    CleanupStack::PushL( item );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
    RFile roapTrigger;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
    if ( !iDownloadSuccess )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
            if ( iConnectionError )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
                {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
                User::Leave( KErrCouldNotConnect );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
                }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
            else
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
                {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
                User::Leave( KErrGeneral );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
                }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
    User::LeaveIfError( roapTrigger.Open( iFs, *iFileName, EFileShareReadersOrWriters ) );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
    CleanupClosePushL( roapTrigger );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
    // Get filehandle of ROAP trigger
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
    const TInt KReadBufSize = 512;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
    RBuf8 readBuf;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
    readBuf.CleanupClosePushL();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
    readBuf.CreateL( KReadBufSize );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
    // Read file to buffer
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
    TInt triggerFileSize( 0 );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
    User::LeaveIfError( roapTrigger.Size( triggerFileSize ) );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
    if ( iTriggerBuf )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
        delete iTriggerBuf;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
        iTriggerBuf = NULL;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
    iTriggerBuf = HBufC8::NewL( triggerFileSize );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
    User::LeaveIfError( roapTrigger.Read( readBuf, KReadBufSize ) );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
    iTriggerBuf->Des().Copy( readBuf );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
    while ( readBuf.Length() == KReadBufSize )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
        User::LeaveIfError( roapTrigger.Read( readBuf, KReadBufSize ) );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
        iTriggerBuf->Des().Append( readBuf );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
    // And let ROAP handle it...
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
    CleanupStack::PopAndDestroy( &readBuf );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
    CleanupStack::PopAndDestroy( &roapTrigger );
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   488
    CleanupStack::PopAndDestroy( download );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   489
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
    iFs.Delete( *iFileName );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
    delete iFileName;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
    iFileName=NULL;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
    Continue( aNextState, KErrNone );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
// CRoHandlerDMgrWrapper::DoHandleRoapTriggerL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
void CRoHandlerDMgrWrapper::DoHandleRoapTriggerL( TMeterState aNextState )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
    Roap::TTriggerType triggerType;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
    Roap::TRiContextStatus contextStatus;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
    Roap::TDomainOperation domainOperation;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
    RPointerArray< HBufC8 > contentIds;
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   507
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   508
    TCleanupItem cleanup( DoResetAndDestroy< HBufC8 >, &contentIds );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   509
    CleanupStack::PushL( cleanup );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
    iRoapEng = Roap::CRoapEng::NewL();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
    iRoapEng->SetTriggerL( *iTriggerBuf, NULL, triggerType, contextStatus,
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
        domainOperation, contentIds );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
    CleanupStack::PopAndDestroy( &contentIds );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
    // if we have a valid RI context,
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
    // or if there is no user confirmation needed, do the ROAP
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
    if ( contextStatus != Roap::EInvalidContext )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
        iRoapEng->AcceptL( this, &iStatus );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
        iState = aNextState;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
        SetActive();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
    else
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
        Continue( EComplete, KErrCancel );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
// CRoHandlerDMgrWrapper::SetDefaultAccessPointL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
void CRoHandlerDMgrWrapper::SetDefaultAccessPointL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
    {
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   538
    const TInt KDestinationSelectionMode( 2 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   539
    CRepository* repository( NULL );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   540
    TInt ap( 0 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   541
    TInt alwaysAsk( 0 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   542
    TUint32 iapd32( 0 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   543
    TInt defaultSnap( 0 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   544
    TInt err( KErrNone );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   545
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethSetDefaultAccessPointL() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   548
    if ( !iIapId )
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
        {
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   550
        repository = CRepository::NewL( KCRUidBrowser );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   551
        CleanupStack::PushL( repository );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   552
        repository->Get( KBrowserDefaultAccessPoint, ap );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   553
        repository->Get( KBrowserAccessPointSelectionMode, alwaysAsk );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   554
        repository->Get( KBrowserNGDefaultSnapId, defaultSnap );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   555
        if ( ap <= KErrNotFound && defaultSnap <= KErrNotFound )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   556
            {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   557
            alwaysAsk = ETrue;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   558
            }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   559
        else
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   560
            {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   561
            RCmManager cmManager;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   562
            cmManager.OpenLC();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   563
            if ( !alwaysAsk )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   564
                {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   565
                TRAP( err, iapd32 = cmManager.GetConnectionMethodInfoIntL(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   566
                        ap, CMManager::ECmIapId ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   567
                }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   568
            else if ( alwaysAsk == KDestinationSelectionMode )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   569
                {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   570
                TRAP( err, iapd32 = IapIdOfDefaultSnapL(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   571
                        cmManager, defaultSnap ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   572
                }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   573
            CleanupStack::PopAndDestroy( &cmManager );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   574
            }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   575
        if ( !err && ( !alwaysAsk || alwaysAsk == KDestinationSelectionMode ) )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   576
            {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   577
            iIapId = iapd32;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   578
            DRMDEBUG3( RoHdlrDMgrWrDebugLiterals::KFormatMembValInt(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   579
                &RoHdlrDMgrWrDebugLiterals::KMiIapId(), iIapId );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   580
            err = iDlMgr.SetIntAttribute( EDlMgrIap, iapd32 );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   581
            }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   582
        CleanupStack::PopAndDestroy( repository );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   583
        }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   584
    else
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   585
        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   586
        err = iDlMgr.SetIntAttribute( EDlMgrIap, iIapId );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
// CRoHandlerDMgrWrapper::Continue
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
void CRoHandlerDMgrWrapper::Continue(
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
    CRoHandlerDMgrWrapper::TMeterState aNextState, TInt aError )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
    iState = aNextState;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
    TRequestStatus* ownStatus = &iStatus;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
    *ownStatus = KRequestPending;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
    SetActive();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
    User::RequestComplete( ownStatus, aError );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
// MHttpDownloadMgrObserver methods
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
// CRoHandlerDMgrWrapper::HandleDMgrEventL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
//
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   611
void CRoHandlerDMgrWrapper::HandleDMgrEventL( RHttpDownload& aDownload,
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   612
        THttpDownloadEvent aEvent )
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
    {
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   614
    _LIT8( KDRMHelperMimeTypeROAPTrigger, "application/vnd.oma.drm.roap-trigger+xml" );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
    DRMDEBUGMETHOD( RoHdlrDMgrWrDebugLiterals::KMethHandleDMgrEventL() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
    DRMDEBUG3( RoHdlrDMgrWrDebugLiterals::KFormatMembValInt(),
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   618
            &RoHdlrDMgrWrDebugLiterals::KMiDownLoadState(), aEvent.iDownloadState );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   619
    DRMDEBUG3( RoHdlrDMgrWrDebugLiterals::KFormatMembValInt(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   620
            &RoHdlrDMgrWrDebugLiterals::KMiProgressState(), aEvent.iProgressState );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   621
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   622
    if ( aEvent.iProgressState == EHttpContentTypeReceived )
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
        DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
                &RoHdlrDMgrWrDebugLiterals::KStrEHttpContentTypeReceived() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
        // check received mimetype
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   627
        RBuf8 contentType;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   628
        contentType.CleanupClosePushL();
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   629
        contentType.CreateL( KMaxContentTypeLength );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   630
        User::LeaveIfError( aDownload.GetStringAttribute( EDlAttrContentType,
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   631
                contentType ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   632
        if ( !contentType.FindF( KDRMHelperMimeTypeROAPTrigger ) )
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
            // ROAP trigger found, continue download
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   635
            User::LeaveIfError( aDownload.Start() );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
        else
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
            // wrong MIME type?, stop download
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
            iDownloadSuccess = EFalse;
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   641
            User::LeaveIfError( aDownload.Delete() );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
        CleanupStack::PopAndDestroy( &contentType );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   646
    if ( aEvent.iDownloadState == EHttpDlCreated )
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
        DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
                &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlCreated() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
    else
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   652
        if ( aEvent.iProgressState == EHttpProgDisconnected )
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
            DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
                    &RoHdlrDMgrWrDebugLiterals::KStrEHttpProgDisconnected() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
            // store failure
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
            iDownloadSuccess = EFalse;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
            iConnectionError = ETrue;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
            // finished
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
            TRequestStatus* status( &iStatus );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
            User::RequestComplete( status, KErrCancel );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
            }
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   663
        else
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   664
            if ( aEvent.iDownloadState == EHttpDlInprogress )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   665
                {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   666
                DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   667
                        &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlInprogress() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   668
                }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   669
            else
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   670
                if ( aEvent.iDownloadState == EHttpDlCompleted )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   671
                    {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   672
                    // store success
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   673
                    DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   674
                            &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlCompleted() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   675
                    iDownloadSuccess = ETrue;
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   677
                    // finished
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   678
                    TRequestStatus* status( &iStatus );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   679
                    User::RequestComplete( status, KErrNone );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   680
                    }
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   681
                else
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   682
                    if ( aEvent.iDownloadState == EHttpDlFailed )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   683
                        {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   684
                        TInt32 err;
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   686
                        DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   687
                                &RoHdlrDMgrWrDebugLiterals::KStrEHttpDlFailed() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   688
                        // store failure
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   689
                        iDownloadSuccess = EFalse;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   690
                        User::LeaveIfError( aDownload.GetIntAttribute(
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   691
                                EDlAttrErrorId, err ) );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   692
                        DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatEDlAttrErrorId(), err );
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   694
                        if ( err == EConnectionFailed || err
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   695
                                == ETransactionFailed )
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   696
                            {
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   697
                            DRMDEBUG2( RoHdlrDMgrWrDebugLiterals::KFormatMethHandleDMgrEventL(),
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   698
                                    &RoHdlrDMgrWrDebugLiterals::KStrEConnectionFailed() );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   699
                            iConnectionError = ETrue;
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   700
                            }
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
72
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   702
                        // finished
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   703
                        TRequestStatus* status( &iStatus );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   704
                        User::RequestComplete( status, KErrCancel );
1481bf457703 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 71
diff changeset
   705
                        }
0
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
// RoapObserver methods
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
// CRoHandlerDMgrWrapper::PostResponseUrlL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   714
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
void CRoHandlerDMgrWrapper::PostResponseUrlL( const TDesC8& aPostResponseUrl )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   716
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
    UpdateBufferL< HBufC8, TDesC8 >( iTriggerUrl, aPostResponseUrl );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
    if ( !iIapId )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
        // Take AP from open conenction
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
        RSocketServ socketServer;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
        TInt err( KErrNone );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
        err = socketServer.Connect();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
        RConnection myConnection;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
        err = myConnection.Open( socketServer );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
        TUint connectionCount( 0 );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
        err = myConnection.EnumerateConnections( connectionCount );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
        if ( err != KErrNone || connectionCount < 1 )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
            return;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
        TPckgBuf<TConnectionInfoV2> connectionInfo;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
        err = myConnection.GetConnectionInfo( connectionCount,
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
                connectionInfo );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
        iIapId = connectionInfo().iIapId;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
        myConnection.Close();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
        socketServer.Close();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   751
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
// Trivial RoapObserver methods
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
TBool CRoHandlerDMgrWrapper::ConnectionConfL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   756
    return ETrue;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
TBool CRoHandlerDMgrWrapper::ContactRiConfL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
    return ETrue;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
TBool CRoHandlerDMgrWrapper::TransIdConfL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
    return EFalse;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
void CRoHandlerDMgrWrapper::RightsObjectDetailsL(
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
        const RPointerArray<CDRMRights>& /*aRightsList*/ )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
    // do nothing
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
void CRoHandlerDMgrWrapper::ContentDownloadInfoL( TPath& /*aTempFolder*/,
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   776
        TFileName& /*aContentName*/, TInt& aMaxSize )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
    aMaxSize = -1;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
void CRoHandlerDMgrWrapper::ContentDetailsL( const TDesC& /*aPath*/,
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
        const TDesC8& /*aType*/, const TUid& /*aAppUid*/ )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
void CRoHandlerDMgrWrapper::RoapProgressInfoL( const TInt /*aProgressInfo*/ )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
    // do nothing
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
void CRoHandlerDMgrWrapper::ErrorUrlL( const TDesC8& /*aErrorUrl*/ )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
    // do nothing
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
// CActive methods
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
// CRoHandlerDMgrWrapper::DoCancel
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
void CRoHandlerDMgrWrapper::DoCancel()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
    delete iRoapEng;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
    iRoapEng = NULL;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
    if ( iWait.IsStarted() )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
        iWait.AsyncStop();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
// CRoHandlerDMgrWrapper::RunL
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
void CRoHandlerDMgrWrapper::RunL()
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
    User::LeaveIfError( iStatus.Int() );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
    switch ( iState )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   822
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
        //case EInit:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
        case EGetMeteringTrigger:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
            DoDownloadRoapTriggerL( ESaveMeteringTrigger );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
        case ESaveMeteringTrigger:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
            DoSaveRoapTriggerL( EMeteringReportSubmit );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
        case EMeteringReportSubmit:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
            DoHandleRoapTriggerL( EGetPrUrlTrigger );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
        case EGetPrUrlTrigger:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   842
            delete iRoapEng;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
            iRoapEng = NULL;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
            DoDownloadRoapTriggerL( ESavePrUrlTrigger );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
        case ESavePrUrlTrigger:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
            DoSaveRoapTriggerL( EPrRoapRequest );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
        case EPrRoapRequest:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
            DoHandleRoapTriggerL( EComplete );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   856
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
        case EComplete:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
            {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
            delete iRoapEng;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
            iRoapEng = NULL;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   861
            iWait.AsyncStop();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
            }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   863
            break;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   864
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   865
        default:
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
            User::Leave( KErrNotSupported );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
    }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
// CRoHandlerDMgrWrapper::RunError
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
// ---------------------------------------------------------------------------
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
//
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
TInt CRoHandlerDMgrWrapper::RunError( TInt /* aError */ )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
    {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
    //_LIT( KCatchedError, "Catched error" );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
    //User::Panic( KCatchedError, aError );
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
    if ( iWait.IsStarted() )
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
        {
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
        iWait.AsyncStop();
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
        }
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
    return KErrNone;
95b198f216e5 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
    }