messagingfw/wappushfw/plugins/PushContentHandler/CMultiPartMixedContentHandler.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
child 44 7c176670643f
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2001-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 __CMULTIPARTMIXEDCONTENTHANDLER_H__
       
    17 #define __CMULTIPARTMIXEDCONTENTHANDLER_H__
       
    18 
       
    19 // System includes
       
    20 //
       
    21 #include <e32base.h>
       
    22 #include "cmultipartiteratorbase.h"
       
    23 #include <push/ccontenthandlerbase.h>
       
    24 #include "cmultipartbiniterator.h"
       
    25 #include <push/pushmessage.h>
       
    26 
       
    27 // Local includes
       
    28 //
       
    29 
       
    30 // Constants
       
    31 //
       
    32 const TUid KUidPushMultiPartMixedContentHandler	= { 0x101F3E64 };
       
    33 _LIT(KMultiPartMixedContentHandlerData, "application/vnd.wap.multipart.mixed||multipart/mixed");
       
    34 
       
    35 /**
       
    36  * The MultiPart/Mixed Content Handler 
       
    37  *
       
    38  * Takes apart the mulitpart message, creating a new sub message from each part, then calls on
       
    39  * new Push Handlers to process each sub message.
       
    40  * 
       
    41  */ 
       
    42 //##ModelId=3B659EE90241
       
    43 class CMultiPartMixedContentHandler : public CContentHandlerBase
       
    44 /**
       
    45 @internalComponent
       
    46 @released
       
    47 */
       
    48 	{
       
    49 public:	// Methods
       
    50 
       
    51 	static CMultiPartMixedContentHandler* NewL();
       
    52 
       
    53 	virtual ~CMultiPartMixedContentHandler();
       
    54 
       
    55 private:	// Methods from CPushHandlerBase
       
    56 	
       
    57 	virtual void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus);
       
    58 
       
    59 	virtual void HandleMessageL(CPushMessage* aPushMsg);
       
    60 
       
    61 	virtual void CancelHandleMessage();
       
    62 
       
    63 	virtual void CPushHandlerBase_Reserved1();
       
    64 
       
    65 	virtual void CPushHandlerBase_Reserved2();
       
    66 
       
    67 private:	// Methods from CActive
       
    68 
       
    69 	virtual void DoCancel();
       
    70 
       
    71 	virtual void RunL();
       
    72 
       
    73 	virtual TInt RunError(TInt aError);
       
    74 
       
    75 private:	// Methods
       
    76 
       
    77 	CMultiPartMixedContentHandler();
       
    78 
       
    79 	void ConstructL();
       
    80 
       
    81 	void LoadMultipartMsgL();
       
    82 
       
    83 	void HandlePartL();
       
    84 
       
    85 	void NextPartL();
       
    86 
       
    87 private:	// Attributes
       
    88 
       
    89 	enum TState {  ELoadMsgData, EHandlePart, ENextPart, EDone };
       
    90 
       
    91 	CMultipartIteratorBase*		iMultiMessage;
       
    92 
       
    93 	CContentHandlerBase*		iContentHandler;
       
    94 	
       
    95 	};
       
    96 
       
    97 
       
    98 #endif	// __CMULTIPARTMIXEDCONTENTHANDLER_H__