webengine/osswebengine/WebKit/s60/webview/WmlDispatcher.h
changeset 0 dd21522fd290
child 36 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006 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 the License "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:  
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef WMLDISPATCHER_H
       
    19 #define WMLDISPATCHER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <w32std.h>
       
    24 #include "BrCtlDefs.h"
       
    25 
       
    26 #include "BrCtl.h"
       
    27 #include "SelfDownloadContentHandler.h"
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CBrCtl;
       
    39 class CTempFile;
       
    40 class CWmlContentInterface;
       
    41 class WmlResourceLoaderClient;
       
    42 
       
    43 namespace WebCore {
       
    44     class Frame;
       
    45 }
       
    46 
       
    47  
       
    48 // CLASS DECLARATION
       
    49 
       
    50 
       
    51 
       
    52 /**
       
    53 *
       
    54 *  @lib resLoader.lib
       
    55 *  @since 3.0
       
    56 */
       
    57 NONSHARABLE_CLASS(CWmlDispatcher) : public CBase//, public MContentListener
       
    58     {
       
    59     public:  // Constructors and destructor        
       
    60         
       
    61         /**
       
    62         * Two-phased constructor.
       
    63         */
       
    64         static CWmlDispatcher* NewL(CBrCtl* brCtl, WebCore::Frame* frame);  
       
    65         
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         virtual ~CWmlDispatcher( );
       
    70 
       
    71 	public: 
       
    72 
       
    73         /**
       
    74         *
       
    75         * @since 3.1
       
    76         * @param
       
    77         * @return KErrNotSupported if it is not a native browser content
       
    78         */
       
    79      TInt HeadersL( TInt aTransactionId, WebCore::ResourceResponse& response/*, CUrlResponseInfo& aResponse*/ );
       
    80 
       
    81         /**
       
    82         *
       
    83         * @since 3.1
       
    84         * @param
       
    85         * @return
       
    86         */
       
    87         void ResponseL(  const char* data, int length /*TInt aTransactionId, CUrlResponseInfo& aResponse*/ );
       
    88 
       
    89         /**
       
    90         *
       
    91         * @since 3.1
       
    92         * @param
       
    93         * @return
       
    94         */
       
    95         void CompleteL( TInt aTransactionId/*, CUrlResponseInfo& aResponse*/, TInt aError );
       
    96 
       
    97         /**
       
    98         *
       
    99         * @since 3.1
       
   100         * @param
       
   101         * @return
       
   102         */
       
   103         void HandleError( TInt aTransactionId, TInt aError );
       
   104         void MakeWmlVisible(bool visisble);    
       
   105         void WmlParameters( const char* data, int length, TDesC& contentType, TDesC& charset, TInt httpStatus, TInt chunkIndex, TDesC& url  );    
       
   106         void loadResource(TDesC8& url,  CWmlContentInterface* content );        
       
   107     
       
   108     private:
       
   109 
       
   110         /**
       
   111         * C++ default constructor.
       
   112         */
       
   113         CWmlDispatcher(CBrCtl* aBrCtl, WebCore::Frame* frame);
       
   114 
       
   115         /**
       
   116         * By default Symbian 2nd phase constructor is private.
       
   117         */
       
   118         void ConstructL();
       
   119         void LoadFileL(const TDesC& aFileName, const TDesC& aUrl, const TDesC& aContType);
       
   120 		      void LoadUrlL( const TDesC& aFileName);
       
   121 		      void AddUrlToFileL(const TDesC& aFileName, const TDesC& aUrl, const TDesC& aContType);
       
   122         
       
   123 
       
   124 
       
   125     private:       
       
   126         
       
   127         CBrCtl*    m_brCtl;
       
   128         CTempFile* m_contentFile;	          //owned
       
   129         HBufC*     m_contentType;           // owned
       
   130         HBufC*     m_charset;               // owned
       
   131         HBufC*     m_url;                   // owned
       
   132         
       
   133         TInt	   m_error;
       
   134         TInt       m_restLength;
       
   135         TBool      m_loading; 
       
   136         void*      m_loadContext;
       
   137         void*      m_partialCallback;
       
   138     
       
   139     private: //from WmlStreamLoaderClient
       
   140         
       
   141         WebCore::Frame* m_frame;
       
   142         WebCore::ResourceRequest* m_request;    
       
   143     };
       
   144 
       
   145 #endif      // WMLDISPATCHER_H            
       
   146 // End of File