webengine/wmlengine/src/hed/include/contentLoader.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2000 - 2004 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 
       
    19 // This file was given to Nokia Boston by HAMETVAARA. It forwards content
       
    20 // which is not handled by the browser to the OS document handler.
       
    21 
       
    22 // ContentLoader.h: interface for the CContentLoader class.
       
    23 //
       
    24 //////////////////////////////////////////////////////////////////////
       
    25 
       
    26 #if !defined(CONTENTLOADER_H)
       
    27 #define CONTENTLOADER_H
       
    28 
       
    29 #include <e32base.h>            // Basic Epoc stuff
       
    30 #include "nwx_defs.h"
       
    31 #include "urlloader_urlresponse.h"
       
    32 #include "nw_hed_documentroot.h"
       
    33 #include "BrsrStatusCodes.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CEikProcess;
       
    37 class CErrorUI;
       
    38 
       
    39 class CContentLoader : public CBase  
       
    40 {
       
    41 public:
       
    42     /*
       
    43     * Constructor
       
    44     * @param aProcess An instance of CEikProcess. Needed for embedding.
       
    45     **/ 
       
    46 	CContentLoader( CEikProcess* aProcess );
       
    47 
       
    48     /**
       
    49     * Destructor
       
    50     **/
       
    51 	virtual ~CContentLoader();
       
    52 
       
    53     /**
       
    54     * Handler function. 
       
    55     * <ul>
       
    56     *   <li>Constructs DocumentHandler and passes content to it.</li>
       
    57     *   <li>Tries to extract the file name from the request url in order to
       
    58     *       get a meaninful name for content. The file name extension also
       
    59     *       helps Epoc recognizers. <b>What to do if the file name is 
       
    60     *       data.php and contains a wav sound clip?</b></li>
       
    61     *   <li>Leaves through any system wide error. Catched by the app framework.</li>
       
    62     * </ul>
       
    63     */
       
    64     void HandleL( HBufC* aUrl, HBufC8* aCharset, HBufC8* aContentType,
       
    65                   NW_HED_DocumentRoot_t* aDocRoot,
       
    66                   const TDesC& aFileName, TBool* aNeedDelete );
       
    67     RFs               iRfs;
       
    68     HBufC*            iFileName;
       
    69 
       
    70 private:
       
    71 
       
    72     void SetMimeTypeL( TUint8* aContentType, TDes8& mimetypestr );
       
    73 
       
    74     CEikProcess*      iProcess;
       
    75 
       
    76 };
       
    77 
       
    78 TBrowserStatusCode HandleContent(HBufC* aUrl, HBufC8* aCharset, HBufC8* aContentType,
       
    79                                  NW_HED_DocumentRoot_t* aDocRoot,
       
    80                                  const TDesC& aFileName, TBool* aNeedDelete);
       
    81 
       
    82 void DeletePrevContentL(struct NW_HED_DocumentRoot_s* aDocRoot);
       
    83 
       
    84 #endif // !defined(CONTENTLOADER_H)