epoc32/include/push/cpushhandlerbase.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000 (2010-03-16)
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
williamr@2
    17
williamr@2
    18
/**
williamr@2
    19
 @file
williamr@2
    20
 @publishedPartner
williamr@2
    21
 @released
williamr@2
    22
*/
williamr@2
    23
williamr@2
    24
#ifndef __CPUSHHANDLERBASE_H__
williamr@2
    25
#define __CPUSHHANDLERBASE_H__
williamr@2
    26
williamr@2
    27
// System includes
williamr@2
    28
#include <e32base.h>
williamr@2
    29
williamr@2
    30
// Forward class declarations
williamr@2
    31
class CPushMessage;
williamr@2
    32
class CPluginKiller;
williamr@2
    33
class MWapPushLog;
williamr@2
    34
class MConnManObserver;
williamr@2
    35
williamr@2
    36
/** ECom interface UID for WAP Push Application plug-ins. */
williamr@2
    37
const TUid KUidPushHandlerBase = { 0x101F3E5A };
williamr@2
    38
williamr@2
    39
/** 
williamr@2
    40
Abstract base class for WAP Push Application plugins.
williamr@2
    41
williamr@2
    42
A WAP Push Application plugin is implemented as an ECom plug-in object that 
williamr@2
    43
derives from this interface. Each plugin specifies in its ECom IMPLEMENTATION_INFO 
williamr@2
    44
default_data field the Push Application IDs that it should handle. When the 
williamr@2
    45
WAP Push Framework receives a push message, it examines the message's Application 
williamr@2
    46
ID, and loads the appropriate plug-in to handle the message with HandleMessageL().
williamr@2
    47
williamr@2
    48
A plug-in can handle multiple Application IDs. Application IDs can be specified 
williamr@2
    49
as URNs or WINA (http://www.wapforum.org/wina/push-app-id.htm) values. For 
williamr@2
    50
example, a plug-in to handle MMS would set its default_data to "x-wap-application:mms.ua||0x00000004".
williamr@2
    51
williamr@2
    52
A plug-in must destroy itself when it is has finished handling the message. 
williamr@2
    53
The framework supplies a CPluginKiller object that the plug-in calls to do 
williamr@2
    54
this. 
williamr@2
    55
williamr@2
    56
@publishedPartner
williamr@2
    57
@released
williamr@2
    58
*/
williamr@2
    59
class CPushHandlerBase : public CActive
williamr@2
    60
	{
williamr@2
    61
public:	// Methods
williamr@2
    62
williamr@2
    63
	inline static CPushHandlerBase* NewL(const TDesC& aMatchData);
williamr@2
    64
williamr@2
    65
	inline static CPushHandlerBase* NewL(const TDesC& aMatchData, const TUid& aInterfaceUid);
williamr@2
    66
williamr@2
    67
	inline virtual ~CPushHandlerBase();
williamr@2
    68
williamr@2
    69
	//Async. Functions
williamr@2
    70
	/** 
williamr@2
    71
	Handles a push message asynchronously.
williamr@2
    72
	
williamr@2
    73
	Implementations should store the passed aStatus using SetConfirmationStatus(), 
williamr@2
    74
	and when handling is complete, complete it with SignalConfirmationStatus().
williamr@2
    75
	
williamr@2
    76
	@param aPushMsg 
williamr@2
    77
	Push message. Ownership of the message is passed to the object.
williamr@2
    78
	
williamr@2
    79
	@param aStatus 
williamr@2
    80
	Asynchronous status word 
williamr@2
    81
	*/
williamr@2
    82
	virtual void HandleMessageL(CPushMessage* aPushMsg,TRequestStatus& aStatus) =0;
williamr@2
    83
williamr@2
    84
	/** 
williamr@2
    85
	Cancels an outstanding HandleMessageL() call. 
williamr@2
    86
	*/
williamr@2
    87
	virtual void CancelHandleMessage() =0;
williamr@2
    88
williamr@2
    89
	//Sync. Functions
williamr@2
    90
	/** 
williamr@2
    91
	Handles a push message synchronously.
williamr@2
    92
	
williamr@2
    93
	@param aPushMsg 
williamr@2
    94
	Push message. Ownership of the message is passed to the object. 
williamr@2
    95
	*/
williamr@2
    96
	virtual void HandleMessageL(CPushMessage* aPushMsg) =0;
williamr@2
    97
williamr@2
    98
	inline void SetLogger(MWapPushLog& aLog);
williamr@2
    99
williamr@2
   100
	inline void SetKiller(CPluginKiller& aPluginKiller);
williamr@2
   101
williamr@2
   102
	inline void SetManager(MConnManObserver& aManager);
williamr@2
   103
williamr@2
   104
protected:	// Methods
williamr@2
   105
williamr@2
   106
	CPushHandlerBase();
williamr@2
   107
williamr@2
   108
	void SetConfirmationStatus(TRequestStatus& aStatus);
williamr@2
   109
williamr@2
   110
	void SignalConfirmationStatus(TInt aErr);
williamr@2
   111
williamr@2
   112
protected:	// Attributes
williamr@2
   113
williamr@2
   114
	/** Plugin killer utility object. */
williamr@2
   115
	CPluginKiller*		iPluginKiller;
williamr@2
   116
williamr@2
   117
	/** Log interface. */
williamr@2
   118
	MWapPushLog*		iLog;
williamr@2
   119
williamr@2
   120
    /** connection manager */
williamr@2
   121
	MConnManObserver*	iManager;
williamr@2
   122
williamr@2
   123
	/** HandleMessageL() asynchronous status word. */
williamr@2
   124
	TRequestStatus*		iConfirmStatus;
williamr@2
   125
williamr@2
   126
private:	// Attributes
williamr@2
   127
williamr@2
   128
	/** A unique UID used in interface destruction */
williamr@2
   129
	TUid	iDtor_ID_Key;
williamr@2
   130
williamr@2
   131
private:	// BC-proofing
williamr@2
   132
williamr@2
   133
	/** Reserved for future expansion */
williamr@2
   134
	virtual void CPushHandlerBase_Reserved1() =0;		
williamr@2
   135
williamr@2
   136
	/** Reserved for future expansion */
williamr@2
   137
	virtual void CPushHandlerBase_Reserved2() =0;		
williamr@2
   138
williamr@2
   139
	/** Reserved for future expansion */
williamr@2
   140
	TAny*		iCPushHandlerBase_Reserved;
williamr@2
   141
williamr@2
   142
	};
williamr@2
   143
williamr@2
   144
#include <push/cpushhandlerbase.inl>
williamr@2
   145
williamr@2
   146
#endif    // __PUSHBASEHAND_H__