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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 #ifndef __CPUSHHANDLERBASE_H__
25 #define __CPUSHHANDLERBASE_H__
30 // Forward class declarations
34 class MConnManObserver;
36 /** ECom interface UID for WAP Push Application plug-ins. */
37 const TUid KUidPushHandlerBase = { 0x101F3E5A };
40 Abstract base class for WAP Push Application plugins.
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().
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".
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
59 class CPushHandlerBase : public CActive
63 inline static CPushHandlerBase* NewL(const TDesC& aMatchData);
65 inline static CPushHandlerBase* NewL(const TDesC& aMatchData, const TUid& aInterfaceUid);
67 inline virtual ~CPushHandlerBase();
71 Handles a push message asynchronously.
73 Implementations should store the passed aStatus using SetConfirmationStatus(),
74 and when handling is complete, complete it with SignalConfirmationStatus().
77 Push message. Ownership of the message is passed to the object.
80 Asynchronous status word
82 virtual void HandleMessageL(CPushMessage* aPushMsg,TRequestStatus& aStatus) =0;
85 Cancels an outstanding HandleMessageL() call.
87 virtual void CancelHandleMessage() =0;
91 Handles a push message synchronously.
94 Push message. Ownership of the message is passed to the object.
96 virtual void HandleMessageL(CPushMessage* aPushMsg) =0;
98 inline void SetLogger(MWapPushLog& aLog);
100 inline void SetKiller(CPluginKiller& aPluginKiller);
102 inline void SetManager(MConnManObserver& aManager);
104 protected: // Methods
108 void SetConfirmationStatus(TRequestStatus& aStatus);
110 void SignalConfirmationStatus(TInt aErr);
112 protected: // Attributes
114 /** Plugin killer utility object. */
115 CPluginKiller* iPluginKiller;
117 /** Log interface. */
120 /** connection manager */
121 MConnManObserver* iManager;
123 /** HandleMessageL() asynchronous status word. */
124 TRequestStatus* iConfirmStatus;
126 private: // Attributes
128 /** A unique UID used in interface destruction */
131 private: // BC-proofing
133 /** Reserved for future expansion */
134 virtual void CPushHandlerBase_Reserved1() =0;
136 /** Reserved for future expansion */
137 virtual void CPushHandlerBase_Reserved2() =0;
139 /** Reserved for future expansion */
140 TAny* iCPushHandlerBase_Reserved;
144 #include <push/cpushhandlerbase.inl>
146 #endif // __PUSHBASEHAND_H__