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