pushmtm/Plugins/PushContentHandler/CCOContentHandler.cpp
branchRCL_3
changeset 48 8e6fa1719340
parent 0 84ad3b177aa3
equal deleted inserted replaced
47:6385c4c93049 48:8e6fa1719340
       
     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:  Implementation of CCOContentHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "CCOContentHandler.h"
       
    23 //#include "PushMtmUtil.h"
       
    24 //#include "PushMtmSettings.h"
       
    25 //#include <msvids.h>
       
    26 //#include <XmlElemt.h>
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 #if defined(_DEBUG)
       
    31 _LIT( KErrPushMsgNull, "NULL CPushMessage" );
       
    32 #endif
       
    33 
       
    34 _LIT( KReserved, "Reserved" );
       
    35 
       
    36 // ================= MEMBER FUNCTIONS =======================
       
    37 
       
    38 // ---------------------------------------------------------
       
    39 // CCOContentHandler::NewL
       
    40 // ---------------------------------------------------------
       
    41 //
       
    42 CCOContentHandler* CCOContentHandler::NewL()
       
    43 	{
       
    44 	CCOContentHandler* self = new(ELeave) CCOContentHandler;  
       
    45 	CleanupStack::PushL( self );
       
    46 	self->ConstructL();
       
    47 	CleanupStack::Pop( self );
       
    48 	return self;
       
    49 	}
       
    50 
       
    51 // ---------------------------------------------------------
       
    52 // CCOContentHandler::~CCOContentHandler
       
    53 // ---------------------------------------------------------
       
    54 //
       
    55 CCOContentHandler::~CCOContentHandler()
       
    56 	{
       
    57     Cancel();
       
    58 	}
       
    59 
       
    60 // ---------------------------------------------------------
       
    61 // CCOContentHandler::CCOContentHandler
       
    62 // ---------------------------------------------------------
       
    63 //
       
    64 CCOContentHandler::CCOContentHandler()
       
    65 :   CContentHandlerBase()
       
    66 	{
       
    67 	}
       
    68 
       
    69 // ---------------------------------------------------------
       
    70 // CCOContentHandler::ConstructL
       
    71 // ---------------------------------------------------------
       
    72 //
       
    73 void CCOContentHandler::ConstructL()
       
    74 	{
       
    75 	CActiveScheduler::Add(this);
       
    76 	}
       
    77 
       
    78 // ---------------------------------------------------------
       
    79 // CCOContentHandler::HandleMessageL
       
    80 // ---------------------------------------------------------
       
    81 //
       
    82 void CCOContentHandler::HandleMessageL( CPushMessage* aPushMsg, 
       
    83                                         TRequestStatus& aStatus )
       
    84 	{
       
    85 	__ASSERT_DEBUG( aPushMsg != NULL, User::Panic(KErrPushMsgNull, KErrNone));
       
    86 
       
    87 	iMessage = aPushMsg;
       
    88 	iAcknowledge = ETrue;
       
    89 	SetConfirmationStatus( aStatus );
       
    90 
       
    91     iState = EDone;
       
    92 	IdleComplete();
       
    93 	}
       
    94 
       
    95 // ---------------------------------------------------------
       
    96 // CCOContentHandler::HandleMessageL
       
    97 // ---------------------------------------------------------
       
    98 //
       
    99 void CCOContentHandler::HandleMessageL( CPushMessage* aPushMsg )
       
   100 	{
       
   101 	__ASSERT_DEBUG( aPushMsg != NULL, User::Panic(KErrPushMsgNull, KErrNone));
       
   102 	
       
   103 	iAcknowledge = EFalse;
       
   104 	iMessage = aPushMsg;
       
   105 
       
   106     iState = EDone;
       
   107 	IdleComplete();
       
   108 	}
       
   109 
       
   110 // ---------------------------------------------------------
       
   111 // CCOContentHandler::CPushHandlerBase_Reserved1
       
   112 // ---------------------------------------------------------
       
   113 //
       
   114 void CCOContentHandler::CPushHandlerBase_Reserved1()
       
   115 	{
       
   116 	User::Panic(KReserved, KErrNotSupported);
       
   117 	}
       
   118 
       
   119 // ---------------------------------------------------------
       
   120 // CCOContentHandler::CPushHandlerBase_Reserved1
       
   121 // ---------------------------------------------------------
       
   122 //
       
   123 void CCOContentHandler::CPushHandlerBase_Reserved2()
       
   124 	{
       
   125 	User::Panic(KReserved, KErrNotSupported);
       
   126 	}
       
   127 
       
   128 // ---------------------------------------------------------
       
   129 // CCOContentHandler::CancelHandleMessage
       
   130 // ---------------------------------------------------------
       
   131 //
       
   132 void CCOContentHandler::CancelHandleMessage()
       
   133 	{
       
   134     Cancel();
       
   135 	}
       
   136 
       
   137 // ---------------------------------------------------------
       
   138 // CCOContentHandler::DoCancel
       
   139 // ---------------------------------------------------------
       
   140 //
       
   141 void CCOContentHandler::DoCancel()
       
   142 	{
       
   143 	Complete( KErrCancel );
       
   144 	}
       
   145 
       
   146 // ---------------------------------------------------------
       
   147 // CCOContentHandler::RunL
       
   148 // ---------------------------------------------------------
       
   149 //
       
   150 void CCOContentHandler::RunL()
       
   151 	{
       
   152 	switch( iState )
       
   153 		{
       
   154         case EDone:
       
   155             {
       
   156 			Complete( KErrNone );
       
   157 			break;
       
   158             }
       
   159 		default:
       
   160 			break;
       
   161 		}
       
   162 	}
       
   163 
       
   164 // ---------------------------------------------------------
       
   165 // CCOContentHandler::RunError
       
   166 // ---------------------------------------------------------
       
   167 //
       
   168 TInt CCOContentHandler::RunError( TInt aError )
       
   169 	{
       
   170 	iState = EDone;
       
   171 	Complete( aError );
       
   172 	return KErrNone;
       
   173 	}
       
   174