pushmtm/Plugins/PushContentHandler/CMultiPartMixedContentHandler.h
changeset 0 84ad3b177aa3
child 25 92a061761a7b
equal deleted inserted replaced
-1:000000000000 0:84ad3b177aa3
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Declaration of CMultiPartMixedContentHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CMULTIPARTMIXEDCONTENTHANDLER_H__
       
    21 #define __CMULTIPARTMIXEDCONTENTHANDLER_H__
       
    22 
       
    23 
       
    24 // INCLUDE FILES
       
    25 
       
    26 #include "PushMtmDef.hrh"
       
    27 #include "PushContentHandlerDef.hrh"
       
    28 #include <CContentHandlerBase.h>
       
    29 #include <E32Base.h>
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 const TUid KUidPushMultiPartMixedContentHandler	= { 
       
    34            EUidPushMultiPartMixedContentHandler };
       
    35 _LIT(KMultiPartMixedContentHandlerData, 
       
    36      "application/vnd.wap.multipart.mixed||multipart/mixed");
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 
       
    40 class CMultipartIteratorBase;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 * The MultiPart/Mixed Content Handler 
       
    46 *
       
    47 * Takes apart the mulitpart message, creating a new sub message from each 
       
    48 * part, then calls on new Push Handlers to process each sub message.
       
    49 *
       
    50 * All multipart/mixed messages are dropped if __TEST_MULTIPART_MIX_SUPP 
       
    51 * is not defined.
       
    52 */ 
       
    53 class CMultiPartMixedContentHandler : public CContentHandlerBase
       
    54 	{
       
    55     public: // Constructors and destructor
       
    56 
       
    57 	    static CMultiPartMixedContentHandler* NewL();
       
    58 
       
    59 	    virtual ~CMultiPartMixedContentHandler();
       
    60 
       
    61     private: // Constructors
       
    62 
       
    63 	    CMultiPartMixedContentHandler();
       
    64 
       
    65 	    void ConstructL();
       
    66 
       
    67     private: // New functions
       
    68 
       
    69 #ifdef __TEST_MULTIPART_MIX_SUPP
       
    70 
       
    71 	    void LoadMultipartMsgL();
       
    72 
       
    73 	    void HandlePartL();
       
    74 
       
    75 	    void NextPartL();
       
    76 
       
    77 #endif // __TEST_MULTIPART_MIX_SUPP
       
    78 
       
    79     private:	// Methods from CPushHandlerBase
       
    80 	    
       
    81 	    void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus);
       
    82 
       
    83 	    void HandleMessageL(CPushMessage* aPushMsg);
       
    84 
       
    85 	    void CancelHandleMessage();
       
    86 
       
    87 	    void CPushHandlerBase_Reserved1();
       
    88 
       
    89 	    void CPushHandlerBase_Reserved2();
       
    90 
       
    91     private:	// Methods from CActive
       
    92 
       
    93 	    void DoCancel();
       
    94 
       
    95 	    void RunL();
       
    96 
       
    97 	    TInt RunError(TInt aError);
       
    98 
       
    99     private:	// Attributes
       
   100 
       
   101 	    enum TState
       
   102             {
       
   103             ELoadMsgData, 
       
   104             EHandlePart, 
       
   105             ENextPart, 
       
   106             EDone
       
   107             };
       
   108 
       
   109 	    CMultipartIteratorBase*		iMultiMessage;
       
   110 
       
   111 	    CContentHandlerBase*		iContentHandler;
       
   112 	    
       
   113 	};
       
   114 
       
   115 
       
   116 #endif	// __CMULTIPARTMIXEDCONTENTHANDLER_H__