messagingfw/wappushfw/plugins/inc/CContentHandlerBase.inl
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
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 // Local includes
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedPartner
       
    21  @released
       
    22 */
       
    23 
       
    24 // System includes
       
    25 //
       
    26 #include <ecom/ecom.h>
       
    27 #include <push/ccontenthandlerbase.h>
       
    28 #include <push/pushlog.h>
       
    29 #include <push/pluginkiller.h>
       
    30 
       
    31 
       
    32 /** 
       
    33 Constructor. 
       
    34 */
       
    35 inline CContentHandlerBase::CContentHandlerBase()
       
    36 : CPushHandlerBase()
       
    37 	{
       
    38 	}
       
    39 
       
    40 
       
    41 /** 
       
    42 Destructor. 
       
    43 */
       
    44 inline CContentHandlerBase::~CContentHandlerBase()
       
    45 	{
       
    46 	__LOG_PTR_DEBUG("CContentHandlerBase:: Destructor Called");
       
    47 	Cancel();
       
    48 	delete iMessage;
       
    49 	}
       
    50 
       
    51 
       
    52 /** 
       
    53 Finds and instantiates an ECom WAP Push Content Handler plug-in that matches 
       
    54 the specified media type.
       
    55 
       
    56 @param aMatchData 
       
    57 Media type.
       
    58 
       
    59 @return 
       
    60 WAP Push plug-in that handles the specified media type.
       
    61 */
       
    62 inline CContentHandlerBase* CContentHandlerBase::NewL(const TDesC& aMatchData)
       
    63 	{
       
    64 	// Call base class interface CPushHandlerBase::NewL()
       
    65 	return REINTERPRET_CAST(CContentHandlerBase*, 
       
    66 							CPushHandlerBase::NewL(aMatchData, KUidPushContentHandlerBase));
       
    67 	}
       
    68 
       
    69 
       
    70 /** 
       
    71 Sets a parent message server entry for any output to be saved in the message 
       
    72 server.
       
    73 
       
    74 @param aParentID 
       
    75 ID of the parent message server entry. This is stored in iParentID. 
       
    76 */
       
    77 inline void CContentHandlerBase::SetParent(TMsvId aParentID)
       
    78 	{
       
    79 	iParentID = aParentID;
       
    80 	}
       
    81 
       
    82 
       
    83 /** 
       
    84 Provides clean-up for the plug-in.
       
    85 
       
    86 A derived class calls this when handling of the message is complete: it deletes 
       
    87 the plug-in, and if the asynchronous request iAcknowledge flag is set, sets 
       
    88 the status with the passed error code.
       
    89 
       
    90 @param aError 
       
    91 Error code. 
       
    92 */
       
    93 inline void CContentHandlerBase::Complete(TInt aError)
       
    94 	{
       
    95 	__LOG_PTR_DEBUG("CContentHandlerPluginBase:: Complete Called");
       
    96 	if (iAcknowledge)
       
    97 		SignalConfirmationStatus(aError);
       
    98 	iPluginKiller->KillPushPlugin();
       
    99 	}	
       
   100 
       
   101 
       
   102 /** 
       
   103 Utility that completes this active object with KErrNone. 
       
   104 */
       
   105 inline void CContentHandlerBase::IdleComplete()
       
   106 	{
       
   107 	TRequestStatus* pS = &iStatus;
       
   108 	User::RequestComplete(pS,KErrNone);
       
   109 	SetActive();
       
   110 	}