messagingfw/wappushfw/ROContentHandler/inc/MessageComposer.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 	
       
    16 #ifndef __WBXMLCONVERTER_H
       
    17 #define __WBXMLCONVERTER_H
       
    18 
       
    19 // System Include
       
    20 #include <e32base.h>
       
    21 #include <xml/contenthandler.h>
       
    22 #include <xml/parser.h>
       
    23 #include <push/pushmessage.h>
       
    24 
       
    25 
       
    26 /** 
       
    27 Class for parsing the XML document and handles the callbacks from generic XML parser
       
    28 @internalTechnology
       
    29 @released
       
    30  */
       
    31 class CMessageComposer : public CBase, public Xml::MContentHandler
       
    32 	{
       
    33 public:
       
    34 	static CMessageComposer* NewL ( CPushMessage& aPushMsg);
       
    35 	
       
    36 	/** parses and validates and returns error code */
       
    37 	const TDesC8& ParseMessageL ();	
       
    38 
       
    39 	~CMessageComposer ();
       
    40 	
       
    41 	RStringPool& StringPool ();
       
    42 	
       
    43 	// Methods from Xml::MContentHandler
       
    44 	void OnStartDocumentL ( const Xml::RDocumentParameters &aDocParam, TInt aErrorCode );
       
    45 	void OnEndDocumentL ( TInt aErrorCode );	
       
    46 	void OnStartElementL ( const Xml::RTagInfo &aElement, const Xml::RAttributeArray &aAttributes, TInt aErrorCode );
       
    47 	void OnEndElementL ( const Xml::RTagInfo &aElement, TInt aErrorCode );
       
    48 	void OnContentL ( const TDesC8 &aBytes, TInt aErrorCode );
       
    49 	void OnStartPrefixMappingL ( const RString &aPrefix, const RString &aUri, TInt aErrorCode );
       
    50 	void OnEndPrefixMappingL ( const RString &aPrefix, TInt aErrorCode );
       
    51 	void OnIgnorableWhiteSpaceL ( const TDesC8 &aBytes, TInt aErrorCode );
       
    52 	void OnSkippedEntityL ( const RString &aName, TInt aErrorCode );
       
    53 	void OnProcessingInstructionL ( const TDesC8 &aTarget, const TDesC8 &aData, TInt aErrorCode );
       
    54 	void OnError ( TInt aErrorCode );
       
    55 	TAny* GetExtendedInterface ( const TInt32 aUid );
       
    56 	
       
    57 	TInt LastError ();	
       
    58 private:
       
    59 	CMessageComposer( CPushMessage& aPushMsg);
       
    60 	void ConstructL ();
       
    61 	void LoadPluginL ();
       
    62 	TInt MapToWapXMLError ( TInt aXmlErrorCode );
       
    63 	void AppendDataL ( const TDesC8& aData );
       
    64 private:
       
    65 	CPushMessage&				iPushMessage;	// reference
       
    66 	Xml::CParser*				iParser;
       
    67 	TInt iLastError;
       
    68 	RBuf8 iXmlBuf;
       
    69 	TBool iIsKeyValue;
       
    70 	};
       
    71 
       
    72 
       
    73 #endif // MessageComposer.h