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