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