|
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 // Local includes |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 // System includes |
|
27 // |
|
28 #include <ecom/ecom.h> |
|
29 #include <push/ccontenthandlerbase.h> |
|
30 #include <push/pushlog.h> |
|
31 #include <push/pluginkiller.h> |
|
32 |
|
33 |
|
34 /** |
|
35 Constructor. |
|
36 */ |
|
37 inline CContentHandlerBase::CContentHandlerBase() |
|
38 : CPushHandlerBase() |
|
39 { |
|
40 } |
|
41 |
|
42 |
|
43 /** |
|
44 Destructor. |
|
45 */ |
|
46 inline CContentHandlerBase::~CContentHandlerBase() |
|
47 { |
|
48 __LOG_PTR_DEBUG("CContentHandlerBase:: Destructor Called"); |
|
49 Cancel(); |
|
50 delete iMessage; |
|
51 } |
|
52 |
|
53 |
|
54 /** |
|
55 Finds and instantiates an ECom WAP Push Content Handler plug-in that matches |
|
56 the specified media type. |
|
57 |
|
58 @param aMatchData |
|
59 Media type. |
|
60 |
|
61 @return |
|
62 WAP Push plug-in that handles the specified media type. |
|
63 */ |
|
64 inline CContentHandlerBase* CContentHandlerBase::NewL(const TDesC& aMatchData) |
|
65 { |
|
66 // Call base class interface CPushHandlerBase::NewL() |
|
67 return REINTERPRET_CAST(CContentHandlerBase*, |
|
68 CPushHandlerBase::NewL(aMatchData, KUidPushContentHandlerBase)); |
|
69 } |
|
70 |
|
71 |
|
72 /** |
|
73 Sets a parent message server entry for any output to be saved in the message |
|
74 server. |
|
75 |
|
76 @param aParentID |
|
77 ID of the parent message server entry. This is stored in iParentID. |
|
78 */ |
|
79 inline void CContentHandlerBase::SetParent(TMsvId aParentID) |
|
80 { |
|
81 iParentID = aParentID; |
|
82 } |
|
83 |
|
84 |
|
85 /** |
|
86 Provides clean-up for the plug-in. |
|
87 |
|
88 A derived class calls this when handling of the message is complete: it deletes |
|
89 the plug-in, and if the asynchronous request iAcknowledge flag is set, sets |
|
90 the status with the passed error code. |
|
91 |
|
92 @param aError |
|
93 Error code. |
|
94 */ |
|
95 inline void CContentHandlerBase::Complete(TInt aError) |
|
96 { |
|
97 __LOG_PTR_DEBUG("CContentHandlerPluginBase:: Complete Called"); |
|
98 if (iAcknowledge) |
|
99 SignalConfirmationStatus(aError); |
|
100 iPluginKiller->KillPushPlugin(); |
|
101 } |
|
102 |
|
103 |
|
104 /** |
|
105 Utility that completes this active object with KErrNone. |
|
106 */ |
|
107 inline void CContentHandlerBase::IdleComplete() |
|
108 { |
|
109 TRequestStatus* pS = &iStatus; |
|
110 User::RequestComplete(pS,KErrNone); |
|
111 SetActive(); |
|
112 } |