browserutilities/feedsengine/FeedsServer/FeedHandler/inc/FeedHandler.h
changeset 0 dd21522fd290
child 36 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:  The top-level handler of Feeds.  It takes a buffer and uses an
       
    15 *                appropriate feeds parser to create a Feed instance.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef FEED_HANDLER_H
       
    21 #define FEED_HANDLER_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 #include "FeedParser.h"
       
    28 #include "LeakTracker.h"
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // DATA TYPES
       
    35 
       
    36 // FUNCTION PROTOTYPES
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 
       
    40 // CLASS DECLARATION
       
    41 class CXmlUtils;
       
    42 
       
    43 /**
       
    44 *  The top-level handler of Feeds.  It takes a buffer and uses an
       
    45 *  appropriate feeds parser to create a Feed instance.
       
    46 *
       
    47 *  \b Library: FeedsEngine.lib
       
    48 *
       
    49 *  @since 3.0
       
    50 *  @attention WARNING!!! This class must be "Thread (ActiveObject) safe".  Meaning
       
    51 *            that it must not contain any member variables that can't
       
    52 *            be safely shared between all "threads" using it.
       
    53 */
       
    54 class CFeedHandler: public CBase
       
    55     {
       
    56     public:  // Constructors and destructor
       
    57         /**
       
    58         * Two-phased constructor.
       
    59         */
       
    60         static CFeedHandler* NewL(CXmlUtils& aXmlUtils);
       
    61         
       
    62         /**
       
    63         * Destructor.
       
    64         */        
       
    65         virtual ~CFeedHandler();
       
    66         
       
    67         
       
    68     public:  // New methods
       
    69         /**
       
    70         * Creates a Feed instance from the buffer.  This method
       
    71         * may modify aBuffer.
       
    72         *
       
    73         * @since 3.0
       
    74         * @param aBuffer A utf8 buffer.  -- TODO: pass be ref
       
    75         * @param aContentType The content-type.
       
    76         * @param aCharSet The char-encoding.
       
    77         * @return A Feed instance.
       
    78         */
       
    79         void ParseL(TDesC8& aBuffer, const TDesC& aContentType, 
       
    80                 const TDesC& aCharSet, MFeedParserObserver& aObserver);
       
    81         
       
    82         
       
    83     private:
       
    84         /**
       
    85         * C++ default constructor.
       
    86         */
       
    87         CFeedHandler(CXmlUtils& aXmlUtils);
       
    88         
       
    89         /**
       
    90         * By default Symbian 2nd phase constructor is private.
       
    91         */
       
    92         void ConstructL();
       
    93 
       
    94 
       
    95     private:
       
    96         
       
    97         TLeakTracker  iLeakTracker;
       
    98         CXmlUtils&    iXmlUtils;
       
    99     };
       
   100 
       
   101 #endif      // FEED_HANDLER_H
       
   102             
       
   103 // End of File