wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowserview.h
branchRCL_3
changeset 27 1481bf457703
parent 26 1221b68b8a5f
equal deleted inserted replaced
26:1221b68b8a5f 27:1481bf457703
     1 /*
     1 /*
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008 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>
    23 
    24 
    24 class CWmDrmDlaBrowserContainer;
    25 class CWmDrmDlaBrowserContainer;
    25 class CInternetConnectionManager;
    26 class CInternetConnectionManager;
    26 
    27 
    27 /**
    28 /**
    28  * Interface for license received callback.
    29  * Interface for license received callback.
    29  */
    30  */
    30 class MBrowserViewLicenseReceivedCallback
    31 class MBrowserViewLicenseReceivedCallback
    31     {
    32     {
    32     public:
    33     public: 
    33 
    34         
    34         virtual void LicenseReceived() = 0;
    35         virtual void LicenseReceived() = 0;
    35 
    36 
    36     };
    37     };
    37 
    38 
    38 class CWmDrmDlaBrowserView : public CAknView
    39 class CWmDrmDlaBrowserView : public CAknView, 
       
    40                              public MBrCtlSpecialLoadObserver
    39     {
    41     {
    40 
    42 
    41     public:
    43     public:
    42 
    44 
    43         static CWmDrmDlaBrowserView* NewL();
    45         static CWmDrmDlaBrowserView* NewL();
    45 
    47 
    46         /**
    48         /**
    47          * Destructor.
    49          * Destructor.
    48          */
    50          */
    49         virtual ~CWmDrmDlaBrowserView();
    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();
    50 
    79 
    51     public: // From CAknView
    80     public: // From CAknView
    52 
    81 
    53         /**
    82         /**
    54         * @see CAknView
    83         * @see CAknView
    55         */
    84         */
    56         TUid Id() const;
    85         TUid Id() const;
    57 
    86 
    58         /**
    87         /**
       
    88         * @see CAknView
       
    89         */
       
    90         void HandleCommandL( TInt aCommand );
       
    91 
       
    92         /** 
    59         * @see CAknView
    93         * @see CAknView
    60         */
    94         */
    61         void DoActivateL( const TVwsViewId& aPrevViewId,
    95         void DoActivateL( const TVwsViewId& aPrevViewId,
    62                           TUid aCustomMessageId,
    96                           TUid aCustomMessageId,
    63                           const TDesC8& aCustomMessage );
    97                           const TDesC8& aCustomMessage );
    67         void DoDeactivate();
   101         void DoDeactivate();
    68 
   102 
    69         /**
   103         /**
    70         * @see CAknView
   104         * @see CAknView
    71         */
   105         */
    72         void HandleClientRectChange();
   106         void HandleClientRectChange();    
    73 
   107     
    74     public: // From MBrCtlSpecialLoadObserver
   108     public: // From MBrCtlSpecialLoadObserver
    75 
   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         
    76     private:
   121     private:
    77 
   122 
    78         CWmDrmDlaBrowserView();
   123         CWmDrmDlaBrowserView();
    79         void ConstructL();
   124         void ConstructL();
    80 
   125         
    81         void CreateContainerL();
   126         void CreateContainerL();
    82         void RemoveContainer();
   127         void RemoveContainer();
    83         void BrCtlHandleCommandL( TInt aCommand );
   128         void BrCtlHandleCommandL( TInt aCommand );
    84 
   129 
    85     private: // data
   130     private: // data
    86 
   131 
    87         //Not Owned
   132         //Not Owned
    88         MBrowserViewLicenseReceivedCallback* iCallback;
   133         MBrowserViewLicenseReceivedCallback* iCallback;
    89 
   134         
    90         CWmDrmDlaBrowserContainer* iContainer;
   135         CWmDrmDlaBrowserContainer* iContainer;
    91         HBufC8* iLicenseResponse;
   136         HBufC8* iLicenseResponse;
    92         CInternetConnectionManager* iConMgr;
   137         CInternetConnectionManager* iConMgr;
    93         TInt iIap;
   138         TInt iIap;
    94     };
   139     };