wmdrm/camese/wmdrmdladefaulthttpplugin/inc/wmdrmdladefaultplayready.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2008 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:  WMDRM DLA Default Http PlayReady Implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_WMDRMDLADEFAULTPLAYREADY_H
       
    20 #define C_WMDRMDLADEFAULTPLAYREADY_H
       
    21 
       
    22 #include "wmdrmdladefaulthttpmanagerobserver.h"
       
    23 
       
    24 class CWmDrmDlaDefaultHttpPlugin;
       
    25 class CWmDrmDlaUiNotifier;
       
    26 class CWmDrmDlaDefaultHttpManager;
       
    27 class CHTTPFormEncoder;
       
    28 
       
    29 /**
       
    30  * WMDRM DLA Default Http PlayReady Implementation
       
    31  *
       
    32  * @lib wmdrmdladefaulthttpplugin.lib
       
    33  * @since S60 v9.1
       
    34  */
       
    35 NONSHARABLE_CLASS( CWmDrmDlaDefaultPlayReady ) 
       
    36     : public CBase, 
       
    37       public MWmDrmDlaDefaltHttpManagerObserver
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     static CWmDrmDlaDefaultPlayReady* NewL( 
       
    43                 CWmDrmDlaDefaultHttpPlugin* aPlugin );
       
    44     ~CWmDrmDlaDefaultPlayReady();
       
    45 
       
    46     /**
       
    47      * Check if initiator is supported by this plugin
       
    48      * This method is called only for playready content
       
    49      * 
       
    50      * @param aInitiator Initiator
       
    51      * @param aUiNotifer If initiator is supported, contains initialized UI
       
    52      *                   Notifier upon completion. Will be deleted by the
       
    53      *                   caller.
       
    54      * @return ETrue if initiator is supported by this plugin
       
    55      * @leave with standard Symbian error code in case of error
       
    56      */
       
    57     TBool SupportedInitiatorL( const TDesC8& aInitiator, 
       
    58                                CWmDrmDlaUiNotifier*& aUiNotifier );
       
    59 
       
    60     /**
       
    61      * Process the initiator. This method is used only to pass initiator to the 
       
    62      * plugin. The framework does not require the plugin to do anything. 
       
    63      * This method is called only for playready content
       
    64      *
       
    65      * @param aInitiator Initiator
       
    66      * @leave with standard Symbian error code in case of fatal error (the 
       
    67      * framework does not proceed with license acquisition if this method
       
    68      * leaves)
       
    69      */
       
    70     void ProcessInitiatorL( const TDesC8& aInitiator );
       
    71 
       
    72     /*
       
    73      * Process join domain challenge.
       
    74      * This method is called only for playready content
       
    75      *
       
    76      * @param aJoinDomainChallenge Join domain challenge
       
    77      * @param aUrl Url to be used in join domain request
       
    78      * @param aStatus Request status, will contain error code upon completion
       
    79      * including but not limited to:
       
    80      * - KErrCommsBreak if network connection was lost during communication
       
    81      *                  with server
       
    82      * - KErrGeneral if unspecified error happened
       
    83      */
       
    84     void ProcessJoinDomainChallenge( 
       
    85             const TDesC8& aJoinDomainChallenge, 
       
    86             const TDesC& aUrl, 
       
    87             TRequestStatus& aStatus );
       
    88 
       
    89     /*
       
    90      * Process leave domain challenge.
       
    91      * This method is called only for playready content
       
    92      *
       
    93      * @param aLeaveDomainChallenge Leave domain challenge
       
    94      * @param aUrl Url to be used in leave domain request
       
    95      * @param aStatus Request status, will contain error code upon completion
       
    96      * including but not limited to:
       
    97      * - KErrCommsBreak if network connection was lost during communication
       
    98      *                  with server
       
    99      * - KErrGeneral if unspecified error happened
       
   100      */
       
   101     void ProcessLeaveDomainChallenge( 
       
   102             const TDesC8& aLeaveDomainChallenge, 
       
   103             const TDesC& aUrl, 
       
   104             TRequestStatus& aStatus );
       
   105 
       
   106     /**
       
   107      * Sets the IAP to be used in the HTTP transactions
       
   108      *
       
   109      * @param   aIapId  Internet Access Point id
       
   110      */
       
   111     void SetIapId( TInt aIapId );
       
   112 
       
   113 private: // From MWmDrmDlaDefaltHttpManagerObserver
       
   114     
       
   115     TBool OnGetUsernamePasswordL( HBufC8*& aUsername, HBufC8*& aPassword );
       
   116     void OnResponseHeadersL( const RHTTPResponse& aResponse, 
       
   117                              const RHTTPHeaders& aHeaders, 
       
   118                              const RStringPool& aStringPool, 
       
   119                              TInt aHttpStatus );
       
   120     void OnResponseBodyDataL( const TPtrC8 aDataChunk );
       
   121     void OnTransactionComplete( TInt aSystemError );
       
   122 
       
   123 private:
       
   124 
       
   125     CWmDrmDlaDefaultPlayReady( CWmDrmDlaDefaultHttpPlugin* aPlugin );
       
   126     void ConstructL();
       
   127     
       
   128     void CompleteClientRequest( TInt aError );
       
   129         
       
   130 private: // data
       
   131     
       
   132     enum TPlayReadyState
       
   133         {
       
   134         ENotActive,
       
   135         };
       
   136     
       
   137     TPlayReadyState iState;
       
   138     CWmDrmDlaDefaultHttpManager* iHttpManager;
       
   139     CHTTPFormEncoder* iFormEncoder;
       
   140     TInt iHttpStatus;
       
   141     
       
   142     //Not owned
       
   143     CWmDrmDlaDefaultHttpPlugin* iPlugin;
       
   144     TRequestStatus* iClientStatus;
       
   145     
       
   146     };
       
   147 
       
   148 #endif // C_WMDRMDLADEFAULTPLAYREADY_H