1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/push/ccontenthandlerbase.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,112 @@
1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Local includes
1.18 +//
1.19 +//
1.20 +
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @publishedPartner
1.26 + @released
1.27 +*/
1.28 +
1.29 +// System includes
1.30 +//
1.31 +#include <ecom/ecom.h>
1.32 +#include <push/ccontenthandlerbase.h>
1.33 +#include <push/pushlog.h>
1.34 +#include <push/pluginkiller.h>
1.35 +
1.36 +
1.37 +/**
1.38 +Constructor.
1.39 +*/
1.40 +inline CContentHandlerBase::CContentHandlerBase()
1.41 +: CPushHandlerBase()
1.42 + {
1.43 + }
1.44 +
1.45 +
1.46 +/**
1.47 +Destructor.
1.48 +*/
1.49 +inline CContentHandlerBase::~CContentHandlerBase()
1.50 + {
1.51 + __LOG_PTR_DEBUG("CContentHandlerBase:: Destructor Called");
1.52 + Cancel();
1.53 + delete iMessage;
1.54 + }
1.55 +
1.56 +
1.57 +/**
1.58 +Finds and instantiates an ECom WAP Push Content Handler plug-in that matches
1.59 +the specified media type.
1.60 +
1.61 +@param aMatchData
1.62 +Media type.
1.63 +
1.64 +@return
1.65 +WAP Push plug-in that handles the specified media type.
1.66 +*/
1.67 +inline CContentHandlerBase* CContentHandlerBase::NewL(const TDesC& aMatchData)
1.68 + {
1.69 + // Call base class interface CPushHandlerBase::NewL()
1.70 + return REINTERPRET_CAST(CContentHandlerBase*,
1.71 + CPushHandlerBase::NewL(aMatchData, KUidPushContentHandlerBase));
1.72 + }
1.73 +
1.74 +
1.75 +/**
1.76 +Sets a parent message server entry for any output to be saved in the message
1.77 +server.
1.78 +
1.79 +@param aParentID
1.80 +ID of the parent message server entry. This is stored in iParentID.
1.81 +*/
1.82 +inline void CContentHandlerBase::SetParent(TMsvId aParentID)
1.83 + {
1.84 + iParentID = aParentID;
1.85 + }
1.86 +
1.87 +
1.88 +/**
1.89 +Provides clean-up for the plug-in.
1.90 +
1.91 +A derived class calls this when handling of the message is complete: it deletes
1.92 +the plug-in, and if the asynchronous request iAcknowledge flag is set, sets
1.93 +the status with the passed error code.
1.94 +
1.95 +@param aError
1.96 +Error code.
1.97 +*/
1.98 +inline void CContentHandlerBase::Complete(TInt aError)
1.99 + {
1.100 + __LOG_PTR_DEBUG("CContentHandlerPluginBase:: Complete Called");
1.101 + if (iAcknowledge)
1.102 + SignalConfirmationStatus(aError);
1.103 + iPluginKiller->KillPushPlugin();
1.104 + }
1.105 +
1.106 +
1.107 +/**
1.108 +Utility that completes this active object with KErrNone.
1.109 +*/
1.110 +inline void CContentHandlerBase::IdleComplete()
1.111 + {
1.112 + TRequestStatus* pS = &iStatus;
1.113 + User::RequestComplete(pS,KErrNone);
1.114 + SetActive();
1.115 + }