wmdrm/camese/cameseutility/src/CameseUtility.cpp
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of the Camese Utility class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include <es_enum.h>
       
    21 #include <cameseutility.h>
       
    22 #include <e32def.h>
       
    23 
       
    24 #include "cameselog.h"
       
    25 
       
    26 // ----------------------------------------------------------------------------
       
    27 // CCameseUtility::NewL
       
    28 // Two-phased constructor.
       
    29 // ----------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C CCameseUtility* CCameseUtility::NewL(
       
    32     MCameseObserver* aObserver /* = NULL */ )
       
    33     {
       
    34     CAMESE_LOG( "+CCameseUtility::NewL" );
       
    35 
       
    36     CCameseUtility* self = new (ELeave) CCameseUtility();
       
    37     CleanupStack::PushL( self );
       
    38     self->ConstructL( 0, aObserver );
       
    39     CleanupStack::Pop( self );
       
    40 
       
    41     CAMESE_LOG( "-CCameseUtility::NewL" );
       
    42     return self;
       
    43     }
       
    44 
       
    45 // ----------------------------------------------------------------------------
       
    46 // CCameseUtility::NewL
       
    47 // Two-phased constructor.
       
    48 // ----------------------------------------------------------------------------
       
    49 //
       
    50 EXPORT_C CCameseUtility* CCameseUtility::NewL(
       
    51     TInt aIapNumber,
       
    52     MCameseObserver* aObserver /* = NULL */ )
       
    53     {
       
    54     CAMESE_LOG( "+CCameseUtility::NewL" );
       
    55 
       
    56     CCameseUtility* self = new (ELeave) CCameseUtility();
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL( aIapNumber, aObserver );
       
    59     CleanupStack::Pop( self );
       
    60 
       
    61     CAMESE_LOG( "-CCameseUtility::NewL" );
       
    62     return self;
       
    63     }
       
    64 // ----------------------------------------------------------------------------
       
    65 // CCameseUtility::NewL
       
    66 // Two-phased constructor.
       
    67 // ----------------------------------------------------------------------------
       
    68 //
       
    69 EXPORT_C CCameseUtility* CCameseUtility::NewL(
       
    70     TInt /*aSockServHandle*/,
       
    71     RConnection* aConnPtr,
       
    72     MCameseObserver* aObserver /* = NULL */ )
       
    73     {
       
    74     CAMESE_LOG( "+CCameseUtility::NewL" );
       
    75 
       
    76     CCameseUtility* self = new (ELeave) CCameseUtility();
       
    77     CleanupStack::PushL( self );
       
    78 
       
    79     TInt connectionIapId( 0 );
       
    80      
       
    81     if ( aConnPtr )
       
    82         {
       
    83         TConnectionInfo connectionInfo;
       
    84         TUint count( 0 );
       
    85         User::LeaveIfError( aConnPtr->EnumerateConnections( count ) );
       
    86 
       
    87         if ( !count )
       
    88             {
       
    89             User::Leave( KErrNotReady );
       
    90             }
       
    91       
       
    92         TPckg<TConnectionInfo> pkg( connectionInfo );
       
    93         User::LeaveIfError( aConnPtr->GetConnectionInfo( 1, pkg ) );
       
    94         
       
    95         connectionIapId = connectionInfo.iIapId;
       
    96         }
       
    97         
       
    98     self->ConstructL( connectionIapId, aObserver );
       
    99     CleanupStack::Pop( self );
       
   100 
       
   101     CAMESE_LOG( "-CCameseUtility::NewL" );
       
   102     return self;
       
   103     }
       
   104 
       
   105 // ----------------------------------------------------------------------------
       
   106 // CCameseUtility::~CCameseUtility
       
   107 // ----------------------------------------------------------------------------
       
   108 //
       
   109 EXPORT_C CCameseUtility::~CCameseUtility()
       
   110     {
       
   111     CAMESE_LOG( "+CCameseUtility::~CCameseUtility" );
       
   112 
       
   113     CAMESE_LOG( "-CCameseUtility::~CCameseUtility" );
       
   114     }
       
   115 
       
   116 // ----------------------------------------------------------------------------
       
   117 // CCameseUtility::AcquireLicense
       
   118 // ----------------------------------------------------------------------------
       
   119 //
       
   120 EXPORT_C void CCameseUtility::AcquireLicense(
       
   121     const TDesC8& /*aDrmHeader*/,
       
   122     HBufC8*& /*aUrl*/,
       
   123     TRequestStatus& aStatus )
       
   124     {
       
   125     CAMESE_LOG( "+CCameseUtility::AcquireLicense" );
       
   126 
       
   127     aStatus = KRequestPending;
       
   128     TRequestStatus* status = &aStatus;
       
   129     User::RequestComplete( status, KErrNotSupported );
       
   130 
       
   131     CAMESE_LOG( "-CCameseUtility::AcquireLicense" );
       
   132     }
       
   133 
       
   134 // ----------------------------------------------------------------------------
       
   135 // CCameseUtility::AcquireLicense
       
   136 // ----------------------------------------------------------------------------
       
   137 //
       
   138 EXPORT_C void CCameseUtility::AcquireLicense(
       
   139     const RFile& /*aFileHandle*/,
       
   140     HBufC8*& /*aUrl*/,
       
   141     TRequestStatus& aStatus )
       
   142     {
       
   143     CAMESE_LOG( "+CCameseUtility::AcquireLicense" );
       
   144 
       
   145     aStatus = KRequestPending;
       
   146     TRequestStatus* status = &aStatus;
       
   147     User::RequestComplete( status, KErrNotSupported );
       
   148 
       
   149     CAMESE_LOG( "-CCameseUtility::AcquireLicense" );
       
   150     }
       
   151 
       
   152 // ----------------------------------------------------------------------------
       
   153 // CCameseUtility::AcquireLicense
       
   154 // ----------------------------------------------------------------------------
       
   155 //
       
   156 EXPORT_C void CCameseUtility::AcquireLicense(
       
   157     const RFile& /*aFileHandle*/,
       
   158     const TDesC8& /*aLicenseResponse*/,
       
   159     TRequestStatus& aStatus )
       
   160     {
       
   161     CAMESE_LOG( "+CCameseUtility::AcquireLicense" );
       
   162 
       
   163     aStatus = KRequestPending;
       
   164     TRequestStatus* status = &aStatus;
       
   165     User::RequestComplete( status, KErrNotSupported );
       
   166 
       
   167     CAMESE_LOG( "-CCameseUtility::AcquireLicense" );
       
   168     }
       
   169 
       
   170 
       
   171 // ----------------------------------------------------------------------------
       
   172 // CCameseUtility::SendDownloadResult
       
   173 // ----------------------------------------------------------------------------
       
   174 //
       
   175 EXPORT_C void CCameseUtility::SendDownloadResult(
       
   176     const TDesC8& /*aContentUrl*/,
       
   177     TInt /*aResult*/,
       
   178     TRequestStatus& aStatus )
       
   179     {
       
   180     CAMESE_LOG( "+CCameseUtility::SendDownloadResult" );
       
   181 
       
   182     aStatus = KRequestPending;
       
   183     TRequestStatus* status = &aStatus;
       
   184     User::RequestComplete( status, KErrNotSupported );
       
   185 
       
   186     CAMESE_LOG( "-CCameseUtility::SendDownloadResult" );
       
   187     }
       
   188 
       
   189 // ----------------------------------------------------------------------------
       
   190 // CCameseUtility::Cancel
       
   191 // ----------------------------------------------------------------------------
       
   192 //
       
   193 EXPORT_C void CCameseUtility::Cancel()
       
   194     {
       
   195     CAMESE_LOG( "+CCameseUtility::Cancel" );
       
   196 
       
   197     CAMESE_LOG( "-CCameseUtility::Cancel" );
       
   198     }
       
   199 
       
   200 // ----------------------------------------------------------------------------
       
   201 // CCameseUtility::SetIapId
       
   202 // ----------------------------------------------------------------------------
       
   203 //
       
   204 EXPORT_C void CCameseUtility::SetIapId( TInt /*aIapId*/ )
       
   205     {
       
   206     }
       
   207 
       
   208 // ----------------------------------------------------------------------------
       
   209 // CCameseUtility::CCameseUtility
       
   210 // ----------------------------------------------------------------------------
       
   211 //
       
   212 CCameseUtility::CCameseUtility()
       
   213     {
       
   214     CAMESE_LOG( "+CCameseUtility::CCameseUtility" );
       
   215     CAMESE_LOG( "-CCameseUtility::CCameseUtility" );
       
   216     }
       
   217 
       
   218 // ----------------------------------------------------------------------------
       
   219 // CCameseUtility::ConstructL
       
   220 // ----------------------------------------------------------------------------
       
   221 //
       
   222 void CCameseUtility::ConstructL( TInt /*aIapNumber*/, MCameseObserver* /*aObserver*/ )
       
   223     {
       
   224     CAMESE_LOG( "+CCameseUtility::ConstructL" );
       
   225 
       
   226     CAMESE_LOG( "-CCameseUtility::ConstructL" );
       
   227     }