pushmtm/Plugins/PushContentHandler/CMultiPartRelAndAltContentHandler.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 CMultiPartRelAndAltContentHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CMULTIPARTRELANDALTCONTENTHANDLER_H__
       
    21 #define __CMULTIPARTRELANDALTCONTENTHANDLER_H__
       
    22 
       
    23 // System includes
       
    24 //
       
    25 #include "PushMtmDef.hrh"
       
    26 #include "PushContentHandlerDef.hrh"
       
    27 #include <push/CContentHandlerBase.h>
       
    28 #include <E32Base.h>
       
    29 #include <msvstd.h>
       
    30 #include <msvapi.h>
       
    31 
       
    32 // Constants
       
    33 //
       
    34 const TUid KUidPushMultiPartRelAndAltContentHandler	= {
       
    35            EUidPushMultiPartRelAndAltContentHandler };
       
    36 
       
    37 // Forward class declarations
       
    38 //
       
    39 class CMsvSession;
       
    40 class CMultipartIteratorBase;
       
    41 
       
    42 /**
       
    43 * The MultiPart/Alternative & Multipart/Alternative Content Handler
       
    44 *
       
    45 * Saves the whole message in the Message Server, each part getting saved as a child
       
    46 * entry to the main part.
       
    47 *
       
    48 * All multipart/rel+alt messages are dropped if __TEST_MULTIPART_REL_SUPP
       
    49 * is not defined.
       
    50 */
       
    51 class CMultiPartRelAndAltContentHandler : public CContentHandlerBase,
       
    52                                           public MMsvSessionObserver
       
    53 	{
       
    54     public:	// Methods
       
    55 
       
    56 	    static CMultiPartRelAndAltContentHandler* NewL();
       
    57 
       
    58 	    virtual ~CMultiPartRelAndAltContentHandler();
       
    59 
       
    60     private: // Constructors
       
    61 
       
    62 	    CMultiPartRelAndAltContentHandler();
       
    63 
       
    64 	    void ConstructL();
       
    65 
       
    66     private: // New functions
       
    67 
       
    68 #ifdef __TEST_MULTIPART_REL_SUPP
       
    69 
       
    70         void LoadMultiPartMsgL();
       
    71 
       
    72 	    void HandlePartL();
       
    73 
       
    74 	    void NextPartL();
       
    75 
       
    76 	    void SaveMsgRootL();
       
    77 
       
    78 	    void LoadMsgDataL();
       
    79 
       
    80 	    void SetMsgCorruptFlagL();
       
    81 
       
    82 #endif // __TEST_MULTIPART_REL_SUPP
       
    83 
       
    84     private:	// Methods from CPushHandlerBase
       
    85 
       
    86 	    void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus);
       
    87 
       
    88 	    void HandleMessageL(CPushMessage* aPushMsg);
       
    89 
       
    90 	    void CancelHandleMessage();
       
    91 
       
    92 	    void CPushHandlerBase_Reserved1();
       
    93 
       
    94 	    void CPushHandlerBase_Reserved2();
       
    95 
       
    96     private:	// Methods from CActive
       
    97 
       
    98 	    void DoCancel();
       
    99 
       
   100 	    void RunL();
       
   101 
       
   102 	    TInt RunError(TInt aError);
       
   103 
       
   104     private: // from MMsvSessionObserver
       
   105 
       
   106         void HandleSessionEventL( TMsvSessionEvent aEvent,
       
   107                                   TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
   108 
       
   109     private:	// Attributes
       
   110 
       
   111 	    enum TState
       
   112             {
       
   113             ELoadMsgData,
       
   114             EHandlePart,
       
   115             EDone,
       
   116             ENextPart
       
   117             };
       
   118 
       
   119         CMsvSession* iMsvSession; ///< Has.
       
   120 
       
   121         TMsvId              iSavedMsgId;
       
   122 
       
   123 	    CMultipartIteratorBase*	iMultiMessage;
       
   124     };
       
   125 
       
   126 #endif    // __CMULTIPARTRELANDALTCONTENTHANDLER_H__
       
   127