wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowserview.h
changeset 0 95b198f216e5
child 26 1221b68b8a5f
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:  Interface class for WMDRM DLA Browser View
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_WMDRMDLABROWSERVIEW_H
       
    20 #define C_WMDRMDLABROWSERVIEW_H
       
    21 
       
    22 #include <aknview.h>
       
    23 #include <brctlspecialloadobserver.h>
       
    24 
       
    25 class CWmDrmDlaBrowserContainer;
       
    26 class CInternetConnectionManager;
       
    27 
       
    28 /**
       
    29  * Interface for license received callback.
       
    30  */
       
    31 class MBrowserViewLicenseReceivedCallback
       
    32     {
       
    33     public: 
       
    34         
       
    35         virtual void LicenseReceived() = 0;
       
    36 
       
    37     };
       
    38 
       
    39 class CWmDrmDlaBrowserView : public CAknView, 
       
    40                              public MBrCtlSpecialLoadObserver
       
    41     {
       
    42 
       
    43     public:
       
    44 
       
    45         static CWmDrmDlaBrowserView* NewL();
       
    46         static CWmDrmDlaBrowserView* NewLC();
       
    47 
       
    48         /**
       
    49          * Destructor.
       
    50          */
       
    51         virtual ~CWmDrmDlaBrowserView();
       
    52         
       
    53         /**
       
    54          * Set the IAP that is used in network connection
       
    55          * @param aIap - IAP to be used 
       
    56          */
       
    57         void SetIAP( TInt aIap );
       
    58         
       
    59         /**
       
    60          * Make a POST-request
       
    61          * @param aCallback - Callback used to inform when license 
       
    62          *                    response is received
       
    63          * @param aPostUrl - Post URL
       
    64          * @param aPostContentType - Post content type
       
    65          * @param aPostData - Post data
       
    66          * @param aPostContentBoundary - Post content boundary
       
    67          */
       
    68         void PostL( MBrowserViewLicenseReceivedCallback* aCallback,
       
    69                     const TDesC& aPostUrl,
       
    70                     const TDesC8& aPostContentType,
       
    71                     const TDesC8& aPostData,
       
    72                     const TDesC8& aPostContentBoundary );
       
    73         
       
    74         /**
       
    75          * Get the license response
       
    76          * @return License response or NULL
       
    77          */
       
    78         HBufC8* LicenseResponse();
       
    79 
       
    80     public: // From CAknView
       
    81 
       
    82         /**
       
    83         * @see CAknView
       
    84         */
       
    85         TUid Id() const;
       
    86 
       
    87         /**
       
    88         * @see CAknView
       
    89         */
       
    90         void HandleCommandL( TInt aCommand );
       
    91 
       
    92         /** 
       
    93         * @see CAknView
       
    94         */
       
    95         void DoActivateL( const TVwsViewId& aPrevViewId,
       
    96                           TUid aCustomMessageId,
       
    97                           const TDesC8& aCustomMessage );
       
    98         /**
       
    99         * @see CAknView
       
   100         */
       
   101         void DoDeactivate();
       
   102 
       
   103         /**
       
   104         * @see CAknView
       
   105         */
       
   106         void HandleClientRectChange();    
       
   107     
       
   108     public: // From MBrCtlSpecialLoadObserver
       
   109 
       
   110         void NetworkConnectionNeededL( TInt* aConnectionPtr, 
       
   111                                        TInt* aSockSvrHandle, 
       
   112                                        TBool* aNewConn, 
       
   113                                        TApBearerType* aBearerType );
       
   114 
       
   115         TBool HandleRequestL( RArray<TUint>* aTypeArray, 
       
   116                               CDesCArrayFlat* aDesArray );
       
   117 
       
   118         TBool HandleDownloadL( RArray<TUint>* aTypeArray, 
       
   119                                CDesCArrayFlat* aDesArray );    
       
   120         
       
   121     private:
       
   122 
       
   123         CWmDrmDlaBrowserView();
       
   124         void ConstructL();
       
   125         
       
   126         void CreateContainerL();
       
   127         void RemoveContainer();
       
   128         void BrCtlHandleCommandL( TInt aCommand );
       
   129 
       
   130     private: // data
       
   131 
       
   132         //Not Owned
       
   133         MBrowserViewLicenseReceivedCallback* iCallback;
       
   134         
       
   135         CWmDrmDlaBrowserContainer* iContainer;
       
   136         HBufC8* iLicenseResponse;
       
   137         CInternetConnectionManager* iConMgr;
       
   138         TInt iIap;
       
   139     };
       
   140 
       
   141 #endif // C_WMDRMDLABROWSERVIEW_H