wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowserview.h
branchRCL_3
changeset 26 1221b68b8a5f
parent 0 95b198f216e5
child 27 1481bf457703
equal deleted inserted replaced
25:50c53e893c3f 26:1221b68b8a5f
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 
    18 
    19 #ifndef C_WMDRMDLABROWSERVIEW_H
    19 #ifndef C_WMDRMDLABROWSERVIEW_H
    20 #define C_WMDRMDLABROWSERVIEW_H
    20 #define C_WMDRMDLABROWSERVIEW_H
    21 
    21 
    22 #include <aknview.h>
    22 #include <aknview.h>
    23 #include <brctlspecialloadobserver.h>
       
    24 
    23 
    25 class CWmDrmDlaBrowserContainer;
    24 class CWmDrmDlaBrowserContainer;
    26 class CInternetConnectionManager;
    25 class CInternetConnectionManager;
    27 
    26 
    28 /**
    27 /**
    29  * Interface for license received callback.
    28  * Interface for license received callback.
    30  */
    29  */
    31 class MBrowserViewLicenseReceivedCallback
    30 class MBrowserViewLicenseReceivedCallback
    32     {
    31     {
    33     public: 
    32     public:
    34         
    33 
    35         virtual void LicenseReceived() = 0;
    34         virtual void LicenseReceived() = 0;
    36 
    35 
    37     };
    36     };
    38 
    37 
    39 class CWmDrmDlaBrowserView : public CAknView, 
    38 class CWmDrmDlaBrowserView : public CAknView
    40                              public MBrCtlSpecialLoadObserver
       
    41     {
    39     {
    42 
    40 
    43     public:
    41     public:
    44 
    42 
    45         static CWmDrmDlaBrowserView* NewL();
    43         static CWmDrmDlaBrowserView* NewL();
    47 
    45 
    48         /**
    46         /**
    49          * Destructor.
    47          * Destructor.
    50          */
    48          */
    51         virtual ~CWmDrmDlaBrowserView();
    49         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 
    50 
    80     public: // From CAknView
    51     public: // From CAknView
    81 
    52 
    82         /**
    53         /**
    83         * @see CAknView
    54         * @see CAknView
    84         */
    55         */
    85         TUid Id() const;
    56         TUid Id() const;
    86 
    57 
    87         /**
    58         /**
    88         * @see CAknView
       
    89         */
       
    90         void HandleCommandL( TInt aCommand );
       
    91 
       
    92         /** 
       
    93         * @see CAknView
    59         * @see CAknView
    94         */
    60         */
    95         void DoActivateL( const TVwsViewId& aPrevViewId,
    61         void DoActivateL( const TVwsViewId& aPrevViewId,
    96                           TUid aCustomMessageId,
    62                           TUid aCustomMessageId,
    97                           const TDesC8& aCustomMessage );
    63                           const TDesC8& aCustomMessage );
   101         void DoDeactivate();
    67         void DoDeactivate();
   102 
    68 
   103         /**
    69         /**
   104         * @see CAknView
    70         * @see CAknView
   105         */
    71         */
   106         void HandleClientRectChange();    
    72         void HandleClientRectChange();
   107     
    73 
   108     public: // From MBrCtlSpecialLoadObserver
    74     public: // From MBrCtlSpecialLoadObserver
   109 
    75 
   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:
    76     private:
   122 
    77 
   123         CWmDrmDlaBrowserView();
    78         CWmDrmDlaBrowserView();
   124         void ConstructL();
    79         void ConstructL();
   125         
    80 
   126         void CreateContainerL();
    81         void CreateContainerL();
   127         void RemoveContainer();
    82         void RemoveContainer();
   128         void BrCtlHandleCommandL( TInt aCommand );
    83         void BrCtlHandleCommandL( TInt aCommand );
   129 
    84 
   130     private: // data
    85     private: // data
   131 
    86 
   132         //Not Owned
    87         //Not Owned
   133         MBrowserViewLicenseReceivedCallback* iCallback;
    88         MBrowserViewLicenseReceivedCallback* iCallback;
   134         
    89 
   135         CWmDrmDlaBrowserContainer* iContainer;
    90         CWmDrmDlaBrowserContainer* iContainer;
   136         HBufC8* iLicenseResponse;
    91         HBufC8* iLicenseResponse;
   137         CInternetConnectionManager* iConMgr;
    92         CInternetConnectionManager* iConMgr;
   138         TInt iIap;
    93         TInt iIap;
   139     };
    94     };