browserutilities/feedsengine/FeedsServer/UrlHandler/inc/FileHandler.h
changeset 0 dd21522fd290
child 25 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2005 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:  A class that fetches resources via RFile.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FILE_HANDLER_H
       
    20 #define FILE_HANDLER_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "LeakTracker.h"
       
    27 #include "UrlHandler.h"
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CIdle;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 
       
    43 /**
       
    44 *  A class that fetches resources via RFile.
       
    45 *
       
    46 *  \b Library: FeedsEngine.lib
       
    47 *
       
    48 *  @since 3.0
       
    49 */
       
    50 class CFileHandler: public CUrlHandler
       
    51     {
       
    52     public:  // Constructors and destructor
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         static CFileHandler* NewL();
       
    57         
       
    58         /**
       
    59         * Destructor.
       
    60         */        
       
    61         virtual ~CFileHandler();
       
    62     
       
    63 
       
    64     public:  // From MUrlHandler
       
    65         /**
       
    66         * Loads the given url -- asynchronously
       
    67         *
       
    68         * @since 3.0
       
    69         * @param aUrl The url to load
       
    70         * @param aObserver The load observer.
       
    71         * @return void.
       
    72         */
       
    73         virtual void LoadUrlL(const TDesC& aUrl, MLoadObserver& aObserver);
       
    74 
       
    75 
       
    76     private:
       
    77         /**
       
    78         * C++ default constructor.
       
    79         */
       
    80         CFileHandler();
       
    81         
       
    82         /**
       
    83         * By default Symbian 2nd phase constructor is private.
       
    84         */
       
    85         void ConstructL();
       
    86                 
       
    87         /**
       
    88         * Loads and passes the buffer to the observer.
       
    89         *
       
    90         * @since 3.0
       
    91         * @param aPtr The this pointer.
       
    92         * @return Always returns EFalse.
       
    93         */
       
    94         static TInt LoadCompleted(TAny* aPtr);
       
    95 
       
    96         /**
       
    97         * Loads and passes the buffer to the observer.
       
    98         *
       
    99         * @since 3.0
       
   100         * @return The buffer.
       
   101         */
       
   102         HBufC8* LoadCompletedHelperL();
       
   103 
       
   104 
       
   105     private:
       
   106         TLeakTracker    iLeakTracker;
       
   107         
       
   108         HBufC16*        iUrl;
       
   109         MLoadObserver*  iObserver;
       
   110         CIdle*          iIdle;
       
   111     };
       
   112 
       
   113 #endif      // FILE_HANDLER_H
       
   114             
       
   115 // End of File