diff -r f42c9de433f2 -r cc1be3797632 engine/inc/FeedParser.h --- a/engine/inc/FeedParser.h Wed Jul 07 23:27:49 2010 +0100 +++ b/engine/inc/FeedParser.h Fri Jul 09 11:34:00 2010 +0100 @@ -25,6 +25,7 @@ #include // for Xml::MContentHandler #include + _LIT(KTagItem, "item"); _LIT(KTagTitle, "title"); _LIT(KTagImage, "image"); @@ -62,15 +63,21 @@ const int KBufferLength = 1024; -class CFeedParser : public CBase, public Xml::MContentHandler +class CFeedParser : public CActive, public Xml::MContentHandler { public: + static CFeedParser* NewL(MFeedParserObserver& aCallbacks, RFs& aFs); + static CFeedParser* NewLC(MFeedParserObserver& aCallbacks, RFs& aFs); + virtual ~CFeedParser(); + +private: CFeedParser(MFeedParserObserver& aCallbacks, RFs& aFs); - virtual ~CFeedParser(); + void ConstructL(); public: void ParseFeedL(const TFileName &feedFileName, CFeedInfo *item, TUint aMaxItems); - + void ParseFeedAoL(const TFileName &feedFileName, CFeedInfo *item, TUint aMaxItems); + public: // from MContentHandler void OnStartDocumentL(const Xml::RDocumentParameters& aDocParam, TInt aErrorCode); void OnEndDocumentL(TInt aErrorCode); @@ -85,6 +92,12 @@ void OnError(TInt aErrorCode); TAny* GetExtendedInterface(const TInt32 aUid); CFeedInfo& ActiveFeed(); + +private: + void DoCancel(); + void RunL(); + TInt RunError(TInt aError); + private: MFeedParserObserver& iCallbacks; TFeedState iFeedState; @@ -98,7 +111,13 @@ TUint iItemsParsed; TBool iStoppedParsing; TEncoding iEncoding; + RFs& iRfs; + Xml::CParser* iParser; + HBufC8* iXmlBuffer; + RFile iFile; + TFileName iFileName; + }; #endif